From 5262a872f308b3b584c97d621992fb3877e392b8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 05:10:08 +0200 Subject: Adding upstream version 5.6.1+really5.4.5. Signed-off-by: Daniel Baumann --- ABOUT-NLS | 1 + AUTHORS | 39 + CMakeLists.txt | 1383 + COPYING | 76 + COPYING.GPLv2 | 339 + COPYING.GPLv3 | 674 + COPYING.LGPLv2.1 | 502 + ChangeLog | 11756 +++++++++ INSTALL | 765 + INSTALL.generic | 368 + Makefile.am | 134 + Makefile.in | 1121 + NEWS | 1798 ++ PACKAGERS | 243 + README | 307 + THANKS | 174 + TODO | 109 + aclocal.m4 | 1196 + autogen.sh | 56 + build-aux/compile | 348 + build-aux/config.guess | 1754 ++ build-aux/config.rpath | 684 + build-aux/config.sub | 1890 ++ build-aux/depcomp | 791 + build-aux/install-sh | 541 + build-aux/ltmain.sh | 11437 +++++++++ build-aux/manconv.sh | 58 + build-aux/missing | 215 + build-aux/test-driver | 153 + build-aux/version.sh | 24 + cmake/remove-ordinals.cmake | 26 + cmake/tuklib_common.cmake | 49 + cmake/tuklib_cpucores.cmake | 180 + cmake/tuklib_integer.cmake | 101 + cmake/tuklib_large_file_support.cmake | 52 + cmake/tuklib_mbstr.cmake | 20 + cmake/tuklib_physmem.cmake | 150 + cmake/tuklib_progname.cmake | 18 + config.h.in | 601 + configure | 24905 +++++++++++++++++++ configure.ac | 1191 + debug/Makefile.am | 30 + debug/Makefile.in | 735 + debug/README | 17 + debug/crc32.c | 39 + debug/full_flush.c | 103 + debug/hex2bin.c | 53 + debug/known_sizes.c | 129 + debug/memusage.c | 51 + debug/repeat.c | 36 + debug/sync_flush.c | 125 + debug/translation.bash | 100 + doc/api/annotated.html | 68 + doc/api/base_8h.html | 580 + doc/api/bc_s.png | Bin 0 -> 675 bytes doc/api/bc_sd.png | Bin 0 -> 604 bytes doc/api/bcj_8h.html | 105 + doc/api/block_8h.html | 758 + doc/api/check_8h.html | 340 + doc/api/classes.html | 60 + doc/api/closed.png | Bin 0 -> 132 bytes doc/api/container_8h.html | 1279 + doc/api/delta_8h.html | 132 + doc/api/dir_b17a1d403082bd69a703ed987cf158fb.html | 104 + doc/api/doc.svg | 12 + doc/api/docd.svg | 12 + doc/api/doxygen.css | 2017 ++ doc/api/doxygen.svg | 28 + doc/api/files.html | 74 + doc/api/filter_8h.html | 1342 + doc/api/folderclosed.svg | 11 + doc/api/folderclosedd.svg | 11 + doc/api/folderopen.svg | 17 + doc/api/folderopend.svg | 12 + doc/api/functions.html | 210 + doc/api/functions_vars.html | 210 + doc/api/globals.html | 272 + doc/api/globals_defs.html | 119 + doc/api/globals_enum.html | 71 + doc/api/globals_eval.html | 103 + doc/api/globals_func.html | 177 + doc/api/globals_type.html | 68 + doc/api/hardware_8h.html | 123 + doc/api/index.html | 53 + doc/api/index_8h.html | 1268 + doc/api/index__hash_8h.html | 311 + doc/api/lzma12_8h.html | 436 + doc/api/lzma_8h.html | 109 + doc/api/nav_f.png | Bin 0 -> 167 bytes doc/api/nav_fd.png | Bin 0 -> 144 bytes doc/api/nav_g.png | Bin 0 -> 95 bytes doc/api/nav_h.png | Bin 0 -> 97 bytes doc/api/nav_hd.png | Bin 0 -> 104 bytes doc/api/open.png | Bin 0 -> 121 bytes doc/api/splitbar.png | Bin 0 -> 309 bytes doc/api/splitbard.png | Bin 0 -> 278 bytes doc/api/stream__flags_8h.html | 348 + doc/api/structlzma__allocator.html | 153 + doc/api/structlzma__block.html | 347 + doc/api/structlzma__filter.html | 114 + doc/api/structlzma__index__iter.html | 407 + doc/api/structlzma__mt.html | 256 + doc/api/structlzma__options__bcj.html | 95 + doc/api/structlzma__options__delta.html | 113 + doc/api/structlzma__options__lzma.html | 363 + doc/api/structlzma__stream.html | 251 + doc/api/structlzma__stream__flags.html | 134 + doc/api/sync_off.png | Bin 0 -> 857 bytes doc/api/sync_on.png | Bin 0 -> 851 bytes doc/api/tab_a.png | Bin 0 -> 135 bytes doc/api/tab_ad.png | Bin 0 -> 133 bytes doc/api/tab_b.png | Bin 0 -> 178 bytes doc/api/tab_bd.png | Bin 0 -> 157 bytes doc/api/tab_h.png | Bin 0 -> 179 bytes doc/api/tab_hd.png | Bin 0 -> 168 bytes doc/api/tab_s.png | Bin 0 -> 208 bytes doc/api/tab_sd.png | Bin 0 -> 171 bytes doc/api/tabs.css | 62 + doc/api/version_8h.html | 239 + doc/api/vli_8h.html | 323 + doc/examples/00_README.txt | 31 + doc/examples/01_compress_easy.c | 297 + doc/examples/02_decompress.c | 287 + doc/examples/03_compress_custom.c | 193 + doc/examples/04_compress_easy_mt.c | 206 + doc/examples/Makefile | 25 + doc/examples_old/xz_pipe_comp.c | 127 + doc/examples_old/xz_pipe_decomp.c | 123 + doc/faq.txt | 244 + doc/history.txt | 150 + doc/lzma-file-format.txt | 173 + doc/man/pdf-a4/lzmainfo-a4.pdf | Bin 0 -> 16384 bytes doc/man/pdf-a4/xz-a4.pdf | Bin 0 -> 114746 bytes doc/man/pdf-a4/xzdec-a4.pdf | Bin 0 -> 19978 bytes doc/man/pdf-a4/xzdiff-a4.pdf | Bin 0 -> 17200 bytes doc/man/pdf-a4/xzgrep-a4.pdf | Bin 0 -> 18338 bytes doc/man/pdf-a4/xzless-a4.pdf | Bin 0 -> 15029 bytes doc/man/pdf-a4/xzmore-a4.pdf | Bin 0 -> 15203 bytes doc/man/pdf-letter/lzmainfo-letter.pdf | Bin 0 -> 16394 bytes doc/man/pdf-letter/xz-letter.pdf | Bin 0 -> 115882 bytes doc/man/pdf-letter/xzdec-letter.pdf | Bin 0 -> 19970 bytes doc/man/pdf-letter/xzdiff-letter.pdf | Bin 0 -> 17227 bytes doc/man/pdf-letter/xzgrep-letter.pdf | Bin 0 -> 18322 bytes doc/man/pdf-letter/xzless-letter.pdf | Bin 0 -> 15022 bytes doc/man/pdf-letter/xzmore-letter.pdf | Bin 0 -> 15159 bytes doc/man/txt/lzmainfo.txt | 40 + doc/man/txt/xz.txt | 1586 ++ doc/man/txt/xzdec.txt | 80 + doc/man/txt/xzdiff.txt | 37 + doc/man/txt/xzgrep.txt | 49 + doc/man/txt/xzless.txt | 39 + doc/man/txt/xzmore.txt | 34 + doc/xz-file-format.txt | 1165 + dos/INSTALL.txt | 78 + dos/Makefile | 149 + dos/README.txt | 123 + dos/config.h | 153 + doxygen/Doxyfile | 2687 ++ doxygen/update-doxygen | 111 + extra/7z2lzma/7z2lzma.bash | 115 + extra/scanlzma/scanlzma.c | 88 + lib/Makefile.am | 32 + lib/Makefile.in | 600 + lib/getopt.c | 1197 + lib/getopt.in.h | 226 + lib/getopt1.c | 171 + lib/getopt_int.h | 131 + m4/ax_check_capsicum.m4 | 85 + m4/ax_pthread.m4 | 522 + m4/getopt.m4 | 71 + m4/gettext.m4 | 386 + m4/host-cpu-c-abi.m4 | 678 + m4/iconv.m4 | 283 + m4/intlmacosx.m4 | 65 + m4/lib-ld.m4 | 168 + m4/lib-link.m4 | 813 + m4/lib-prefix.m4 | 323 + m4/libtool.m4 | 8399 +++++++ m4/ltoptions.m4 | 437 + m4/ltsugar.m4 | 124 + m4/ltversion.m4 | 24 + m4/lt~obsolete.m4 | 99 + m4/nls.m4 | 32 + m4/po.m4 | 454 + m4/posix-shell.m4 | 63 + m4/progtest.m4 | 91 + m4/tuklib_common.m4 | 22 + m4/tuklib_cpucores.m4 | 180 + m4/tuklib_integer.m4 | 131 + m4/tuklib_mbstr.m4 | 30 + m4/tuklib_physmem.m4 | 211 + m4/tuklib_progname.m4 | 28 + m4/visibility.m4 | 82 + macosx/build.sh | 113 + po/LINGUAS | 23 + po/Makefile.in.in | 510 + po/Makevars | 46 + po/POTFILES.in | 13 + po/Rules-quot | 62 + po/boldquot.sed | 10 + po/ca.gmo | Bin 0 -> 26876 bytes po/ca.po | 1044 + po/cs.gmo | Bin 0 -> 17576 bytes po/cs.po | 1150 + po/da.gmo | Bin 0 -> 12015 bytes po/da.po | 1021 + po/de.gmo | Bin 0 -> 28599 bytes po/de.po | 1065 + po/en@boldquot.header | 25 + po/en@quot.header | 22 + po/eo.gmo | Bin 0 -> 26139 bytes po/eo.po | 1038 + po/es.gmo | Bin 0 -> 27192 bytes po/es.po | 1082 + po/fi.gmo | Bin 0 -> 25923 bytes po/fi.po | 1072 + po/fr.gmo | Bin 0 -> 22307 bytes po/fr.po | 1148 + po/hr.gmo | Bin 0 -> 26682 bytes po/hr.po | 1079 + po/hu.gmo | Bin 0 -> 27374 bytes po/hu.po | 1086 + po/insert-header.sin | 28 + po/it.gmo | Bin 0 -> 22043 bytes po/it.po | 1138 + po/ko.gmo | Bin 0 -> 27394 bytes po/ko.po | 1070 + po/pl.gmo | Bin 0 -> 26643 bytes po/pl.po | 1033 + po/pt.gmo | Bin 0 -> 21887 bytes po/pt.po | 1151 + po/pt_BR.gmo | Bin 0 -> 26890 bytes po/pt_BR.po | 1097 + po/quot.sed | 6 + po/remove-potcdate.sin | 25 + po/ro.gmo | Bin 0 -> 28538 bytes po/ro.po | 1138 + po/sr.gmo | Bin 0 -> 27551 bytes po/sr.po | 1137 + po/stamp-po | 1 + po/sv.gmo | Bin 0 -> 26576 bytes po/sv.po | 1084 + po/tr.gmo | Bin 0 -> 26545 bytes po/tr.po | 1037 + po/uk.gmo | Bin 0 -> 35322 bytes po/uk.po | 1094 + po/vi.gmo | Bin 0 -> 28619 bytes po/vi.po | 1079 + po/xz.pot | 930 + po/zh_CN.gmo | Bin 0 -> 25247 bytes po/zh_CN.po | 1059 + po/zh_TW.gmo | Bin 0 -> 24823 bytes po/zh_TW.po | 1063 + po4a/.gitignore | 2 + po4a/de.po | 5850 +++++ po4a/fr.po | 6204 +++++ po4a/ko.po | 5555 +++++ po4a/man/de/lzmainfo.1 | 45 + po4a/man/de/xz.1 | 1938 ++ po4a/man/de/xzdec.1 | 87 + po4a/man/de/xzdiff.1 | 45 + po4a/man/de/xzgrep.1 | 64 + po4a/man/de/xzless.1 | 47 + po4a/man/de/xzmore.1 | 40 + po4a/man/fr/lzmainfo.1 | 44 + po4a/man/fr/xz.1 | 1870 ++ po4a/man/fr/xzdec.1 | 87 + po4a/man/fr/xzdiff.1 | 43 + po4a/man/fr/xzless.1 | 46 + po4a/man/fr/xzmore.1 | 41 + po4a/man/ko/lzmainfo.1 | 37 + po4a/man/ko/xz.1 | 1445 ++ po4a/man/ko/xzdec.1 | 71 + po4a/man/ko/xzdiff.1 | 39 + po4a/man/ko/xzgrep.1 | 57 + po4a/man/ko/xzless.1 | 39 + po4a/man/ko/xzmore.1 | 36 + po4a/man/pt_BR/lzmainfo.1 | 43 + po4a/man/pt_BR/xz.1 | 1837 ++ po4a/man/pt_BR/xzdec.1 | 85 + po4a/man/pt_BR/xzdiff.1 | 44 + po4a/man/pt_BR/xzgrep.1 | 63 + po4a/man/pt_BR/xzless.1 | 46 + po4a/man/pt_BR/xzmore.1 | 39 + po4a/man/ro/lzmainfo.1 | 44 + po4a/man/ro/xz.1 | 1921 ++ po4a/man/ro/xzdec.1 | 88 + po4a/man/ro/xzdiff.1 | 45 + po4a/man/ro/xzgrep.1 | 64 + po4a/man/ro/xzless.1 | 47 + po4a/man/ro/xzmore.1 | 40 + po4a/man/uk/lzmainfo.1 | 44 + po4a/man/uk/xz.1 | 1868 ++ po4a/man/uk/xzdec.1 | 84 + po4a/man/uk/xzdiff.1 | 44 + po4a/man/uk/xzgrep.1 | 64 + po4a/man/uk/xzless.1 | 47 + po4a/man/uk/xzmore.1 | 40 + po4a/po4a.conf | 14 + po4a/pt_BR.po | 5748 +++++ po4a/ro.po | 5838 +++++ po4a/uk.po | 5760 +++++ po4a/update-po | 45 + po4a/xz-man.pot | 4642 ++++ src/Makefile.am | 42 + src/Makefile.in | 696 + src/common/common_w32res.rc | 52 + src/common/mythread.h | 528 + src/common/sysdefs.h | 197 + src/common/tuklib_common.h | 71 + src/common/tuklib_config.h | 10 + src/common/tuklib_cpucores.c | 109 + src/common/tuklib_cpucores.h | 23 + src/common/tuklib_exit.c | 58 + src/common/tuklib_exit.h | 25 + src/common/tuklib_gettext.h | 44 + src/common/tuklib_integer.h | 946 + src/common/tuklib_mbstr.h | 66 + src/common/tuklib_mbstr_fw.c | 31 + src/common/tuklib_mbstr_width.c | 65 + src/common/tuklib_open_stdxxx.c | 57 + src/common/tuklib_open_stdxxx.h | 23 + src/common/tuklib_physmem.c | 234 + src/common/tuklib_physmem.h | 28 + src/common/tuklib_progname.c | 50 + src/common/tuklib_progname.h | 32 + src/liblzma/Makefile.am | 130 + src/liblzma/Makefile.in | 2236 ++ src/liblzma/api/Makefile.am | 23 + src/liblzma/api/Makefile.in | 630 + src/liblzma/api/lzma.h | 328 + src/liblzma/api/lzma/base.h | 748 + src/liblzma/api/lzma/bcj.h | 94 + src/liblzma/api/lzma/block.h | 695 + src/liblzma/api/lzma/check.h | 164 + src/liblzma/api/lzma/container.h | 968 + src/liblzma/api/lzma/delta.h | 96 + src/liblzma/api/lzma/filter.h | 770 + src/liblzma/api/lzma/hardware.h | 63 + src/liblzma/api/lzma/index.h | 860 + src/liblzma/api/lzma/index_hash.h | 124 + src/liblzma/api/lzma/lzma12.h | 569 + src/liblzma/api/lzma/stream_flags.h | 266 + src/liblzma/api/lzma/version.h | 135 + src/liblzma/api/lzma/vli.h | 168 + src/liblzma/check/Makefile.inc | 53 + src/liblzma/check/check.c | 174 + src/liblzma/check/check.h | 175 + src/liblzma/check/crc32_fast.c | 82 + src/liblzma/check/crc32_small.c | 68 + src/liblzma/check/crc32_table.c | 22 + src/liblzma/check/crc32_table_be.h | 525 + src/liblzma/check/crc32_table_le.h | 525 + src/liblzma/check/crc32_tablegen.c | 117 + src/liblzma/check/crc32_x86.S | 313 + src/liblzma/check/crc64_fast.c | 538 + src/liblzma/check/crc64_small.c | 58 + src/liblzma/check/crc64_table.c | 33 + src/liblzma/check/crc64_table_be.h | 521 + src/liblzma/check/crc64_table_le.h | 521 + src/liblzma/check/crc64_tablegen.c | 88 + src/liblzma/check/crc64_x86.S | 296 + src/liblzma/check/crc_macros.h | 30 + src/liblzma/check/sha256.c | 196 + src/liblzma/common/Makefile.inc | 104 + src/liblzma/common/alone_decoder.c | 249 + src/liblzma/common/alone_decoder.h | 23 + src/liblzma/common/alone_encoder.c | 152 + src/liblzma/common/auto_decoder.c | 206 + src/liblzma/common/block_buffer_decoder.c | 80 + src/liblzma/common/block_buffer_encoder.c | 355 + src/liblzma/common/block_buffer_encoder.h | 24 + src/liblzma/common/block_decoder.c | 289 + src/liblzma/common/block_decoder.h | 22 + src/liblzma/common/block_encoder.c | 227 + src/liblzma/common/block_encoder.h | 47 + src/liblzma/common/block_header_decoder.c | 115 + src/liblzma/common/block_header_encoder.c | 132 + src/liblzma/common/block_util.c | 90 + src/liblzma/common/common.c | 481 + src/liblzma/common/common.h | 413 + src/liblzma/common/easy_buffer_encoder.c | 27 + src/liblzma/common/easy_decoder_memusage.c | 24 + src/liblzma/common/easy_encoder.c | 24 + src/liblzma/common/easy_encoder_memusage.c | 24 + src/liblzma/common/easy_preset.c | 27 + src/liblzma/common/easy_preset.h | 32 + src/liblzma/common/file_info.c | 855 + src/liblzma/common/filter_buffer_decoder.c | 88 + src/liblzma/common/filter_buffer_encoder.c | 55 + src/liblzma/common/filter_common.c | 385 + src/liblzma/common/filter_common.h | 51 + src/liblzma/common/filter_decoder.c | 198 + src/liblzma/common/filter_decoder.h | 23 + src/liblzma/common/filter_encoder.c | 308 + src/liblzma/common/filter_encoder.h | 27 + src/liblzma/common/filter_flags_decoder.c | 46 + src/liblzma/common/filter_flags_encoder.c | 56 + src/liblzma/common/hardware_cputhreads.c | 34 + src/liblzma/common/hardware_physmem.c | 25 + src/liblzma/common/index.c | 1269 + src/liblzma/common/index.h | 81 + src/liblzma/common/index_decoder.c | 362 + src/liblzma/common/index_decoder.h | 25 + src/liblzma/common/index_encoder.c | 263 + src/liblzma/common/index_encoder.h | 23 + src/liblzma/common/index_hash.c | 343 + src/liblzma/common/lzip_decoder.c | 418 + src/liblzma/common/lzip_decoder.h | 22 + src/liblzma/common/memcmplen.h | 173 + src/liblzma/common/microlzma_decoder.c | 221 + src/liblzma/common/microlzma_encoder.c | 141 + src/liblzma/common/outqueue.c | 287 + src/liblzma/common/outqueue.h | 254 + src/liblzma/common/stream_buffer_decoder.c | 91 + src/liblzma/common/stream_buffer_encoder.c | 142 + src/liblzma/common/stream_decoder.c | 474 + src/liblzma/common/stream_decoder.h | 22 + src/liblzma/common/stream_decoder_mt.c | 2018 ++ src/liblzma/common/stream_encoder.c | 355 + src/liblzma/common/stream_encoder_mt.c | 1283 + src/liblzma/common/stream_flags_common.c | 47 + src/liblzma/common/stream_flags_common.h | 36 + src/liblzma/common/stream_flags_decoder.c | 88 + src/liblzma/common/stream_flags_encoder.c | 86 + src/liblzma/common/string_conversion.c | 1324 + src/liblzma/common/vli_decoder.c | 86 + src/liblzma/common/vli_encoder.c | 69 + src/liblzma/common/vli_size.c | 30 + src/liblzma/delta/Makefile.inc | 23 + src/liblzma/delta/delta_common.c | 73 + src/liblzma/delta/delta_common.h | 20 + src/liblzma/delta/delta_decoder.c | 83 + src/liblzma/delta/delta_decoder.h | 26 + src/liblzma/delta/delta_encoder.c | 133 + src/liblzma/delta/delta_encoder.h | 24 + src/liblzma/delta/delta_private.h | 37 + src/liblzma/liblzma.pc.in | 20 + src/liblzma/liblzma_generic.map | 121 + src/liblzma/liblzma_linux.map | 136 + src/liblzma/liblzma_w32res.rc | 12 + src/liblzma/lz/Makefile.inc | 22 + src/liblzma/lz/lz_decoder.c | 304 + src/liblzma/lz/lz_decoder.h | 234 + src/liblzma/lz/lz_encoder.c | 633 + src/liblzma/lz/lz_encoder.h | 341 + src/liblzma/lz/lz_encoder_hash.h | 109 + src/liblzma/lz/lz_encoder_hash_table.h | 68 + src/liblzma/lz/lz_encoder_mf.c | 745 + src/liblzma/lzma/Makefile.inc | 44 + src/liblzma/lzma/fastpos.h | 142 + src/liblzma/lzma/fastpos_table.c | 519 + src/liblzma/lzma/fastpos_tablegen.c | 57 + src/liblzma/lzma/lzma2_decoder.c | 311 + src/liblzma/lzma/lzma2_decoder.h | 29 + src/liblzma/lzma/lzma2_encoder.c | 414 + src/liblzma/lzma/lzma2_encoder.h | 43 + src/liblzma/lzma/lzma_common.h | 225 + src/liblzma/lzma/lzma_decoder.c | 1133 + src/liblzma/lzma/lzma_decoder.h | 53 + src/liblzma/lzma/lzma_encoder.c | 784 + src/liblzma/lzma/lzma_encoder.h | 59 + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 170 + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 859 + src/liblzma/lzma/lzma_encoder_presets.c | 64 + src/liblzma/lzma/lzma_encoder_private.h | 162 + src/liblzma/rangecoder/Makefile.inc | 21 + src/liblzma/rangecoder/price.h | 93 + src/liblzma/rangecoder/price_table.c | 22 + src/liblzma/rangecoder/price_tablegen.c | 87 + src/liblzma/rangecoder/range_common.h | 71 + src/liblzma/rangecoder/range_decoder.h | 185 + src/liblzma/rangecoder/range_encoder.h | 350 + src/liblzma/simple/Makefile.inc | 51 + src/liblzma/simple/arm.c | 75 + src/liblzma/simple/arm64.c | 137 + src/liblzma/simple/armthumb.c | 80 + src/liblzma/simple/ia64.c | 116 + src/liblzma/simple/powerpc.c | 80 + src/liblzma/simple/simple_coder.c | 292 + src/liblzma/simple/simple_coder.h | 81 + src/liblzma/simple/simple_decoder.c | 40 + src/liblzma/simple/simple_decoder.h | 22 + src/liblzma/simple/simple_encoder.c | 38 + src/liblzma/simple/simple_encoder.h | 23 + src/liblzma/simple/simple_private.h | 74 + src/liblzma/simple/sparc.c | 87 + src/liblzma/simple/x86.c | 163 + src/liblzma/validate_map.sh | 165 + src/lzmainfo/Makefile.am | 39 + src/lzmainfo/Makefile.in | 837 + src/lzmainfo/lzmainfo.1 | 60 + src/lzmainfo/lzmainfo.c | 221 + src/lzmainfo/lzmainfo_w32res.rc | 12 + src/scripts/Makefile.am | 89 + src/scripts/Makefile.in | 700 + src/scripts/xzdiff.1 | 79 + src/scripts/xzdiff.in | 215 + src/scripts/xzgrep.1 | 113 + src/scripts/xzgrep.in | 298 + src/scripts/xzless.1 | 69 + src/scripts/xzless.in | 59 + src/scripts/xzmore.1 | 55 + src/scripts/xzmore.in | 79 + src/xz/Makefile.am | 133 + src/xz/Makefile.in | 1162 + src/xz/args.c | 763 + src/xz/args.h | 44 + src/xz/coder.c | 1109 + src/xz/coder.h | 79 + src/xz/file_io.c | 1403 ++ src/xz/file_io.h | 179 + src/xz/hardware.c | 338 + src/xz/hardware.h | 75 + src/xz/list.c | 1318 + src/xz/list.h | 18 + src/xz/main.c | 344 + src/xz/main.h | 30 + src/xz/message.c | 1146 + src/xz/message.h | 156 + src/xz/mytime.c | 86 + src/xz/mytime.h | 43 + src/xz/options.c | 359 + src/xz/options.h | 31 + src/xz/private.h | 66 + src/xz/signals.c | 209 + src/xz/signals.h | 43 + src/xz/suffix.c | 401 + src/xz/suffix.h | 36 + src/xz/util.c | 287 + src/xz/util.h | 119 + src/xz/xz.1 | 3020 +++ src/xz/xz_w32res.rc | 12 + src/xzdec/Makefile.am | 111 + src/xzdec/Makefile.in | 969 + src/xzdec/lzmadec_w32res.rc | 12 + src/xzdec/xzdec.1 | 146 + src/xzdec/xzdec.c | 326 + src/xzdec/xzdec_w32res.rc | 12 + tests/Makefile.am | 76 + tests/Makefile.in | 1349 + tests/bcj_test.c | 65 + tests/compress_prepared_bcj_sparc | Bin 0 -> 1240 bytes tests/compress_prepared_bcj_x86 | Bin 0 -> 1388 bytes tests/create_compress_files.c | 163 + tests/files/README | 409 + tests/files/bad-0-backward_size.xz | Bin 0 -> 32 bytes tests/files/bad-0-empty-truncated.xz | Bin 0 -> 31 bytes tests/files/bad-0-footer_magic.xz | Bin 0 -> 32 bytes tests/files/bad-0-header_magic.xz | Bin 0 -> 32 bytes tests/files/bad-0-nonempty_index.xz | Bin 0 -> 32 bytes tests/files/bad-0cat-alone.xz | Bin 0 -> 55 bytes tests/files/bad-0cat-header_magic.xz | Bin 0 -> 64 bytes tests/files/bad-0catpad-empty.xz | Bin 0 -> 69 bytes tests/files/bad-0pad-empty.xz | Bin 0 -> 37 bytes tests/files/bad-1-block_header-1.xz | Bin 0 -> 64 bytes tests/files/bad-1-block_header-2.xz | Bin 0 -> 64 bytes tests/files/bad-1-block_header-3.xz | Bin 0 -> 68 bytes tests/files/bad-1-block_header-4.xz | Bin 0 -> 76 bytes tests/files/bad-1-block_header-5.xz | Bin 0 -> 72 bytes tests/files/bad-1-block_header-6.xz | Bin 0 -> 72 bytes tests/files/bad-1-check-crc32-2.xz | Bin 0 -> 72 bytes tests/files/bad-1-check-crc32.xz | Bin 0 -> 68 bytes tests/files/bad-1-check-crc64.xz | Bin 0 -> 72 bytes tests/files/bad-1-check-sha256.xz | Bin 0 -> 96 bytes tests/files/bad-1-lzma2-1.xz | Bin 0 -> 64 bytes tests/files/bad-1-lzma2-10.xz | Bin 0 -> 60 bytes tests/files/bad-1-lzma2-11.xz | Bin 0 -> 64 bytes tests/files/bad-1-lzma2-2.xz | Bin 0 -> 424 bytes tests/files/bad-1-lzma2-3.xz | Bin 0 -> 424 bytes tests/files/bad-1-lzma2-4.xz | Bin 0 -> 408 bytes tests/files/bad-1-lzma2-5.xz | Bin 0 -> 408 bytes tests/files/bad-1-lzma2-6.xz | Bin 0 -> 68 bytes tests/files/bad-1-lzma2-7.xz | Bin 0 -> 408 bytes tests/files/bad-1-lzma2-8.xz | Bin 0 -> 464 bytes tests/files/bad-1-lzma2-9.xz | Bin 0 -> 72 bytes tests/files/bad-1-stream_flags-1.xz | Bin 0 -> 68 bytes tests/files/bad-1-stream_flags-2.xz | Bin 0 -> 68 bytes tests/files/bad-1-stream_flags-3.xz | Bin 0 -> 68 bytes tests/files/bad-1-v0-uncomp-size.lz | Bin 0 -> 42 bytes tests/files/bad-1-v1-crc32.lz | Bin 0 -> 50 bytes tests/files/bad-1-v1-dict-1.lz | Bin 0 -> 50 bytes tests/files/bad-1-v1-dict-2.lz | Bin 0 -> 50 bytes tests/files/bad-1-v1-magic-1.lz | Bin 0 -> 50 bytes tests/files/bad-1-v1-magic-2.lz | Bin 0 -> 50 bytes tests/files/bad-1-v1-member-size.lz | Bin 0 -> 50 bytes tests/files/bad-1-v1-trailing-magic.lz | Bin 0 -> 54 bytes tests/files/bad-1-v1-uncomp-size.lz | Bin 0 -> 50 bytes tests/files/bad-1-vli-1.xz | Bin 0 -> 72 bytes tests/files/bad-1-vli-2.xz | Bin 0 -> 76 bytes tests/files/bad-2-compressed_data_padding.xz | Bin 0 -> 92 bytes tests/files/bad-2-index-1.xz | Bin 0 -> 92 bytes tests/files/bad-2-index-2.xz | Bin 0 -> 92 bytes tests/files/bad-2-index-3.xz | Bin 0 -> 92 bytes tests/files/bad-2-index-4.xz | Bin 0 -> 92 bytes tests/files/bad-2-index-5.xz | Bin 0 -> 92 bytes tests/files/bad-3-index-uncomp-overflow.xz | Bin 0 -> 132 bytes tests/files/bad-too_big_size-with_eopm.lzma | Bin 0 -> 37 bytes tests/files/bad-too_small_size-without_eopm-1.lzma | Bin 0 -> 31 bytes tests/files/bad-too_small_size-without_eopm-2.lzma | Bin 0 -> 31 bytes tests/files/bad-too_small_size-without_eopm-3.lzma | Bin 0 -> 36 bytes tests/files/bad-unknown_size-without_eopm.lzma | Bin 0 -> 31 bytes tests/files/good-0-empty.xz | Bin 0 -> 32 bytes tests/files/good-0cat-empty.xz | Bin 0 -> 64 bytes tests/files/good-0catpad-empty.xz | Bin 0 -> 68 bytes tests/files/good-0pad-empty.xz | Bin 0 -> 36 bytes tests/files/good-1-3delta-lzma2.xz | Bin 0 -> 528 bytes tests/files/good-1-arm64-lzma2-1.xz | Bin 0 -> 512 bytes tests/files/good-1-arm64-lzma2-2.xz | Bin 0 -> 488 bytes tests/files/good-1-block_header-1.xz | Bin 0 -> 72 bytes tests/files/good-1-block_header-2.xz | Bin 0 -> 68 bytes tests/files/good-1-block_header-3.xz | Bin 0 -> 68 bytes tests/files/good-1-check-crc32.xz | Bin 0 -> 68 bytes tests/files/good-1-check-crc64.xz | Bin 0 -> 72 bytes tests/files/good-1-check-none.xz | Bin 0 -> 64 bytes tests/files/good-1-check-sha256.xz | Bin 0 -> 96 bytes tests/files/good-1-delta-lzma2.tiff.xz | Bin 0 -> 51316 bytes tests/files/good-1-empty-bcj-lzma2.xz | Bin 0 -> 52 bytes tests/files/good-1-lzma2-1.xz | Bin 0 -> 424 bytes tests/files/good-1-lzma2-2.xz | Bin 0 -> 424 bytes tests/files/good-1-lzma2-3.xz | Bin 0 -> 408 bytes tests/files/good-1-lzma2-4.xz | Bin 0 -> 464 bytes tests/files/good-1-lzma2-5.xz | Bin 0 -> 52 bytes tests/files/good-1-sparc-lzma2.xz | Bin 0 -> 612 bytes tests/files/good-1-v0-trailing-1.lz | Bin 0 -> 59 bytes tests/files/good-1-v0.lz | Bin 0 -> 42 bytes tests/files/good-1-v1-trailing-1.lz | Bin 0 -> 67 bytes tests/files/good-1-v1-trailing-2.lz | Bin 0 -> 70 bytes tests/files/good-1-v1.lz | Bin 0 -> 50 bytes tests/files/good-1-x86-lzma2.xz | Bin 0 -> 716 bytes tests/files/good-2-lzma2.xz | Bin 0 -> 92 bytes tests/files/good-2-v0-v1.lz | Bin 0 -> 78 bytes tests/files/good-2-v1-v0.lz | Bin 0 -> 78 bytes tests/files/good-2-v1-v1.lz | Bin 0 -> 86 bytes tests/files/good-known_size-with_eopm.lzma | Bin 0 -> 37 bytes tests/files/good-known_size-without_eopm.lzma | Bin 0 -> 31 bytes tests/files/good-unknown_size-with_eopm.lzma | Bin 0 -> 37 bytes tests/files/unsupported-1-v234.lz | Bin 0 -> 50 bytes tests/files/unsupported-block_header.xz | Bin 0 -> 68 bytes tests/files/unsupported-check.xz | Bin 0 -> 68 bytes tests/files/unsupported-filter_flags-1.xz | Bin 0 -> 68 bytes tests/files/unsupported-filter_flags-2.xz | Bin 0 -> 68 bytes tests/files/unsupported-filter_flags-3.xz | Bin 0 -> 68 bytes tests/ossfuzz/Makefile | 7 + tests/ossfuzz/config/fuzz.dict | 2 + tests/ossfuzz/config/fuzz.options | 2 + tests/ossfuzz/fuzz.c | 82 + tests/test_bcj_exact_size.c | 124 + tests/test_block_header.c | 520 + tests/test_check.c | 390 + tests/test_compress.sh | 150 + tests/test_compress_generated_abc | 3 + tests/test_compress_generated_random | 3 + tests/test_compress_generated_text | 3 + tests/test_compress_prepared_bcj_sparc | 3 + tests/test_compress_prepared_bcj_x86 | 3 + tests/test_files.sh | 197 + tests/test_filter_flags.c | 527 + tests/test_filter_str.c | 593 + tests/test_hardware.c | 50 + tests/test_index.c | 1715 ++ tests/test_index_hash.c | 386 + tests/test_lzip_decoder.c | 488 + tests/test_memlimit.c | 173 + tests/test_scripts.sh | 81 + tests/test_stream_flags.c | 479 + tests/test_vli.c | 324 + tests/tests.h | 75 + tests/tuktest.h | 1053 + tests/xzgrep_expected_output | 39 + windows/INSTALL-MSVC.txt | 56 + windows/INSTALL-MinGW.txt | 138 + windows/README-Windows.txt | 122 + windows/build.bash | 204 + windows/vs2013/config.h | 157 + windows/vs2013/liblzma.vcxproj | 363 + windows/vs2013/liblzma_dll.vcxproj | 398 + windows/vs2013/xz_win.sln | 48 + windows/vs2017/config.h | 157 + windows/vs2017/liblzma.vcxproj | 363 + windows/vs2017/liblzma_dll.vcxproj | 398 + windows/vs2017/xz_win.sln | 48 + windows/vs2019/config.h | 157 + windows/vs2019/liblzma.vcxproj | 364 + windows/vs2019/liblzma_dll.vcxproj | 399 + windows/vs2019/xz_win.sln | 51 + 686 files changed, 258239 insertions(+) create mode 100644 ABOUT-NLS create mode 100644 AUTHORS create mode 100644 CMakeLists.txt create mode 100644 COPYING create mode 100644 COPYING.GPLv2 create mode 100644 COPYING.GPLv3 create mode 100644 COPYING.LGPLv2.1 create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 INSTALL.generic create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 PACKAGERS create mode 100644 README create mode 100644 THANKS create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100755 autogen.sh create mode 100755 build-aux/compile create mode 100755 build-aux/config.guess create mode 100755 build-aux/config.rpath create mode 100755 build-aux/config.sub create mode 100755 build-aux/depcomp create mode 100755 build-aux/install-sh create mode 100644 build-aux/ltmain.sh create mode 100644 build-aux/manconv.sh create mode 100755 build-aux/missing create mode 100755 build-aux/test-driver create mode 100644 build-aux/version.sh create mode 100644 cmake/remove-ordinals.cmake create mode 100644 cmake/tuklib_common.cmake create mode 100644 cmake/tuklib_cpucores.cmake create mode 100644 cmake/tuklib_integer.cmake create mode 100644 cmake/tuklib_large_file_support.cmake create mode 100644 cmake/tuklib_mbstr.cmake create mode 100644 cmake/tuklib_physmem.cmake create mode 100644 cmake/tuklib_progname.cmake create mode 100644 config.h.in create mode 100755 configure create mode 100644 configure.ac create mode 100644 debug/Makefile.am create mode 100644 debug/Makefile.in create mode 100644 debug/README create mode 100644 debug/crc32.c create mode 100644 debug/full_flush.c create mode 100644 debug/hex2bin.c create mode 100644 debug/known_sizes.c create mode 100644 debug/memusage.c create mode 100644 debug/repeat.c create mode 100644 debug/sync_flush.c create mode 100644 debug/translation.bash create mode 100644 doc/api/annotated.html create mode 100644 doc/api/base_8h.html create mode 100644 doc/api/bc_s.png create mode 100644 doc/api/bc_sd.png create mode 100644 doc/api/bcj_8h.html create mode 100644 doc/api/block_8h.html create mode 100644 doc/api/check_8h.html create mode 100644 doc/api/classes.html create mode 100644 doc/api/closed.png create mode 100644 doc/api/container_8h.html create mode 100644 doc/api/delta_8h.html create mode 100644 doc/api/dir_b17a1d403082bd69a703ed987cf158fb.html create mode 100644 doc/api/doc.svg create mode 100644 doc/api/docd.svg create mode 100644 doc/api/doxygen.css create mode 100644 doc/api/doxygen.svg create mode 100644 doc/api/files.html create mode 100644 doc/api/filter_8h.html create mode 100644 doc/api/folderclosed.svg create mode 100644 doc/api/folderclosedd.svg create mode 100644 doc/api/folderopen.svg create mode 100644 doc/api/folderopend.svg create mode 100644 doc/api/functions.html create mode 100644 doc/api/functions_vars.html create mode 100644 doc/api/globals.html create mode 100644 doc/api/globals_defs.html create mode 100644 doc/api/globals_enum.html create mode 100644 doc/api/globals_eval.html create mode 100644 doc/api/globals_func.html create mode 100644 doc/api/globals_type.html create mode 100644 doc/api/hardware_8h.html create mode 100644 doc/api/index.html create mode 100644 doc/api/index_8h.html create mode 100644 doc/api/index__hash_8h.html create mode 100644 doc/api/lzma12_8h.html create mode 100644 doc/api/lzma_8h.html create mode 100644 doc/api/nav_f.png create mode 100644 doc/api/nav_fd.png create mode 100644 doc/api/nav_g.png create mode 100644 doc/api/nav_h.png create mode 100644 doc/api/nav_hd.png create mode 100644 doc/api/open.png create mode 100644 doc/api/splitbar.png create mode 100644 doc/api/splitbard.png create mode 100644 doc/api/stream__flags_8h.html create mode 100644 doc/api/structlzma__allocator.html create mode 100644 doc/api/structlzma__block.html create mode 100644 doc/api/structlzma__filter.html create mode 100644 doc/api/structlzma__index__iter.html create mode 100644 doc/api/structlzma__mt.html create mode 100644 doc/api/structlzma__options__bcj.html create mode 100644 doc/api/structlzma__options__delta.html create mode 100644 doc/api/structlzma__options__lzma.html create mode 100644 doc/api/structlzma__stream.html create mode 100644 doc/api/structlzma__stream__flags.html create mode 100644 doc/api/sync_off.png create mode 100644 doc/api/sync_on.png create mode 100644 doc/api/tab_a.png create mode 100644 doc/api/tab_ad.png create mode 100644 doc/api/tab_b.png create mode 100644 doc/api/tab_bd.png create mode 100644 doc/api/tab_h.png create mode 100644 doc/api/tab_hd.png create mode 100644 doc/api/tab_s.png create mode 100644 doc/api/tab_sd.png create mode 100644 doc/api/tabs.css create mode 100644 doc/api/version_8h.html create mode 100644 doc/api/vli_8h.html create mode 100644 doc/examples/00_README.txt create mode 100644 doc/examples/01_compress_easy.c create mode 100644 doc/examples/02_decompress.c create mode 100644 doc/examples/03_compress_custom.c create mode 100644 doc/examples/04_compress_easy_mt.c create mode 100644 doc/examples/Makefile create mode 100644 doc/examples_old/xz_pipe_comp.c create mode 100644 doc/examples_old/xz_pipe_decomp.c create mode 100644 doc/faq.txt create mode 100644 doc/history.txt create mode 100644 doc/lzma-file-format.txt create mode 100644 doc/man/pdf-a4/lzmainfo-a4.pdf create mode 100644 doc/man/pdf-a4/xz-a4.pdf create mode 100644 doc/man/pdf-a4/xzdec-a4.pdf create mode 100644 doc/man/pdf-a4/xzdiff-a4.pdf create mode 100644 doc/man/pdf-a4/xzgrep-a4.pdf create mode 100644 doc/man/pdf-a4/xzless-a4.pdf create mode 100644 doc/man/pdf-a4/xzmore-a4.pdf create mode 100644 doc/man/pdf-letter/lzmainfo-letter.pdf create mode 100644 doc/man/pdf-letter/xz-letter.pdf create mode 100644 doc/man/pdf-letter/xzdec-letter.pdf create mode 100644 doc/man/pdf-letter/xzdiff-letter.pdf create mode 100644 doc/man/pdf-letter/xzgrep-letter.pdf create mode 100644 doc/man/pdf-letter/xzless-letter.pdf create mode 100644 doc/man/pdf-letter/xzmore-letter.pdf create mode 100644 doc/man/txt/lzmainfo.txt create mode 100644 doc/man/txt/xz.txt create mode 100644 doc/man/txt/xzdec.txt create mode 100644 doc/man/txt/xzdiff.txt create mode 100644 doc/man/txt/xzgrep.txt create mode 100644 doc/man/txt/xzless.txt create mode 100644 doc/man/txt/xzmore.txt create mode 100644 doc/xz-file-format.txt create mode 100644 dos/INSTALL.txt create mode 100644 dos/Makefile create mode 100644 dos/README.txt create mode 100644 dos/config.h create mode 100644 doxygen/Doxyfile create mode 100755 doxygen/update-doxygen create mode 100755 extra/7z2lzma/7z2lzma.bash create mode 100644 extra/scanlzma/scanlzma.c create mode 100644 lib/Makefile.am create mode 100644 lib/Makefile.in create mode 100644 lib/getopt.c create mode 100644 lib/getopt.in.h create mode 100644 lib/getopt1.c create mode 100644 lib/getopt_int.h create mode 100644 m4/ax_check_capsicum.m4 create mode 100644 m4/ax_pthread.m4 create mode 100644 m4/getopt.m4 create mode 100644 m4/gettext.m4 create mode 100644 m4/host-cpu-c-abi.m4 create mode 100644 m4/iconv.m4 create mode 100644 m4/intlmacosx.m4 create mode 100644 m4/lib-ld.m4 create mode 100644 m4/lib-link.m4 create mode 100644 m4/lib-prefix.m4 create mode 100644 m4/libtool.m4 create mode 100644 m4/ltoptions.m4 create mode 100644 m4/ltsugar.m4 create mode 100644 m4/ltversion.m4 create mode 100644 m4/lt~obsolete.m4 create mode 100644 m4/nls.m4 create mode 100644 m4/po.m4 create mode 100644 m4/posix-shell.m4 create mode 100644 m4/progtest.m4 create mode 100644 m4/tuklib_common.m4 create mode 100644 m4/tuklib_cpucores.m4 create mode 100644 m4/tuklib_integer.m4 create mode 100644 m4/tuklib_mbstr.m4 create mode 100644 m4/tuklib_physmem.m4 create mode 100644 m4/tuklib_progname.m4 create mode 100644 m4/visibility.m4 create mode 100755 macosx/build.sh create mode 100644 po/LINGUAS create mode 100644 po/Makefile.in.in create mode 100644 po/Makevars create mode 100644 po/POTFILES.in create mode 100644 po/Rules-quot create mode 100644 po/boldquot.sed create mode 100644 po/ca.gmo create mode 100644 po/ca.po create mode 100644 po/cs.gmo create mode 100644 po/cs.po create mode 100644 po/da.gmo create mode 100644 po/da.po create mode 100644 po/de.gmo create mode 100644 po/de.po create mode 100644 po/en@boldquot.header create mode 100644 po/en@quot.header create mode 100644 po/eo.gmo create mode 100644 po/eo.po create mode 100644 po/es.gmo create mode 100644 po/es.po create mode 100644 po/fi.gmo create mode 100644 po/fi.po create mode 100644 po/fr.gmo create mode 100644 po/fr.po create mode 100644 po/hr.gmo create mode 100644 po/hr.po create mode 100644 po/hu.gmo create mode 100644 po/hu.po create mode 100644 po/insert-header.sin create mode 100644 po/it.gmo create mode 100644 po/it.po create mode 100644 po/ko.gmo create mode 100644 po/ko.po create mode 100644 po/pl.gmo create mode 100644 po/pl.po create mode 100644 po/pt.gmo create mode 100644 po/pt.po create mode 100644 po/pt_BR.gmo create mode 100644 po/pt_BR.po create mode 100644 po/quot.sed create mode 100644 po/remove-potcdate.sin create mode 100644 po/ro.gmo create mode 100644 po/ro.po create mode 100644 po/sr.gmo create mode 100644 po/sr.po create mode 100644 po/stamp-po create mode 100644 po/sv.gmo create mode 100644 po/sv.po create mode 100644 po/tr.gmo create mode 100644 po/tr.po create mode 100644 po/uk.gmo create mode 100644 po/uk.po create mode 100644 po/vi.gmo create mode 100644 po/vi.po create mode 100644 po/xz.pot create mode 100644 po/zh_CN.gmo create mode 100644 po/zh_CN.po create mode 100644 po/zh_TW.gmo create mode 100644 po/zh_TW.po create mode 100644 po4a/.gitignore create mode 100644 po4a/de.po create mode 100644 po4a/fr.po create mode 100644 po4a/ko.po create mode 100644 po4a/man/de/lzmainfo.1 create mode 100644 po4a/man/de/xz.1 create mode 100644 po4a/man/de/xzdec.1 create mode 100644 po4a/man/de/xzdiff.1 create mode 100644 po4a/man/de/xzgrep.1 create mode 100644 po4a/man/de/xzless.1 create mode 100644 po4a/man/de/xzmore.1 create mode 100644 po4a/man/fr/lzmainfo.1 create mode 100644 po4a/man/fr/xz.1 create mode 100644 po4a/man/fr/xzdec.1 create mode 100644 po4a/man/fr/xzdiff.1 create mode 100644 po4a/man/fr/xzless.1 create mode 100644 po4a/man/fr/xzmore.1 create mode 100644 po4a/man/ko/lzmainfo.1 create mode 100644 po4a/man/ko/xz.1 create mode 100644 po4a/man/ko/xzdec.1 create mode 100644 po4a/man/ko/xzdiff.1 create mode 100644 po4a/man/ko/xzgrep.1 create mode 100644 po4a/man/ko/xzless.1 create mode 100644 po4a/man/ko/xzmore.1 create mode 100644 po4a/man/pt_BR/lzmainfo.1 create mode 100644 po4a/man/pt_BR/xz.1 create mode 100644 po4a/man/pt_BR/xzdec.1 create mode 100644 po4a/man/pt_BR/xzdiff.1 create mode 100644 po4a/man/pt_BR/xzgrep.1 create mode 100644 po4a/man/pt_BR/xzless.1 create mode 100644 po4a/man/pt_BR/xzmore.1 create mode 100644 po4a/man/ro/lzmainfo.1 create mode 100644 po4a/man/ro/xz.1 create mode 100644 po4a/man/ro/xzdec.1 create mode 100644 po4a/man/ro/xzdiff.1 create mode 100644 po4a/man/ro/xzgrep.1 create mode 100644 po4a/man/ro/xzless.1 create mode 100644 po4a/man/ro/xzmore.1 create mode 100644 po4a/man/uk/lzmainfo.1 create mode 100644 po4a/man/uk/xz.1 create mode 100644 po4a/man/uk/xzdec.1 create mode 100644 po4a/man/uk/xzdiff.1 create mode 100644 po4a/man/uk/xzgrep.1 create mode 100644 po4a/man/uk/xzless.1 create mode 100644 po4a/man/uk/xzmore.1 create mode 100644 po4a/po4a.conf create mode 100644 po4a/pt_BR.po create mode 100644 po4a/ro.po create mode 100644 po4a/uk.po create mode 100755 po4a/update-po create mode 100644 po4a/xz-man.pot create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/common/common_w32res.rc create mode 100644 src/common/mythread.h create mode 100644 src/common/sysdefs.h create mode 100644 src/common/tuklib_common.h create mode 100644 src/common/tuklib_config.h create mode 100644 src/common/tuklib_cpucores.c create mode 100644 src/common/tuklib_cpucores.h create mode 100644 src/common/tuklib_exit.c create mode 100644 src/common/tuklib_exit.h create mode 100644 src/common/tuklib_gettext.h create mode 100644 src/common/tuklib_integer.h create mode 100644 src/common/tuklib_mbstr.h create mode 100644 src/common/tuklib_mbstr_fw.c create mode 100644 src/common/tuklib_mbstr_width.c create mode 100644 src/common/tuklib_open_stdxxx.c create mode 100644 src/common/tuklib_open_stdxxx.h create mode 100644 src/common/tuklib_physmem.c create mode 100644 src/common/tuklib_physmem.h create mode 100644 src/common/tuklib_progname.c create mode 100644 src/common/tuklib_progname.h create mode 100644 src/liblzma/Makefile.am create mode 100644 src/liblzma/Makefile.in create mode 100644 src/liblzma/api/Makefile.am create mode 100644 src/liblzma/api/Makefile.in create mode 100644 src/liblzma/api/lzma.h create mode 100644 src/liblzma/api/lzma/base.h create mode 100644 src/liblzma/api/lzma/bcj.h create mode 100644 src/liblzma/api/lzma/block.h create mode 100644 src/liblzma/api/lzma/check.h create mode 100644 src/liblzma/api/lzma/container.h create mode 100644 src/liblzma/api/lzma/delta.h create mode 100644 src/liblzma/api/lzma/filter.h create mode 100644 src/liblzma/api/lzma/hardware.h create mode 100644 src/liblzma/api/lzma/index.h create mode 100644 src/liblzma/api/lzma/index_hash.h create mode 100644 src/liblzma/api/lzma/lzma12.h create mode 100644 src/liblzma/api/lzma/stream_flags.h create mode 100644 src/liblzma/api/lzma/version.h create mode 100644 src/liblzma/api/lzma/vli.h create mode 100644 src/liblzma/check/Makefile.inc create mode 100644 src/liblzma/check/check.c create mode 100644 src/liblzma/check/check.h create mode 100644 src/liblzma/check/crc32_fast.c create mode 100644 src/liblzma/check/crc32_small.c create mode 100644 src/liblzma/check/crc32_table.c create mode 100644 src/liblzma/check/crc32_table_be.h create mode 100644 src/liblzma/check/crc32_table_le.h create mode 100644 src/liblzma/check/crc32_tablegen.c create mode 100644 src/liblzma/check/crc32_x86.S create mode 100644 src/liblzma/check/crc64_fast.c create mode 100644 src/liblzma/check/crc64_small.c create mode 100644 src/liblzma/check/crc64_table.c create mode 100644 src/liblzma/check/crc64_table_be.h create mode 100644 src/liblzma/check/crc64_table_le.h create mode 100644 src/liblzma/check/crc64_tablegen.c create mode 100644 src/liblzma/check/crc64_x86.S create mode 100644 src/liblzma/check/crc_macros.h create mode 100644 src/liblzma/check/sha256.c create mode 100644 src/liblzma/common/Makefile.inc create mode 100644 src/liblzma/common/alone_decoder.c create mode 100644 src/liblzma/common/alone_decoder.h create mode 100644 src/liblzma/common/alone_encoder.c create mode 100644 src/liblzma/common/auto_decoder.c create mode 100644 src/liblzma/common/block_buffer_decoder.c create mode 100644 src/liblzma/common/block_buffer_encoder.c create mode 100644 src/liblzma/common/block_buffer_encoder.h create mode 100644 src/liblzma/common/block_decoder.c create mode 100644 src/liblzma/common/block_decoder.h create mode 100644 src/liblzma/common/block_encoder.c create mode 100644 src/liblzma/common/block_encoder.h create mode 100644 src/liblzma/common/block_header_decoder.c create mode 100644 src/liblzma/common/block_header_encoder.c create mode 100644 src/liblzma/common/block_util.c create mode 100644 src/liblzma/common/common.c create mode 100644 src/liblzma/common/common.h create mode 100644 src/liblzma/common/easy_buffer_encoder.c create mode 100644 src/liblzma/common/easy_decoder_memusage.c create mode 100644 src/liblzma/common/easy_encoder.c create mode 100644 src/liblzma/common/easy_encoder_memusage.c create mode 100644 src/liblzma/common/easy_preset.c create mode 100644 src/liblzma/common/easy_preset.h create mode 100644 src/liblzma/common/file_info.c create mode 100644 src/liblzma/common/filter_buffer_decoder.c create mode 100644 src/liblzma/common/filter_buffer_encoder.c create mode 100644 src/liblzma/common/filter_common.c create mode 100644 src/liblzma/common/filter_common.h create mode 100644 src/liblzma/common/filter_decoder.c create mode 100644 src/liblzma/common/filter_decoder.h create mode 100644 src/liblzma/common/filter_encoder.c create mode 100644 src/liblzma/common/filter_encoder.h create mode 100644 src/liblzma/common/filter_flags_decoder.c create mode 100644 src/liblzma/common/filter_flags_encoder.c create mode 100644 src/liblzma/common/hardware_cputhreads.c create mode 100644 src/liblzma/common/hardware_physmem.c create mode 100644 src/liblzma/common/index.c create mode 100644 src/liblzma/common/index.h create mode 100644 src/liblzma/common/index_decoder.c create mode 100644 src/liblzma/common/index_decoder.h create mode 100644 src/liblzma/common/index_encoder.c create mode 100644 src/liblzma/common/index_encoder.h create mode 100644 src/liblzma/common/index_hash.c create mode 100644 src/liblzma/common/lzip_decoder.c create mode 100644 src/liblzma/common/lzip_decoder.h create mode 100644 src/liblzma/common/memcmplen.h create mode 100644 src/liblzma/common/microlzma_decoder.c create mode 100644 src/liblzma/common/microlzma_encoder.c create mode 100644 src/liblzma/common/outqueue.c create mode 100644 src/liblzma/common/outqueue.h create mode 100644 src/liblzma/common/stream_buffer_decoder.c create mode 100644 src/liblzma/common/stream_buffer_encoder.c create mode 100644 src/liblzma/common/stream_decoder.c create mode 100644 src/liblzma/common/stream_decoder.h create mode 100644 src/liblzma/common/stream_decoder_mt.c create mode 100644 src/liblzma/common/stream_encoder.c create mode 100644 src/liblzma/common/stream_encoder_mt.c create mode 100644 src/liblzma/common/stream_flags_common.c create mode 100644 src/liblzma/common/stream_flags_common.h create mode 100644 src/liblzma/common/stream_flags_decoder.c create mode 100644 src/liblzma/common/stream_flags_encoder.c create mode 100644 src/liblzma/common/string_conversion.c create mode 100644 src/liblzma/common/vli_decoder.c create mode 100644 src/liblzma/common/vli_encoder.c create mode 100644 src/liblzma/common/vli_size.c create mode 100644 src/liblzma/delta/Makefile.inc create mode 100644 src/liblzma/delta/delta_common.c create mode 100644 src/liblzma/delta/delta_common.h create mode 100644 src/liblzma/delta/delta_decoder.c create mode 100644 src/liblzma/delta/delta_decoder.h create mode 100644 src/liblzma/delta/delta_encoder.c create mode 100644 src/liblzma/delta/delta_encoder.h create mode 100644 src/liblzma/delta/delta_private.h create mode 100644 src/liblzma/liblzma.pc.in create mode 100644 src/liblzma/liblzma_generic.map create mode 100644 src/liblzma/liblzma_linux.map create mode 100644 src/liblzma/liblzma_w32res.rc create mode 100644 src/liblzma/lz/Makefile.inc create mode 100644 src/liblzma/lz/lz_decoder.c create mode 100644 src/liblzma/lz/lz_decoder.h create mode 100644 src/liblzma/lz/lz_encoder.c create mode 100644 src/liblzma/lz/lz_encoder.h create mode 100644 src/liblzma/lz/lz_encoder_hash.h create mode 100644 src/liblzma/lz/lz_encoder_hash_table.h create mode 100644 src/liblzma/lz/lz_encoder_mf.c create mode 100644 src/liblzma/lzma/Makefile.inc create mode 100644 src/liblzma/lzma/fastpos.h create mode 100644 src/liblzma/lzma/fastpos_table.c create mode 100644 src/liblzma/lzma/fastpos_tablegen.c create mode 100644 src/liblzma/lzma/lzma2_decoder.c create mode 100644 src/liblzma/lzma/lzma2_decoder.h create mode 100644 src/liblzma/lzma/lzma2_encoder.c create mode 100644 src/liblzma/lzma/lzma2_encoder.h create mode 100644 src/liblzma/lzma/lzma_common.h create mode 100644 src/liblzma/lzma/lzma_decoder.c create mode 100644 src/liblzma/lzma/lzma_decoder.h create mode 100644 src/liblzma/lzma/lzma_encoder.c create mode 100644 src/liblzma/lzma/lzma_encoder.h create mode 100644 src/liblzma/lzma/lzma_encoder_optimum_fast.c create mode 100644 src/liblzma/lzma/lzma_encoder_optimum_normal.c create mode 100644 src/liblzma/lzma/lzma_encoder_presets.c create mode 100644 src/liblzma/lzma/lzma_encoder_private.h create mode 100644 src/liblzma/rangecoder/Makefile.inc create mode 100644 src/liblzma/rangecoder/price.h create mode 100644 src/liblzma/rangecoder/price_table.c create mode 100644 src/liblzma/rangecoder/price_tablegen.c create mode 100644 src/liblzma/rangecoder/range_common.h create mode 100644 src/liblzma/rangecoder/range_decoder.h create mode 100644 src/liblzma/rangecoder/range_encoder.h create mode 100644 src/liblzma/simple/Makefile.inc create mode 100644 src/liblzma/simple/arm.c create mode 100644 src/liblzma/simple/arm64.c create mode 100644 src/liblzma/simple/armthumb.c create mode 100644 src/liblzma/simple/ia64.c create mode 100644 src/liblzma/simple/powerpc.c create mode 100644 src/liblzma/simple/simple_coder.c create mode 100644 src/liblzma/simple/simple_coder.h create mode 100644 src/liblzma/simple/simple_decoder.c create mode 100644 src/liblzma/simple/simple_decoder.h create mode 100644 src/liblzma/simple/simple_encoder.c create mode 100644 src/liblzma/simple/simple_encoder.h create mode 100644 src/liblzma/simple/simple_private.h create mode 100644 src/liblzma/simple/sparc.c create mode 100644 src/liblzma/simple/x86.c create mode 100644 src/liblzma/validate_map.sh create mode 100644 src/lzmainfo/Makefile.am create mode 100644 src/lzmainfo/Makefile.in create mode 100644 src/lzmainfo/lzmainfo.1 create mode 100644 src/lzmainfo/lzmainfo.c create mode 100644 src/lzmainfo/lzmainfo_w32res.rc create mode 100644 src/scripts/Makefile.am create mode 100644 src/scripts/Makefile.in create mode 100644 src/scripts/xzdiff.1 create mode 100644 src/scripts/xzdiff.in create mode 100644 src/scripts/xzgrep.1 create mode 100644 src/scripts/xzgrep.in create mode 100644 src/scripts/xzless.1 create mode 100644 src/scripts/xzless.in create mode 100644 src/scripts/xzmore.1 create mode 100644 src/scripts/xzmore.in create mode 100644 src/xz/Makefile.am create mode 100644 src/xz/Makefile.in create mode 100644 src/xz/args.c create mode 100644 src/xz/args.h create mode 100644 src/xz/coder.c create mode 100644 src/xz/coder.h create mode 100644 src/xz/file_io.c create mode 100644 src/xz/file_io.h create mode 100644 src/xz/hardware.c create mode 100644 src/xz/hardware.h create mode 100644 src/xz/list.c create mode 100644 src/xz/list.h create mode 100644 src/xz/main.c create mode 100644 src/xz/main.h create mode 100644 src/xz/message.c create mode 100644 src/xz/message.h create mode 100644 src/xz/mytime.c create mode 100644 src/xz/mytime.h create mode 100644 src/xz/options.c create mode 100644 src/xz/options.h create mode 100644 src/xz/private.h create mode 100644 src/xz/signals.c create mode 100644 src/xz/signals.h create mode 100644 src/xz/suffix.c create mode 100644 src/xz/suffix.h create mode 100644 src/xz/util.c create mode 100644 src/xz/util.h create mode 100644 src/xz/xz.1 create mode 100644 src/xz/xz_w32res.rc create mode 100644 src/xzdec/Makefile.am create mode 100644 src/xzdec/Makefile.in create mode 100644 src/xzdec/lzmadec_w32res.rc create mode 100644 src/xzdec/xzdec.1 create mode 100644 src/xzdec/xzdec.c create mode 100644 src/xzdec/xzdec_w32res.rc create mode 100644 tests/Makefile.am create mode 100644 tests/Makefile.in create mode 100644 tests/bcj_test.c create mode 100644 tests/compress_prepared_bcj_sparc create mode 100644 tests/compress_prepared_bcj_x86 create mode 100644 tests/create_compress_files.c create mode 100644 tests/files/README create mode 100644 tests/files/bad-0-backward_size.xz create mode 100644 tests/files/bad-0-empty-truncated.xz create mode 100644 tests/files/bad-0-footer_magic.xz create mode 100644 tests/files/bad-0-header_magic.xz create mode 100644 tests/files/bad-0-nonempty_index.xz create mode 100644 tests/files/bad-0cat-alone.xz create mode 100644 tests/files/bad-0cat-header_magic.xz create mode 100644 tests/files/bad-0catpad-empty.xz create mode 100644 tests/files/bad-0pad-empty.xz create mode 100644 tests/files/bad-1-block_header-1.xz create mode 100644 tests/files/bad-1-block_header-2.xz create mode 100644 tests/files/bad-1-block_header-3.xz create mode 100644 tests/files/bad-1-block_header-4.xz create mode 100644 tests/files/bad-1-block_header-5.xz create mode 100644 tests/files/bad-1-block_header-6.xz create mode 100644 tests/files/bad-1-check-crc32-2.xz create mode 100644 tests/files/bad-1-check-crc32.xz create mode 100644 tests/files/bad-1-check-crc64.xz create mode 100644 tests/files/bad-1-check-sha256.xz create mode 100644 tests/files/bad-1-lzma2-1.xz create mode 100644 tests/files/bad-1-lzma2-10.xz create mode 100644 tests/files/bad-1-lzma2-11.xz create mode 100644 tests/files/bad-1-lzma2-2.xz create mode 100644 tests/files/bad-1-lzma2-3.xz create mode 100644 tests/files/bad-1-lzma2-4.xz create mode 100644 tests/files/bad-1-lzma2-5.xz create mode 100644 tests/files/bad-1-lzma2-6.xz create mode 100644 tests/files/bad-1-lzma2-7.xz create mode 100644 tests/files/bad-1-lzma2-8.xz create mode 100644 tests/files/bad-1-lzma2-9.xz create mode 100644 tests/files/bad-1-stream_flags-1.xz create mode 100644 tests/files/bad-1-stream_flags-2.xz create mode 100644 tests/files/bad-1-stream_flags-3.xz create mode 100644 tests/files/bad-1-v0-uncomp-size.lz create mode 100644 tests/files/bad-1-v1-crc32.lz create mode 100644 tests/files/bad-1-v1-dict-1.lz create mode 100644 tests/files/bad-1-v1-dict-2.lz create mode 100644 tests/files/bad-1-v1-magic-1.lz create mode 100644 tests/files/bad-1-v1-magic-2.lz create mode 100644 tests/files/bad-1-v1-member-size.lz create mode 100644 tests/files/bad-1-v1-trailing-magic.lz create mode 100644 tests/files/bad-1-v1-uncomp-size.lz create mode 100644 tests/files/bad-1-vli-1.xz create mode 100644 tests/files/bad-1-vli-2.xz create mode 100644 tests/files/bad-2-compressed_data_padding.xz create mode 100644 tests/files/bad-2-index-1.xz create mode 100644 tests/files/bad-2-index-2.xz create mode 100644 tests/files/bad-2-index-3.xz create mode 100644 tests/files/bad-2-index-4.xz create mode 100644 tests/files/bad-2-index-5.xz create mode 100644 tests/files/bad-3-index-uncomp-overflow.xz create mode 100644 tests/files/bad-too_big_size-with_eopm.lzma create mode 100644 tests/files/bad-too_small_size-without_eopm-1.lzma create mode 100644 tests/files/bad-too_small_size-without_eopm-2.lzma create mode 100644 tests/files/bad-too_small_size-without_eopm-3.lzma create mode 100644 tests/files/bad-unknown_size-without_eopm.lzma create mode 100644 tests/files/good-0-empty.xz create mode 100644 tests/files/good-0cat-empty.xz create mode 100644 tests/files/good-0catpad-empty.xz create mode 100644 tests/files/good-0pad-empty.xz create mode 100644 tests/files/good-1-3delta-lzma2.xz create mode 100644 tests/files/good-1-arm64-lzma2-1.xz create mode 100644 tests/files/good-1-arm64-lzma2-2.xz create mode 100644 tests/files/good-1-block_header-1.xz create mode 100644 tests/files/good-1-block_header-2.xz create mode 100644 tests/files/good-1-block_header-3.xz create mode 100644 tests/files/good-1-check-crc32.xz create mode 100644 tests/files/good-1-check-crc64.xz create mode 100644 tests/files/good-1-check-none.xz create mode 100644 tests/files/good-1-check-sha256.xz create mode 100644 tests/files/good-1-delta-lzma2.tiff.xz create mode 100644 tests/files/good-1-empty-bcj-lzma2.xz create mode 100644 tests/files/good-1-lzma2-1.xz create mode 100644 tests/files/good-1-lzma2-2.xz create mode 100644 tests/files/good-1-lzma2-3.xz create mode 100644 tests/files/good-1-lzma2-4.xz create mode 100644 tests/files/good-1-lzma2-5.xz create mode 100644 tests/files/good-1-sparc-lzma2.xz create mode 100644 tests/files/good-1-v0-trailing-1.lz create mode 100644 tests/files/good-1-v0.lz create mode 100644 tests/files/good-1-v1-trailing-1.lz create mode 100644 tests/files/good-1-v1-trailing-2.lz create mode 100644 tests/files/good-1-v1.lz create mode 100644 tests/files/good-1-x86-lzma2.xz create mode 100644 tests/files/good-2-lzma2.xz create mode 100644 tests/files/good-2-v0-v1.lz create mode 100644 tests/files/good-2-v1-v0.lz create mode 100644 tests/files/good-2-v1-v1.lz create mode 100644 tests/files/good-known_size-with_eopm.lzma create mode 100644 tests/files/good-known_size-without_eopm.lzma create mode 100644 tests/files/good-unknown_size-with_eopm.lzma create mode 100644 tests/files/unsupported-1-v234.lz create mode 100644 tests/files/unsupported-block_header.xz create mode 100644 tests/files/unsupported-check.xz create mode 100644 tests/files/unsupported-filter_flags-1.xz create mode 100644 tests/files/unsupported-filter_flags-2.xz create mode 100644 tests/files/unsupported-filter_flags-3.xz create mode 100644 tests/ossfuzz/Makefile create mode 100644 tests/ossfuzz/config/fuzz.dict create mode 100644 tests/ossfuzz/config/fuzz.options create mode 100644 tests/ossfuzz/fuzz.c create mode 100644 tests/test_bcj_exact_size.c create mode 100644 tests/test_block_header.c create mode 100644 tests/test_check.c create mode 100755 tests/test_compress.sh create mode 100755 tests/test_compress_generated_abc create mode 100755 tests/test_compress_generated_random create mode 100755 tests/test_compress_generated_text create mode 100755 tests/test_compress_prepared_bcj_sparc create mode 100755 tests/test_compress_prepared_bcj_x86 create mode 100755 tests/test_files.sh create mode 100644 tests/test_filter_flags.c create mode 100644 tests/test_filter_str.c create mode 100644 tests/test_hardware.c create mode 100644 tests/test_index.c create mode 100644 tests/test_index_hash.c create mode 100644 tests/test_lzip_decoder.c create mode 100644 tests/test_memlimit.c create mode 100755 tests/test_scripts.sh create mode 100644 tests/test_stream_flags.c create mode 100644 tests/test_vli.c create mode 100644 tests/tests.h create mode 100644 tests/tuktest.h create mode 100644 tests/xzgrep_expected_output create mode 100644 windows/INSTALL-MSVC.txt create mode 100644 windows/INSTALL-MinGW.txt create mode 100644 windows/README-Windows.txt create mode 100644 windows/build.bash create mode 100644 windows/vs2013/config.h create mode 100644 windows/vs2013/liblzma.vcxproj create mode 100644 windows/vs2013/liblzma_dll.vcxproj create mode 100644 windows/vs2013/xz_win.sln create mode 100644 windows/vs2017/config.h create mode 100644 windows/vs2017/liblzma.vcxproj create mode 100644 windows/vs2017/liblzma_dll.vcxproj create mode 100644 windows/vs2017/xz_win.sln create mode 100644 windows/vs2019/config.h create mode 100644 windows/vs2019/liblzma.vcxproj create mode 100644 windows/vs2019/liblzma_dll.vcxproj create mode 100644 windows/vs2019/xz_win.sln diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..0a9d56d --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1 @@ + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..69bbfc3 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,39 @@ + +Authors of XZ Utils +=================== + + XZ Utils is developed and maintained by Lasse Collin + and Jia Tan . + + Major parts of liblzma are based on code written by Igor Pavlov, + specifically the LZMA SDK . Without + this code, XZ Utils wouldn't exist. + + The SHA-256 implementation in liblzma is based on the code found from + 7-Zip , which has a modified version of the SHA-256 + code found from Crypto++ . The SHA-256 code + in Crypto++ was written by Kevin Springle and Wei Dai. + + Some scripts have been adapted from gzip. The original versions + were written by Jean-loup Gailly, Charles Levert, and Paul Eggert. + Andrew Dudman helped adapting the scripts and their man pages for + XZ Utils. + + The initial version of the threaded .xz decompressor was written + by Sebastian Andrzej Siewior. + + The initial version of the .lz (lzip) decoder was written + by Michał Górny. + + CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov. + + Other authors: + - Jonathan Nieder + - Joachim Henke + + The GNU Autotools-based build system contains files from many authors, + which I'm not trying to list here. + + Several people have contributed fixes or reported bugs. Most of them + are mentioned in the file THANKS. + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b214d71 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,1383 @@ +############################################################################# +# +# Very limited CMake support for building some parts of XZ Utils +# +# For now, this is intended to be useful to build static or shared liblzma +# on Windows with MSVC (to avoid the need to maintain Visual Studio project +# files). Building liblzma on a few other platforms should work too but it +# is somewhat experimental and not as portable as using ./configure. +# +# On some platforms this builds also xz and xzdec, but these are +# highly experimental and meant for testing only: +# - No replacement getopt_long(), libc must have it +# - No sandboxing support +# - No translations +# +# Other missing things: +# - No xzgrep or other scripts or their symlinks +# - No xz tests (liblzma tests only) +# +# NOTE: Even if the code compiles without warnings, the end result may be +# different than via ./configure. Specifically, the list of #defines +# may be different (if so, probably this CMakeLists.txt got them wrong). +# +# This file provides the following installation components (if you only +# need liblzma, install only its components!): +# - liblzma_Runtime +# - liblzma_Development +# - xz (on some platforms only) +# - xzdec (on some platforms only) +# +# To find the target liblzma::liblzma from other packages, use the CONFIG +# option with find_package() to avoid a conflict with the FindLibLZMA module +# with case-insensitive file systems. For example, to require liblzma 5.2.5 +# or a newer compatible version: +# +# find_package(liblzma 5.2.5 REQUIRED CONFIG) +# target_link_libraries(my_application liblzma::liblzma) +# +############################################################################# +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################# + +cmake_minimum_required(VERSION 3.13...3.27 FATAL_ERROR) + +include(CMakePushCheckState) +include(CheckIncludeFile) +include(CheckSymbolExists) +include(CheckStructHasMember) +include(CheckCSourceCompiles) +include(cmake/tuklib_large_file_support.cmake) +include(cmake/tuklib_integer.cmake) +include(cmake/tuklib_cpucores.cmake) +include(cmake/tuklib_physmem.cmake) +include(cmake/tuklib_progname.cmake) +include(cmake/tuklib_mbstr.cmake) + +set(PACKAGE_NAME "XZ Utils") +set(PACKAGE_BUGREPORT "xz@tukaani.org") +set(PACKAGE_URL "https://tukaani.org/xz/") + +# Get the package version from version.h into PACKAGE_VERSION variable. +file(READ src/liblzma/api/lzma/version.h PACKAGE_VERSION) +string(REGEX REPLACE +"^.*\n\ +#define LZMA_VERSION_MAJOR ([0-9]+)\n\ +.*\ +#define LZMA_VERSION_MINOR ([0-9]+)\n\ +.*\ +#define LZMA_VERSION_PATCH ([0-9]+)\n\ +.*$" + "\\1.\\2.\\3" PACKAGE_VERSION "${PACKAGE_VERSION}") + +# Among other things, this gives us variables xz_VERSION and xz_VERSION_MAJOR. +project(xz VERSION "${PACKAGE_VERSION}" LANGUAGES C) + +# We need a compiler that supports enough C99 or newer (variable-length arrays +# aren't needed, those are optional in C17). Setting CMAKE_C_STANDARD here +# makes it the default for all targets. It doesn't affect the INTERFACE so +# liblzma::liblzma won't end up with INTERFACE_COMPILE_FEATURES "c_std_99" +# (the API headers are C89 and C++ compatible). +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) + +# On Apple OSes, don't build executables as bundles: +set(CMAKE_MACOSX_BUNDLE OFF) + +# windres from GNU binutils can be tricky with command line arguments +# that contain spaces or other funny characters. Unfortunately we need +# a space in PACKAGE_NAME. Using \x20 to encode the US-ASCII space seems +# to work in both cmd.exe and /bin/sh. +# +# However, even \x20 isn't enough in all situations, resulting in +# "syntax error" from windres. Using --use-temp-file prevents windres +# from using popen() and this seems to fix the problem. +# +# llvm-windres from Clang/LLVM 16.0.6 and older: The \x20 results +# in "XZx20Utils" in the compiled binary. The option --use-temp-file +# makes no difference. +# +# llvm-windres 17.0.0 and later: It emulates GNU windres more accurately, so +# the workarounds used with GNU windres must be used with llvm-windres too. +# +# CMake 3.27 doesn't have CMAKE_RC_COMPILER_ID so we rely on +# CMAKE_C_COMPILER_ID. +if((MINGW OR CYGWIN OR MSYS) AND ( + NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR + CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "17")) + # Use workarounds with GNU windres and llvm-windres >= 17.0.0. The \x20 + # in PACKAGE_NAME_DEFINITION works with gcc and clang too so we don't need + # to worry how to pass different flags to windres and the C compiler. + # Keep the original PACKAGE_NAME intact for generation of liblzma.pc. + string(APPEND CMAKE_RC_FLAGS " --use-temp-file") + string(REPLACE " " "\\x20" PACKAGE_NAME_DEFINITION "${PACKAGE_NAME}") +else() + # Elsewhere a space is safe. This also keeps things compatible with + # EBCDIC in case CMake-based build is ever done on such a system. + set(PACKAGE_NAME_DEFINITION "${PACKAGE_NAME}") +endif() + +# Definitions common to all targets: +add_compile_definitions( + # Package info: + PACKAGE_NAME="${PACKAGE_NAME_DEFINITION}" + PACKAGE_BUGREPORT="${PACKAGE_BUGREPORT}" + PACKAGE_URL="${PACKAGE_URL}" + + # Standard headers and types are available: + HAVE_STDBOOL_H + HAVE__BOOL + HAVE_STDINT_H + HAVE_INTTYPES_H + + # Always enable CRC32 since liblzma should never build without it. + HAVE_CHECK_CRC32 + + # Disable assert() checks when no build type has been specified. Non-empty + # build types like "Release" and "Debug" handle this by default. + $<$:NDEBUG> +) + + +###################### +# System definitions # +###################### + +# _GNU_SOURCE and such definitions. This specific macro is special since +# it also adds the definitions to CMAKE_REQUIRED_DEFINITIONS. +tuklib_use_system_extensions(ALL) + +# Check for large file support. It's required on some 32-bit platforms and +# even on 64-bit MinGW-w64 to get 64-bit off_t. This can be forced off on +# the CMake command line if needed: -DLARGE_FILE_SUPPORT=OFF +tuklib_large_file_support(ALL) + +# This is needed by liblzma and xz. +tuklib_integer(ALL) + +# This is used for liblzma.pc generation to add -lrt if needed. +set(LIBS) + +# Check for clock_gettime(). Do this before checking for threading so +# that we know there if CLOCK_MONOTONIC is available. +if(NOT WIN32) + check_symbol_exists(clock_gettime time.h HAVE_CLOCK_GETTIME) + + if(NOT HAVE_CLOCK_GETTIME) + # With glibc <= 2.17 or Solaris 10 this needs librt. + # Add librt for the next check for HAVE_CLOCK_GETTIME. If it is + # found after including the library, we know that librt is required. + list(INSERT CMAKE_REQUIRED_LIBRARIES 0 rt) + check_symbol_exists(clock_gettime time.h HAVE_CLOCK_GETTIME_LIBRT) + + # If it was found now, add librt to all targets and keep it in + # CMAKE_REQUIRED_LIBRARIES for further tests too. + if(HAVE_CLOCK_GETTIME_LIBRT) + link_libraries(rt) + set(LIBS "-lrt") # For liblzma.pc + else() + list(REMOVE_AT CMAKE_REQUIRED_LIBRARIES 0) + endif() + endif() + + if(HAVE_CLOCK_GETTIME OR HAVE_CLOCK_GETTIME_LIBRT) + add_compile_definitions(HAVE_CLOCK_GETTIME) + + # Check if CLOCK_MONOTONIC is available for clock_gettime(). + check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC) + tuklib_add_definition_if(ALL HAVE_CLOCK_MONOTONIC) + endif() +endif() + +# Options for new enough GCC or Clang on any arch or operating system: +if(CMAKE_C_COMPILER_ID MATCHES GNU|Clang) + # configure.ac has a long list but it won't be copied here: + add_compile_options(-Wall -Wextra) +endif() + + +############################################################################# +# liblzma +############################################################################# + +option(BUILD_SHARED_LIBS "Build liblzma as a shared library instead of static") + +add_library(liblzma + src/common/mythread.h + src/common/sysdefs.h + src/common/tuklib_common.h + src/common/tuklib_config.h + src/common/tuklib_integer.h + src/common/tuklib_physmem.c + src/common/tuklib_physmem.h + src/liblzma/api/lzma.h + src/liblzma/api/lzma/base.h + src/liblzma/api/lzma/bcj.h + src/liblzma/api/lzma/block.h + src/liblzma/api/lzma/check.h + src/liblzma/api/lzma/container.h + src/liblzma/api/lzma/delta.h + src/liblzma/api/lzma/filter.h + src/liblzma/api/lzma/hardware.h + src/liblzma/api/lzma/index.h + src/liblzma/api/lzma/index_hash.h + src/liblzma/api/lzma/lzma12.h + src/liblzma/api/lzma/stream_flags.h + src/liblzma/api/lzma/version.h + src/liblzma/api/lzma/vli.h + src/liblzma/check/check.c + src/liblzma/check/check.h + src/liblzma/check/crc_macros.h + src/liblzma/common/block_util.c + src/liblzma/common/common.c + src/liblzma/common/common.h + src/liblzma/common/easy_preset.c + src/liblzma/common/easy_preset.h + src/liblzma/common/filter_common.c + src/liblzma/common/filter_common.h + src/liblzma/common/hardware_physmem.c + src/liblzma/common/index.c + src/liblzma/common/index.h + src/liblzma/common/memcmplen.h + src/liblzma/common/stream_flags_common.c + src/liblzma/common/stream_flags_common.h + src/liblzma/common/string_conversion.c + src/liblzma/common/vli_size.c +) + +target_include_directories(liblzma PRIVATE + src/liblzma/api + src/liblzma/common + src/liblzma/check + src/liblzma/lz + src/liblzma/rangecoder + src/liblzma/lzma + src/liblzma/delta + src/liblzma/simple + src/common +) + + +###################### +# Size optimizations # +###################### + +option(ENABLE_SMALL "Reduce code size at expense of speed. \ +This may be useful together with CMAKE_BUILD_TYPE=MinSizeRel.") + +if(ENABLE_SMALL) + add_compile_definitions(HAVE_SMALL) +endif() + + +########## +# Checks # +########## + +set(ADDITIONAL_SUPPORTED_CHECKS crc64 sha256) + +set(ADDITIONAL_CHECK_TYPES "${ADDITIONAL_SUPPORTED_CHECKS}" CACHE STRING + "Additional check types to support (crc32 is always built)") + +foreach(CHECK IN LISTS ADDITIONAL_CHECK_TYPES) + if(NOT CHECK IN_LIST ADDITIONAL_SUPPORTED_CHECKS) + message(FATAL_ERROR "'${CHECK}' is not a supported check type") + endif() +endforeach() + +if(ENABLE_SMALL) + target_sources(liblzma PRIVATE src/liblzma/check/crc32_small.c) +else() + target_sources(liblzma PRIVATE + src/liblzma/check/crc32_fast.c + src/liblzma/check/crc32_table.c + src/liblzma/check/crc32_table_be.h + src/liblzma/check/crc32_table_le.h + ) +endif() + +if("crc64" IN_LIST ADDITIONAL_CHECK_TYPES) + add_compile_definitions("HAVE_CHECK_CRC64") + + if(ENABLE_SMALL) + target_sources(liblzma PRIVATE src/liblzma/check/crc64_small.c) + else() + target_sources(liblzma PRIVATE + src/liblzma/check/crc64_fast.c + src/liblzma/check/crc64_table.c + src/liblzma/check/crc64_table_be.h + src/liblzma/check/crc64_table_le.h + ) + endif() +endif() + +if("sha256" IN_LIST ADDITIONAL_CHECK_TYPES) + add_compile_definitions("HAVE_CHECK_SHA256") + target_sources(liblzma PRIVATE src/liblzma/check/sha256.c) +endif() + + +################# +# Match finders # +################# + +set(SUPPORTED_MATCH_FINDERS hc3 hc4 bt2 bt3 bt4) + +set(MATCH_FINDERS "${SUPPORTED_MATCH_FINDERS}" CACHE STRING + "Match finders to support (at least one is required for LZMA1 or LZMA2)") + +foreach(MF IN LISTS MATCH_FINDERS) + if(MF IN_LIST SUPPORTED_MATCH_FINDERS) + string(TOUPPER "${MF}" MF_UPPER) + add_compile_definitions("HAVE_MF_${MF_UPPER}") + else() + message(FATAL_ERROR "'${MF}' is not a supported match finder") + endif() +endforeach() + + +############# +# Threading # +############# + +# Supported threading methods: +# ON - autodetect the best threading method. The autodetection will +# prefer Windows threading (win95 or vista) over posix if both are +# available. vista threads will be used over win95 unless it is a +# 32-bit build. +# OFF - Disable threading. +# posix - Use posix threading (pthreads), or throw an error if not available. +# win95 - Use Windows win95 threading, or throw an error if not available. +# vista - Use Windows vista threading, or throw an error if not available. +set(SUPPORTED_THREADING_METHODS ON OFF posix win95 vista) + +set(ENABLE_THREADS ON CACHE STRING + "Threading method: Set to 'ON' to autodetect, 'OFF' to disable threading.") + +# Create dropdown in CMake GUI since only 1 threading method is possible +# to select in a build. +set_property(CACHE ENABLE_THREADS + PROPERTY STRINGS "${SUPPORTED_THREADING_METHODS}") + +# This is a flag variable set when win95 threads are used. We must ensure +# the combination of enable_small and win95 threads is not used without a +# compiler supporting attribute __constructor__. +set(USE_WIN95_THREADS OFF) + +# This is a flag variable set when posix threads (pthreads) are used. +# It's needed when creating liblzma-config.cmake where dependency on +# Threads::Threads is only needed with pthreads. +set(USE_POSIX_THREADS OFF) + +if(NOT ENABLE_THREADS IN_LIST SUPPORTED_THREADING_METHODS) + message(FATAL_ERROR "'${ENABLE_THREADS}' is not a supported " + "threading method") +endif() + +if(ENABLE_THREADS) + # Also set THREADS_PREFER_PTHREAD_FLAG since the flag has no effect + # for Windows threading. + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads REQUIRED) + + # If both Windows and posix threading are available, prefer Windows. + # Note that on Cygwin CMAKE_USE_WIN32_THREADS_INIT is false. + if(CMAKE_USE_WIN32_THREADS_INIT AND NOT ENABLE_THREADS STREQUAL "posix") + if(ENABLE_THREADS STREQUAL "win95" + OR (ENABLE_THREADS STREQUAL "ON" + AND CMAKE_SIZEOF_VOID_P EQUAL 4)) + # Use Windows 95 (and thus XP) compatible threads. + # This avoids use of features that were added in + # Windows Vista. This is used for 32-bit x86 builds for + # compatibility reasons since it makes no measurable difference + # in performance compared to Vista threads. + set(USE_WIN95_THREADS ON) + add_compile_definitions(MYTHREAD_WIN95) + else() + add_compile_definitions(MYTHREAD_VISTA) + endif() + elseif(CMAKE_USE_PTHREADS_INIT) + if(ENABLE_THREADS STREQUAL "posix" OR ENABLE_THREADS STREQUAL "ON") + # The threading library only needs to be explicitly linked + # for posix threads, so this is needed for creating + # liblzma-config.cmake later. + set(USE_POSIX_THREADS ON) + + target_link_libraries(liblzma Threads::Threads) + add_compile_definitions(MYTHREAD_POSIX) + + # Check if pthread_condattr_setclock() exists to + # use CLOCK_MONOTONIC. + if(HAVE_CLOCK_MONOTONIC) + list(INSERT CMAKE_REQUIRED_LIBRARIES 0 + "${CMAKE_THREAD_LIBS_INIT}") + check_symbol_exists(pthread_condattr_setclock pthread.h + HAVE_PTHREAD_CONDATTR_SETCLOCK) + tuklib_add_definition_if(ALL HAVE_PTHREAD_CONDATTR_SETCLOCK) + endif() + else() + message(SEND_ERROR + "Windows threading method was requested but a compatible " + "library could not be found") + endif() + else() + message(SEND_ERROR "No supported threading library found") + endif() + + target_sources(liblzma PRIVATE + src/common/tuklib_cpucores.c + src/common/tuklib_cpucores.h + src/liblzma/common/hardware_cputhreads.c + src/liblzma/common/outqueue.c + src/liblzma/common/outqueue.h + ) +endif() + + +############ +# Encoders # +############ + +set(SIMPLE_FILTERS + x86 + arm + armthumb + arm64 + powerpc + ia64 + sparc +) + +# The SUPPORTED_FILTERS are shared between Encoders and Decoders +# since only lzip does not appear in both lists. lzip is a special +# case anyway, so it is handled separately in the Decoders section. +set(SUPPORTED_FILTERS + lzma1 + lzma2 + delta + "${SIMPLE_FILTERS}" +) + +set(ENCODERS "${SUPPORTED_FILTERS}" CACHE STRING "Encoders to support") + +# If LZMA2 is enabled, then LZMA1 must also be enabled. +if(NOT "lzma1" IN_LIST ENCODERS AND "lzma2" IN_LIST ENCODERS) + message(FATAL_ERROR "LZMA2 encoder requires that LZMA1 is also enabled") +endif() + +# If LZMA1 is enabled, then at least one match finder must be enabled. +if(MATCH_FINDERS STREQUAL "" AND "lzma1" IN_LIST ENCODERS) + message(FATAL_ERROR "At least 1 match finder is required for an " + "LZ-based encoder") +endif() + +set(HAVE_DELTA_CODER OFF) +set(SIMPLE_ENCODERS OFF) +set(HAVE_ENCODERS OFF) + +foreach(ENCODER IN LISTS ENCODERS) + if(ENCODER IN_LIST SUPPORTED_FILTERS) + set(HAVE_ENCODERS ON) + + if(NOT SIMPLE_ENCODERS AND ENCODER IN_LIST SIMPLE_FILTERS) + set(SIMPLE_ENCODERS ON) + endif() + + string(TOUPPER "${ENCODER}" ENCODER_UPPER) + add_compile_definitions("HAVE_ENCODER_${ENCODER_UPPER}") + else() + message(FATAL_ERROR "'${ENCODER}' is not a supported encoder") + endif() +endforeach() + +if(HAVE_ENCODERS) + add_compile_definitions(HAVE_ENCODERS) + + target_sources(liblzma PRIVATE + src/liblzma/common/alone_encoder.c + src/liblzma/common/block_buffer_encoder.c + src/liblzma/common/block_buffer_encoder.h + src/liblzma/common/block_encoder.c + src/liblzma/common/block_encoder.h + src/liblzma/common/block_header_encoder.c + src/liblzma/common/easy_buffer_encoder.c + src/liblzma/common/easy_encoder.c + src/liblzma/common/easy_encoder_memusage.c + src/liblzma/common/filter_buffer_encoder.c + src/liblzma/common/filter_encoder.c + src/liblzma/common/filter_encoder.h + src/liblzma/common/filter_flags_encoder.c + src/liblzma/common/index_encoder.c + src/liblzma/common/index_encoder.h + src/liblzma/common/stream_buffer_encoder.c + src/liblzma/common/stream_encoder.c + src/liblzma/common/stream_flags_encoder.c + src/liblzma/common/vli_encoder.c + ) + + if(ENABLE_THREADS) + target_sources(liblzma PRIVATE + src/liblzma/common/stream_encoder_mt.c + ) + endif() + + if(SIMPLE_ENCODERS) + target_sources(liblzma PRIVATE + src/liblzma/simple/simple_encoder.c + src/liblzma/simple/simple_encoder.h + ) + endif() + + if("lzma1" IN_LIST ENCODERS) + target_sources(liblzma PRIVATE + src/liblzma/lzma/lzma_encoder.c + src/liblzma/lzma/lzma_encoder.h + src/liblzma/lzma/lzma_encoder_optimum_fast.c + src/liblzma/lzma/lzma_encoder_optimum_normal.c + src/liblzma/lzma/lzma_encoder_private.h + src/liblzma/lzma/fastpos.h + src/liblzma/lz/lz_encoder.c + src/liblzma/lz/lz_encoder.h + src/liblzma/lz/lz_encoder_hash.h + src/liblzma/lz/lz_encoder_hash_table.h + src/liblzma/lz/lz_encoder_mf.c + src/liblzma/rangecoder/price.h + src/liblzma/rangecoder/price_table.c + src/liblzma/rangecoder/range_encoder.h + ) + + if(NOT ENABLE_SMALL) + target_sources(liblzma PRIVATE src/liblzma/lzma/fastpos_table.c) + endif() + endif() + + if("lzma2" IN_LIST ENCODERS) + target_sources(liblzma PRIVATE + src/liblzma/lzma/lzma2_encoder.c + src/liblzma/lzma/lzma2_encoder.h + ) + endif() + + if("delta" IN_LIST ENCODERS) + set(HAVE_DELTA_CODER ON) + target_sources(liblzma PRIVATE + src/liblzma/delta/delta_encoder.c + src/liblzma/delta/delta_encoder.h + ) + endif() +endif() + + +############ +# Decoders # +############ + +set(DECODERS "${SUPPORTED_FILTERS}" CACHE STRING "Decoders to support") + +set(SIMPLE_DECODERS OFF) +set(HAVE_DECODERS OFF) + +foreach(DECODER IN LISTS DECODERS) + if(DECODER IN_LIST SUPPORTED_FILTERS) + set(HAVE_DECODERS ON) + + if(NOT SIMPLE_DECODERS AND DECODER IN_LIST SIMPLE_FILTERS) + set(SIMPLE_DECODERS ON) + endif() + + string(TOUPPER "${DECODER}" DECODER_UPPER) + add_compile_definitions("HAVE_DECODER_${DECODER_UPPER}") + else() + message(FATAL_ERROR "'${DECODER}' is not a supported decoder") + endif() +endforeach() + +if(HAVE_DECODERS) + add_compile_definitions(HAVE_DECODERS) + + target_sources(liblzma PRIVATE + src/liblzma/common/alone_decoder.c + src/liblzma/common/alone_decoder.h + src/liblzma/common/auto_decoder.c + src/liblzma/common/block_buffer_decoder.c + src/liblzma/common/block_decoder.c + src/liblzma/common/block_decoder.h + src/liblzma/common/block_header_decoder.c + src/liblzma/common/easy_decoder_memusage.c + src/liblzma/common/file_info.c + src/liblzma/common/filter_buffer_decoder.c + src/liblzma/common/filter_decoder.c + src/liblzma/common/filter_decoder.h + src/liblzma/common/filter_flags_decoder.c + src/liblzma/common/index_decoder.c + src/liblzma/common/index_decoder.h + src/liblzma/common/index_hash.c + src/liblzma/common/stream_buffer_decoder.c + src/liblzma/common/stream_decoder.c + src/liblzma/common/stream_flags_decoder.c + src/liblzma/common/stream_decoder.h + src/liblzma/common/vli_decoder.c + ) + + if(ENABLE_THREADS) + target_sources(liblzma PRIVATE + src/liblzma/common/stream_decoder_mt.c + ) + endif() + + if(SIMPLE_DECODERS) + target_sources(liblzma PRIVATE + src/liblzma/simple/simple_decoder.c + src/liblzma/simple/simple_decoder.h + ) + endif() + + if("lzma1" IN_LIST DECODERS) + target_sources(liblzma PRIVATE + src/liblzma/lzma/lzma_decoder.c + src/liblzma/lzma/lzma_decoder.h + src/liblzma/rangecoder/range_decoder.h + src/liblzma/lz/lz_decoder.c + src/liblzma/lz/lz_decoder.h + ) + endif() + + if("lzma2" IN_LIST DECODERS) + target_sources(liblzma PRIVATE + src/liblzma/lzma/lzma2_decoder.c + src/liblzma/lzma/lzma2_decoder.h + ) + endif() + + if("delta" IN_LIST DECODERS) + set(HAVE_DELTA_CODER ON) + target_sources(liblzma PRIVATE + src/liblzma/delta/delta_decoder.c + src/liblzma/delta/delta_decoder.h + ) + endif() +endif() + +# Some sources must appear if the filter is configured as either +# an encoder or decoder. +if("lzma1" IN_LIST ENCODERS OR "lzma1" IN_LIST DECODERS) + target_sources(liblzma PRIVATE + src/liblzma/rangecoder/range_common.h + src/liblzma/lzma/lzma_encoder_presets.c + src/liblzma/lzma/lzma_common.h + ) +endif() + +if(HAVE_DELTA_CODER) + target_sources(liblzma PRIVATE + src/liblzma/delta/delta_common.c + src/liblzma/delta/delta_common.h + src/liblzma/delta/delta_private.h + ) +endif() + +if(SIMPLE_ENCODERS OR SIMPLE_DECODERS) + target_sources(liblzma PRIVATE + src/liblzma/simple/simple_coder.c + src/liblzma/simple/simple_coder.h + src/liblzma/simple/simple_private.h + ) +endif() + +foreach(SIMPLE_CODER IN LISTS SIMPLE_FILTERS) + if(SIMPLE_CODER IN_LIST ENCODERS OR SIMPLE_CODER IN_LIST DECODERS) + target_sources(liblzma PRIVATE "src/liblzma/simple/${SIMPLE_CODER}.c") + endif() +endforeach() + + +############# +# MicroLZMA # +############# + +option(MICROLZMA_ENCODER + "MicroLZMA encoder (needed by specific applications only)" ON) + +option(MICROLZMA_DECODER + "MicroLZMA decoder (needed by specific applications only)" ON) + +if(MICROLZMA_ENCODER) + if(NOT "lzma1" IN_LIST ENCODERS) + message(FATAL_ERROR "The LZMA1 encoder is required to support the " + "MicroLZMA encoder") + endif() + + target_sources(liblzma PRIVATE src/liblzma/common/microlzma_encoder.c) +endif() + +if(MICROLZMA_DECODER) + if(NOT "lzma1" IN_LIST DECODERS) + message(FATAL_ERROR "The LZMA1 decoder is required to support the " + "MicroLZMA decoder") + endif() + + target_sources(liblzma PRIVATE src/liblzma/common/microlzma_decoder.c) +endif() + + +############################# +# lzip (.lz) format support # +############################# + +option(LZIP_DECODER "Support lzip decoder" ON) + +if(LZIP_DECODER) + # If lzip decoder support is requested, make sure LZMA1 decoder is enabled. + if(NOT "lzma1" IN_LIST DECODERS) + message(FATAL_ERROR "The LZMA1 decoder is required to support the " + "lzip decoder") + endif() + + add_compile_definitions(HAVE_LZIP_DECODER) + + target_sources(liblzma PRIVATE + src/liblzma/common/lzip_decoder.c + src/liblzma/common/lzip_decoder.h + ) +endif() + +### + +# Put the tuklib functions under the lzma_ namespace. +target_compile_definitions(liblzma PRIVATE TUKLIB_SYMBOL_PREFIX=lzma_) +tuklib_cpucores(liblzma) +tuklib_physmem(liblzma) + +# While liblzma can be built without tuklib_cpucores or tuklib_physmem +# modules, the liblzma API functions lzma_cputhreads() and lzma_physmem() +# will then be useless (which isn't too bad but still unfortunate). Since +# I expect the CMake-based builds to be only used on systems that are +# supported by these tuklib modules, problems with these tuklib modules +# are considered a hard error for now. This hopefully helps to catch bugs +# in the CMake versions of the tuklib checks. +if(NOT TUKLIB_CPUCORES_FOUND OR NOT TUKLIB_PHYSMEM_FOUND) + # Use SEND_ERROR instead of FATAL_ERROR. If someone reports a bug, + # seeing the results of the remaining checks can be useful too. + message(SEND_ERROR + "tuklib_cpucores() or tuklib_physmem() failed. " + "Unless you really are building for a system where these " + "modules are not supported (unlikely), this is a bug in the " + "included cmake/tuklib_*.cmake files that should be fixed. " + "To build anyway, edit this CMakeLists.txt to ignore this error.") +endif() + +# Check for __attribute__((__constructor__)) support. +# This needs -Werror because some compilers just warn +# about this being unsupported. +cmake_push_check_state() +set(CMAKE_REQUIRED_FLAGS "-Werror") +check_c_source_compiles(" + __attribute__((__constructor__)) + static void my_constructor_func(void) { return; } + int main(void) { return 0; } + " + HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR) +cmake_pop_check_state() +tuklib_add_definition_if(liblzma HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR) + +# The Win95 threading lacks a thread-safe one-time initialization function. +# The one-time initialization is needed for crc32_small.c and crc64_small.c +# create the CRC tables. So if small mode is enabled, the threading mode is +# win95, and the compiler does not support attribute constructor, then we +# would end up with a multithreaded build that is thread-unsafe. As a +# result this configuration is not allowed. +if(USE_WIN95_THREADS AND ENABLE_SMALL AND NOT HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR) + message(SEND_ERROR "Threading method win95 and ENABLE_SMALL " + "cannot be used at the same time with a compiler " + "that doesn't support " + "__attribute__((__constructor__))") +endif() + +# cpuid.h +check_include_file(cpuid.h HAVE_CPUID_H) +tuklib_add_definition_if(liblzma HAVE_CPUID_H) + +# immintrin.h: +check_include_file(immintrin.h HAVE_IMMINTRIN_H) +if(HAVE_IMMINTRIN_H) + target_compile_definitions(liblzma PRIVATE HAVE_IMMINTRIN_H) + + # SSE2 intrinsics: + check_c_source_compiles(" + #include + int main(void) + { + __m128i x = { 0 }; + _mm_movemask_epi8(x); + return 0; + } + " + HAVE__MM_MOVEMASK_EPI8) + tuklib_add_definition_if(liblzma HAVE__MM_MOVEMASK_EPI8) + + # CLMUL intrinsic: + option(ALLOW_CLMUL_CRC "Allow carryless multiplication for CRC \ +calculation if supported by the system" ON) + + if(ALLOW_CLMUL_CRC) + check_c_source_compiles(" + #include + #if defined(__e2k__) && __iset__ < 6 + # error + #endif + #if (defined(__GNUC__) || defined(__clang__)) \ + && !defined(__EDG__) + __attribute__((__target__(\"ssse3,sse4.1,pclmul\"))) + #endif + __m128i my_clmul(__m128i a) + { + const __m128i b = _mm_set_epi64x(1, 2); + return _mm_clmulepi64_si128(a, b, 0); + } + int main(void) { return 0; } + " + HAVE_USABLE_CLMUL) + tuklib_add_definition_if(liblzma HAVE_USABLE_CLMUL) + endif() +endif() + +# Support -fvisiblity=hidden when building shared liblzma. +# These lines do nothing on Windows (even under Cygwin). +# HAVE_VISIBILITY should always be defined to 0 or 1. +if(BUILD_SHARED_LIBS) + set_target_properties(liblzma PROPERTIES C_VISIBILITY_PRESET hidden) + target_compile_definitions(liblzma PRIVATE HAVE_VISIBILITY=1) +else() + target_compile_definitions(liblzma PRIVATE HAVE_VISIBILITY=0) +endif() + +if(WIN32) + if(BUILD_SHARED_LIBS) + # Add the Windows resource file for liblzma.dll. + target_sources(liblzma PRIVATE src/liblzma/liblzma_w32res.rc) + + set_target_properties(liblzma PROPERTIES + LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc" + ) + + # Export the public API symbols with __declspec(dllexport). + target_compile_definitions(liblzma PRIVATE DLL_EXPORT) + + if(NOT MSVC) + # Create a DEF file. The linker puts the ordinal numbers there + # too so the output from the linker isn't our final file. + target_link_options(liblzma PRIVATE + "-Wl,--output-def,liblzma.def.in") + + # Remove the ordinal numbers from the DEF file so that + # no one will create an import library that links by ordinal + # instead of by name. We don't maintain a DEF file so the + # ordinal numbers aren't stable. + add_custom_command(TARGET liblzma POST_BUILD + COMMAND "${CMAKE_COMMAND}" + -DINPUT_FILE=liblzma.def.in + -DOUTPUT_FILE=liblzma.def + -P + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/remove-ordinals.cmake" + BYPRODUCTS "liblzma.def" + VERBATIM) + endif() + else() + # Disable __declspec(dllimport) when linking against static liblzma. + target_compile_definitions(liblzma INTERFACE LZMA_API_STATIC) + endif() +elseif(BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Linux") + # GNU/Linux-specific symbol versioning for shared liblzma. + # Note that adding link options doesn't affect static builds + # but HAVE_SYMBOL_VERSIONS_LINUX must not be used with static builds + # because it would put symbol versions into the static library which + # can cause problems. It's clearer if all symver related things are + # omitted when not building a shared library. + # + # NOTE: Set it explicitly to 1 to make it clear that versioning is + # done unconditionally in the C files. + target_compile_definitions(liblzma PRIVATE HAVE_SYMBOL_VERSIONS_LINUX=1) + target_link_options(liblzma PRIVATE + "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map" + ) + set_target_properties(liblzma PROPERTIES + LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map" + ) +elseif(BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + # Symbol versioning for shared liblzma for non-GNU/Linux. + # FIXME? What about Solaris? + target_link_options(liblzma PRIVATE + "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map" + ) + set_target_properties(liblzma PROPERTIES + LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map" + ) +endif() + +set_target_properties(liblzma PROPERTIES + # At least for now the package versioning matches the rules used for + # shared library versioning (excluding development releases) so it is + # fine to use the package version here. + SOVERSION "${xz_VERSION_MAJOR}" + VERSION "${xz_VERSION}" + + # It's liblzma.so or liblzma.dll, not libliblzma.so or lzma.dll. + # Avoid the name lzma.dll because it would conflict with LZMA SDK. + PREFIX "" + IMPORT_PREFIX "" +) + +# Create liblzma-config-version.cmake. +# +# FIXME: SameMajorVersion is correct for stable releases but it is wrong +# for development releases where each release may have incompatible changes. +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config-version.cmake" + VERSION "${liblzma_VERSION}" + COMPATIBILITY SameMajorVersion) + +# Create liblzma-config.cmake. We use this spelling instead of +# liblzmaConfig.cmake to make find_package work in case insensitive +# manner even with case sensitive file systems. This gives more consistent +# behavior between operating systems. This optionally includes a dependency +# on a threading library, so the contents are created in two separate parts. +# The "second half" is always needed, so create it first. +set(LZMA_CONFIG_CONTENTS +"include(\"\${CMAKE_CURRENT_LIST_DIR}/liblzma-targets.cmake\") + +if(NOT TARGET LibLZMA::LibLZMA) + # Be compatible with the spelling used by the FindLibLZMA module. This + # doesn't use ALIAS because it would make CMake resolve LibLZMA::LibLZMA + # to liblzma::liblzma instead of keeping the original spelling. Keeping + # the original spelling is important for good FindLibLZMA compatibility. + add_library(LibLZMA::LibLZMA INTERFACE IMPORTED) + set_target_properties(LibLZMA::LibLZMA PROPERTIES + INTERFACE_LINK_LIBRARIES liblzma::liblzma) +endif() +") + +if(USE_POSIX_THREADS) + set(LZMA_CONFIG_CONTENTS +"include(CMakeFindDependencyMacro) +set(THREADS_PREFER_PTHREAD_FLAG TRUE) +find_dependency(Threads) + +${LZMA_CONFIG_CONTENTS} +") +endif() + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config.cmake" + "${LZMA_CONFIG_CONTENTS}") + +# Set CMAKE_INSTALL_LIBDIR and friends. +include(GNUInstallDirs) + +# Create liblzma.pc. +set(prefix "${CMAKE_INSTALL_PREFIX}") +set(exec_prefix "${CMAKE_INSTALL_PREFIX}") +set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}") +set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}") +set(PTHREAD_CFLAGS "${CMAKE_THREAD_LIBS_INIT}") +configure_file(src/liblzma/liblzma.pc.in liblzma.pc + @ONLY + NEWLINE_STYLE LF) + +# Install the library binary. The INCLUDES specifies the include path that +# is exported for other projects to use but it doesn't install any files. +install(TARGETS liblzma EXPORT liblzmaTargets + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT liblzma_Runtime + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT liblzma_Runtime + NAMELINK_COMPONENT liblzma_Development + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + COMPONENT liblzma_Development + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +# Install the liblzma API headers. These use a subdirectory so +# this has to be done as a separate step. +install(DIRECTORY src/liblzma/api/ + COMPONENT liblzma_Development + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + FILES_MATCHING PATTERN "*.h") + +# Install the CMake files that other packages can use to find liblzma. +set(liblzma_INSTALL_CMAKEDIR + "${CMAKE_INSTALL_LIBDIR}/cmake/liblzma" + CACHE STRING "Path to liblzma's .cmake files") + +install(EXPORT liblzmaTargets + NAMESPACE liblzma:: + FILE liblzma-targets.cmake + DESTINATION "${liblzma_INSTALL_CMAKEDIR}" + COMPONENT liblzma_Development) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config-version.cmake" + DESTINATION "${liblzma_INSTALL_CMAKEDIR}" + COMPONENT liblzma_Development) + +if(NOT MSVC) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzma.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + COMPONENT liblzma_Development) +endif() + + +############################################################################# +# getopt_long +############################################################################# + +# The command line tools needs this. +check_symbol_exists(getopt_long getopt.h HAVE_GETOPT_LONG) + + +############################################################################# +# xzdec +############################################################################# + +if(HAVE_GETOPT_LONG AND HAVE_DECODERS) + add_executable(xzdec + src/common/sysdefs.h + src/common/tuklib_common.h + src/common/tuklib_config.h + src/common/tuklib_exit.c + src/common/tuklib_exit.h + src/common/tuklib_gettext.h + src/common/tuklib_progname.c + src/common/tuklib_progname.h + src/xzdec/xzdec.c + ) + + target_include_directories(xzdec PRIVATE + src/common + src/liblzma/api + ) + + target_link_libraries(xzdec PRIVATE liblzma) + + if(WIN32) + # Add the Windows resource file for xzdec.exe. + target_sources(xzdec PRIVATE src/xzdec/xzdec_w32res.rc) + set_target_properties(xzdec PROPERTIES + LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc" + ) + endif() + + tuklib_progname(xzdec) + + install(TARGETS xzdec + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT xzdec) + + if(UNIX) + install(FILES src/xzdec/xzdec.1 + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" + COMPONENT xzdec) + endif() +endif() + + +############################################################################# +# xz +############################################################################# + +if(NOT MSVC AND HAVE_GETOPT_LONG) + add_executable(xz + src/common/mythread.h + src/common/sysdefs.h + src/common/tuklib_common.h + src/common/tuklib_config.h + src/common/tuklib_exit.c + src/common/tuklib_exit.h + src/common/tuklib_gettext.h + src/common/tuklib_integer.h + src/common/tuklib_mbstr.h + src/common/tuklib_mbstr_fw.c + src/common/tuklib_mbstr_width.c + src/common/tuklib_open_stdxxx.c + src/common/tuklib_open_stdxxx.h + src/common/tuklib_progname.c + src/common/tuklib_progname.h + src/xz/args.c + src/xz/args.h + src/xz/coder.c + src/xz/coder.h + src/xz/file_io.c + src/xz/file_io.h + src/xz/hardware.c + src/xz/hardware.h + src/xz/main.c + src/xz/main.h + src/xz/message.c + src/xz/message.h + src/xz/mytime.c + src/xz/mytime.h + src/xz/options.c + src/xz/options.h + src/xz/private.h + src/xz/signals.c + src/xz/signals.h + src/xz/suffix.c + src/xz/suffix.h + src/xz/util.c + src/xz/util.h + ) + + target_include_directories(xz PRIVATE + src/common + src/liblzma/api + ) + + if(HAVE_DECODERS) + target_sources(xz PRIVATE + src/xz/list.c + src/xz/list.h + ) + endif() + + target_link_libraries(xz PRIVATE liblzma) + + target_compile_definitions(xz PRIVATE ASSUME_RAM=128) + + if(WIN32) + # Add the Windows resource file for xz.exe. + target_sources(xz PRIVATE src/xz/xz_w32res.rc) + set_target_properties(xz PROPERTIES + LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc" + ) + endif() + + tuklib_progname(xz) + tuklib_mbstr(xz) + + check_symbol_exists(optreset getopt.h HAVE_OPTRESET) + tuklib_add_definition_if(xz HAVE_OPTRESET) + + check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) + tuklib_add_definition_if(xz HAVE_POSIX_FADVISE) + + # How to get file time: + check_struct_has_member("struct stat" st_atim.tv_nsec + "sys/types.h;sys/stat.h" + HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC) + if(HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC) + tuklib_add_definitions(xz HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC) + else() + check_struct_has_member("struct stat" st_atimespec.tv_nsec + "sys/types.h;sys/stat.h" + HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC) + if(HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC) + tuklib_add_definitions(xz HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC) + else() + check_struct_has_member("struct stat" st_atimensec + "sys/types.h;sys/stat.h" + HAVE_STRUCT_STAT_ST_ATIMENSEC) + tuklib_add_definition_if(xz HAVE_STRUCT_STAT_ST_ATIMENSEC) + endif() + endif() + + # How to set file time: + check_symbol_exists(futimens "sys/types.h;sys/stat.h" HAVE_FUTIMENS) + if(HAVE_FUTIMENS) + tuklib_add_definitions(xz HAVE_FUTIMENS) + else() + check_symbol_exists(futimes "sys/time.h" HAVE_FUTIMES) + if(HAVE_FUTIMES) + tuklib_add_definitions(xz HAVE_FUTIMES) + else() + check_symbol_exists(futimesat "sys/time.h" HAVE_FUTIMESAT) + if(HAVE_FUTIMESAT) + tuklib_add_definitions(xz HAVE_FUTIMESAT) + else() + check_symbol_exists(utimes "sys/time.h" HAVE_UTIMES) + if(HAVE_UTIMES) + tuklib_add_definitions(xz HAVE_UTIMES) + else() + check_symbol_exists(_futime "sys/utime.h" HAVE__FUTIME) + if(HAVE__FUTIME) + tuklib_add_definitions(xz HAVE__FUTIME) + else() + check_symbol_exists(utime "utime.h" HAVE_UTIME) + tuklib_add_definition_if(xz HAVE_UTIME) + endif() + endif() + endif() + endif() + endif() + + install(TARGETS xz + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT xz) + + if(UNIX) + install(FILES src/xz/xz.1 + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" + COMPONENT xz) + + option(CREATE_XZ_SYMLINKS "Create unxz and xzcat symlinks" ON) + option(CREATE_LZMA_SYMLINKS "Create lzma, unlzma, and lzcat symlinks" + ON) + set(XZ_LINKS) + + if(CREATE_XZ_SYMLINKS) + list(APPEND XZ_LINKS "unxz" "xzcat") + endif() + + if(CREATE_LZMA_SYMLINKS) + list(APPEND XZ_LINKS "lzma" "unlzma" "lzcat") + endif() + + # With Windows Cygwin and MSYS2 the symlinking is complicated. Both + # of these environments set the UNIX variable so they will try to + # make the symlinks. The ability for Cygwin and MSYS2 to make + # broken symlinks is determined by the CYGWIN and MSYS2 environment + # variables, respectively. Broken symlinks are needed for the man + # page symlinks and for determining if the xz and lzma symlinks need + # to depend on the xz target or not. If broken symlinks cannot be + # made then the xz binary must be created before the symlinks. + set(ALLOW_BROKEN_SYMLINKS ON) + + if(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN") + # The Cygwin env variable can be set to four possible values: + # + # 1. "lnk". Create symlinks as Windows shortcuts. + # + # 2. "native". Create symlinks as native Windows symlinks + # if supported by the system. Fallback to "lnk" if native + # symlinks are not supported. + # + # 3. "nativestrict". Create symlinks as native Windows symlinks + # if supported by the system. If the target of the symlink + # does not exist or the creation of the symlink fails for any + # reason, do not create the symlink. + # + # 4. "sys". Create symlinks as plain files with a special + # system attribute containing the path to the symlink target. + # + # So, the only case we care about for broken symlinks is + # "nativestrict" since all other values mean that broken + # symlinks are allowed. If the env variable is not set the + # default is "native". If the env variable is set but not + # assigned one of the four values, then the default is the same + # as option 1 "lnk". + string(FIND "$ENV{CYGWIN}" "winsymlinks:nativestrict" SYMLINK_POS) + if(SYMLINK_POS GREATER -1) + set(ALLOW_BROKEN_SYMLINKS OFF) + endif() + elseif(CMAKE_SYSTEM_NAME STREQUAL "MSYS") + # The MSYS env variable behaves similar to the CYGWIN but has a + # different default behavior. If winsymlinks is set but not + # assigned one of the four supported values, the default is to + # *copy* the target to the symlink destination. This will fail + # if the target does not exist so broken symlinks cannot be + # allowed. + string(FIND "$ENV{MSYS}" "winsymlinks" SYMLINK_POS) + if(SYMLINK_POS GREATER -1) + string(FIND "$ENV{MSYS}" "winsymlinks:nativestrict" + SYMLINK_POS) + if(SYMLINK_POS GREATER -1) + set(ALLOW_BROKEN_SYMLINKS OFF) + endif() + else() + set(ALLOW_BROKEN_SYMLINKS OFF) + endif() + endif() + + # Create symlinks in the build directory and then install them. + # + # The symlinks do not likely need any special extension since + # even on Windows the symlink can still be executed without + # the .exe extension. + foreach(LINK IN LISTS XZ_LINKS) + add_custom_target("create_${LINK}" ALL + "${CMAKE_COMMAND}" -E create_symlink + "$" "${LINK}" + BYPRODUCTS "${LINK}" + VERBATIM) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LINK}" + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT xz) + + # Only create the man page symlinks if the symlinks can be + # created broken. The symlinks will not be valid until install + # so they cannot be created on these system environments. + if(ALLOW_BROKEN_SYMLINKS) + add_custom_target("create_${LINK}.1" ALL + "${CMAKE_COMMAND}" -E create_symlink "xz.1" "${LINK}.1" + BYPRODUCTS "${LINK}.1" + VERBATIM) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LINK}.1" + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" + COMPONENT xz) + else() + # Add the xz target as dependency when broken symlinks + # cannot be made. This ensures parallel builds do not fail + # since it will enforce the order of creating xz first, then + # the symlinks. + add_dependencies("create_${LINK}" xz) + endif() + endforeach() + endif() +endif() + + +############################################################################# +# Tests +############################################################################# + +include(CTest) + +if(BUILD_TESTING) + set(LIBLZMA_TESTS + test_bcj_exact_size + test_block_header + test_check + test_filter_flags + test_filter_str + test_hardware + test_index + test_index_hash + test_lzip_decoder + test_memlimit + test_stream_flags + test_vli + ) + + foreach(TEST IN LISTS LIBLZMA_TESTS) + add_executable("${TEST}" "tests/${TEST}.c") + + target_include_directories("${TEST}" PRIVATE + src/common + src/liblzma/api + src/liblzma + ) + + target_link_libraries("${TEST}" PRIVATE liblzma) + + # Put the test programs into their own subdirectory so they don't + # pollute the top-level dir which might contain xz and xzdec. + set_target_properties("${TEST}" PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/tests_bin" + ) + + add_test(NAME "${TEST}" + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/tests_bin/${TEST}" + ) + + # Set srcdir environment variable so that the tests find their + # input files from the source tree. + # + # Set the return code for skipped tests to match Automake convention. + set_tests_properties("${TEST}" PROPERTIES + ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}/tests" + SKIP_RETURN_CODE 77 + ) + endforeach() +endif() diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..e54eeac --- /dev/null +++ b/COPYING @@ -0,0 +1,76 @@ + +XZ Utils Licensing +================== + + Different licenses apply to different files in this package. Here + is a rough summary of which licenses apply to which parts of this + package (but check the individual files to be sure!): + + - liblzma is in the public domain. + + - xz, xzdec, and lzmadec command line tools are in the public + domain unless GNU getopt_long had to be compiled and linked + in from the lib directory. The getopt_long code is under + GNU LGPLv2.1+. + + - The scripts to grep, diff, and view compressed files have been + adapted from gzip. These scripts and their documentation are + under GNU GPLv2+. + + - All the documentation in the doc directory and most of the + XZ Utils specific documentation files in other directories + are in the public domain. + + Note: The JavaScript files (under the MIT license) have + been removed from the Doxygen-generated HTML version of the + liblzma API documentation. Doxygen itself is under the GNU GPL + but the remaining files generated by Doxygen are not affected + by the licenses used in Doxygen because Doxygen licensing has + the following exception: + + "Documents produced by doxygen are derivative works + derived from the input used in their production; + they are not affected by this license." + + - Translated messages are in the public domain. + + - The build system contains public domain files, and files that + are under GNU GPLv2+ or GNU GPLv3+. None of these files end up + in the binaries being built. + + - Test files and test code in the tests directory, and debugging + utilities in the debug directory are in the public domain. + + - The extra directory may contain public domain files, and files + that are under various free software licenses. + + You can do whatever you want with the files that have been put into + the public domain. If you find public domain legally problematic, + take the previous sentence as a license grant. If you still find + the lack of copyright legally problematic, you have too many + lawyers. + + As usual, this software is provided "as is", without any warranty. + + If you copy significant amounts of public domain code from XZ Utils + into your project, acknowledging this somewhere in your software is + polite (especially if it is proprietary, non-free software), but + naturally it is not legally required. Here is an example of a good + notice to put into "about box" or into documentation: + + This software includes code from XZ Utils . + + The following license texts are included in the following files: + - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 + - COPYING.GPLv2: GNU General Public License version 2 + - COPYING.GPLv3: GNU General Public License version 3 + + Note that the toolchain (compiler, linker etc.) may add some code + pieces that are copyrighted. Thus, it is possible that e.g. liblzma + binary wouldn't actually be in the public domain in its entirety + even though it contains no copyrighted code from the XZ Utils source + package. + + If you have questions, don't hesitate to ask the author(s) for more + information. + diff --git a/COPYING.GPLv2 b/COPYING.GPLv2 new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/COPYING.GPLv2 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/COPYING.GPLv3 b/COPYING.GPLv3 new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/COPYING.GPLv3 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 3 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, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/COPYING.LGPLv2.1 b/COPYING.LGPLv2.1 new file mode 100644 index 0000000..4362b49 --- /dev/null +++ b/COPYING.LGPLv2.1 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..4dd0978 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,11756 @@ +commit 49053c0a649f4c8bd2b8d97ce915f401fbc0f3d9 +Author: Jia Tan +Date: 2023-10-31 22:30:29 +0800 + + Bump version and soname for 5.4.5. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 84c0cfc556287628df871703672879e530d0391f +Author: Jia Tan +Date: 2023-11-01 20:18:30 +0800 + + Add NEWS for 5.4.5. + + NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +commit d90ed84db9770712e2421e170076b43bda9b64a7 +Author: Lasse Collin +Date: 2023-10-31 21:41:09 +0200 + + liblzma: Fix compilation of fastpos_tablegen.c. + + The macro lzma_attr_visibility_hidden has to be defined to make + fastpos.h usable. The visibility attribute is irrelevant to + fastpos_tablegen.c so simply #define the macro to an empty value. + + fastpos_tablegen.c is never built by the included build systems + and so the problem wasn't noticed earlier. It's just a standalone + program for generating fastpos_table.c. + + Fixes: https://github.com/tukaani-project/xz/pull/69 + Thanks to GitHub user Jamaika1. + + src/liblzma/lzma/fastpos_tablegen.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 9b1268538b0b2c6c0a121f95165de65fc71ad23c +Author: Jia Tan +Date: 2023-10-31 21:51:40 +0800 + + Build: Fix text wrapping in an output message. + + configure.ac | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +commit 068ee436f4a8a706125ef43e8228b30001b1554e +Author: Lasse Collin +Date: 2023-10-22 17:59:11 +0300 + + liblzma: Use lzma_always_inline in memcmplen.h. + + src/liblzma/common/memcmplen.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 6cdf0a7b7974baf58c1fd20ec3278f3b84ae56e5 +Author: Lasse Collin +Date: 2023-10-30 17:43:03 +0200 + + liblzma: #define lzma_always_inline in common.h. + + src/liblzma/common/common.h | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 33daad3961a4f07f3902b40f13e823e6e43e85da +Author: Lasse Collin +Date: 2023-10-22 17:15:32 +0300 + + liblzma: Use lzma_attr_visibility_hidden on private extern declarations. + + These variables are internal to liblzma and not exposed in the API. + + src/liblzma/check/check.h | 7 +++++++ + src/liblzma/common/stream_flags_common.h | 3 +++ + src/liblzma/lz/lz_encoder_hash.h | 1 + + src/liblzma/lzma/fastpos.h | 1 + + src/liblzma/rangecoder/price.h | 1 + + 5 files changed, 13 insertions(+) + +commit 6961a5ac7df178bfc2b7a181c40575847bc3035f +Author: Lasse Collin +Date: 2023-10-22 17:08:39 +0300 + + liblzma: #define lzma_attr_visibility_hidden in common.h. + + In ELF shared libs: + + -fvisibility=hidden affects definitions of symbols but not + declarations.[*] This doesn't affect direct calls to functions + inside liblzma as a linker can replace a call to lzma_foo@plt + with a call directly to lzma_foo when -fvisibility=hidden is used. + + [*] It has to be like this because otherwise every installed + header file would need to explictly set the symbol visibility + to default. + + When accessing extern variables that aren't defined in the + same translation unit, compiler assumes that the variable has + the default visibility and thus indirection is needed. Unlike + function calls, linker cannot optimize this. + + Using __attribute__((__visibility__("hidden"))) with the extern + variable declarations tells the compiler that indirection isn't + needed because the definition is in the same shared library. + + About 15+ years ago, someone told me that it would be good if + the CRC tables would be defined in the same translation unit + as the C code of the CRC functions. While I understood that it + could help a tiny amount, I didn't want to change the code because + a separate translation unit for the CRC tables was needed for the + x86 assembly code anyway. But when visibility attributes are + supported, simply marking the extern declaration with the + hidden attribute will get identical result. When there are only + a few affected variables, this is trivial to do. I wish I had + understood this back then already. + + src/liblzma/common/common.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 5b9e16764905d06fa8e8339ba185ddfee304e5fb +Author: Lasse Collin +Date: 2023-09-30 22:54:28 +0300 + + liblzma: Refer to MinGW-w64 instead of MinGW in the API headers. + + MinGW (formely a MinGW.org Project, later the MinGW.OSDN Project + at ) has GCC 9.2.0 as the + most recent GCC package (released 2021-02-02). The project might + still be alive but majority of people have switched to MinGW-w64. + Thus it seems clearer to refer to MinGW-w64 in our API headers too. + Building with MinGW is likely to still work but I haven't tested it + in the recent years. + + src/liblzma/api/lzma.h | 4 ++-- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 36fabdbe67c8a8fbdc3ac695a91fc443a1328cc4 +Author: Lasse Collin +Date: 2023-09-27 00:58:17 +0300 + + CMake: Use -D_FILE_OFFSET_BITS=64 if (and only if) needed. + + A CMake option LARGE_FILE_SUPPORT is created if and only if + -D_FILE_OFFSET_BITS=64 affects sizeof(off_t). + + This is needed on many 32-bit platforms and even with 64-bit builds + with MinGW-w64 to get support for files larger than 2 GiB. + + CMakeLists.txt | 7 ++++- + cmake/tuklib_large_file_support.cmake | 52 +++++++++++++++++++++++++++++++++++ + 2 files changed, 58 insertions(+), 1 deletion(-) + +commit 989c8c354cbd2d20fbae4a432a3e31f5bc1cb9bf +Author: Lasse Collin +Date: 2023-09-30 02:14:25 +0300 + + CMake: Generate and install liblzma.pc if not using MSVC. + + Autotools based build uses -pthread and thus adds it to Libs.private + in liblzma.pc. CMake doesn't use -pthread at all if pthread functions + are available in libc so Libs.private doesn't get -pthread either. + + CMakeLists.txt | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit 983f3b458dc79c5976a4237fdfe4f8079f8d8830 +Author: Lasse Collin +Date: 2023-09-30 01:13:13 +0300 + + CMake: Rearrange the PACKAGE_ variables. + + The windres workaround now replaces spaces with \x20 so + the package name isn't repeated. + + These changes will help with creation of liblzma.pc. + + CMakeLists.txt | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +commit 4083c8e9501a48934a5fb563d2c3ce2ae143cd27 +Author: Lasse Collin +Date: 2023-09-29 20:46:11 +0300 + + liblzma: Add Cflags.private to liblzma.pc.in for MSYS2. + + It properly adds -DLZMA_API_STATIC when compiling code that + will be linked against static liblzma. Having it there on + systems other than Windows does no harm. + + See: https://www.msys2.org/docs/pkgconfig/ + + src/liblzma/liblzma.pc.in | 1 + + 1 file changed, 1 insertion(+) + +commit 661549ecb7a9b136d72a01c137d9776c75d52d51 +Author: Lasse Collin +Date: 2023-09-27 22:46:20 +0300 + + CMake: Create liblzma.def when building liblzma.dll with MinGW-w64. + + CMakeLists.txt | 20 ++++++++++++++++++++ + cmake/remove-ordinals.cmake | 26 ++++++++++++++++++++++++++ + 2 files changed, 46 insertions(+) + +commit 0e546eb4da05c52b7d257e5bd85e15c51c4d86a3 +Author: Lasse Collin +Date: 2023-10-26 21:44:42 +0300 + + CMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR. + + In this case they have identical values. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit da4d04e4d6e199d28b58bd2e0df4e120c52dd5d7 +Author: Lasse Collin +Date: 2023-10-01 19:10:57 +0300 + + CMake/Windows: Fix the import library filename. + + Both PREFIX and IMPORT_PERFIX have to be set to "" to get + liblzma.dll and liblzma.dll.a. + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 007558a358c48a0175cc8d47d11798d7967282ab +Author: Lasse Collin +Date: 2023-10-11 19:47:44 +0300 + + CMake: Don't shadow the cache entry ENABLE_THREADS with a normal variable. + + Using set(ENABLE_THREADS "posix") is confusing because it sets + a new normal variable and leaves the cache entry with the same + name unchanged. The intent wasn't to change the cache entry so + this switches to a different variable name. + + CMakeLists.txt | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 7d01de67ee3dd76cfc12c23220e2e4cdc59708f1 +Author: Lasse Collin +Date: 2023-10-09 21:12:31 +0300 + + CMake: Edit threading related messages. + + It's mostly to change from "thread method" to "threading method". + + CMakeLists.txt | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit f8edcf3da689aad4b21e139197725450f2c456a0 +Author: Lasse Collin +Date: 2023-10-09 20:59:24 +0300 + + CMake: Use FATAL_ERROR if user-supplied options aren't understood. + + This way typos are caught quickly and compounding error messages + are avoided (a single typo could cause more than one error). + + This keeps using SEND_ERROR when the system is lacking a feature + (like threading library or sandboxing method). This way the whole + configuration log will be generated in case someone wishes to + report a problem upstream. + + CMakeLists.txt | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +commit 1695021e4a233a9388ddd428654c1447f0ea3bfb +Author: Jia Tan +Date: 2023-10-19 16:09:01 +0800 + + CMake: Add ALLOW_CLMUL_CRC option to enable/disable CLMUL. + + The option is enabled by default, but will only be visible to a user + listing cache variables or using a CMake GUI application if the + immintrin.h header file is found. + + This mirrors our Autotools build --disable-clmul-crc functionality. + + CMakeLists.txt | 40 +++++++++++++++++++++++----------------- + 1 file changed, 23 insertions(+), 17 deletions(-) + +commit 5056bc51071d1a07097c5667a0d5bd85242e31b9 +Author: Lasse Collin +Date: 2023-10-14 17:56:59 +0300 + + tuklib_integer: Revise unaligned reads and writes on strict-align archs. + + In XZ Utils context this doesn't matter much because + unaligned reads and writes aren't used in hot code + when TUKLIB_FAST_UNALIGNED_ACCESS isn't #defined. + + src/common/tuklib_integer.h | 256 ++++++++++++++++++++++++++++++++------------ + 1 file changed, 189 insertions(+), 67 deletions(-) + +commit 9e14743ee5ba79181076bc33952245d5b18fbc58 +Author: Lasse Collin +Date: 2023-09-23 02:21:49 +0300 + + tuklib_integer: Add missing write64be and write64le fallback functions. + + src/common/tuklib_integer.h | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 4cc91ceb3992ef4f51302b56178c3b2c2aeaaaad +Author: Jia Tan +Date: 2023-10-12 20:12:18 +0800 + + Build: Update visibility.m4 from Gnulib. + + Updating from version 6 -> 8 from upstream. Declarations for variables + and function bodies were added to avoid unnecessary failures with + -Werror. + + m4/visibility.m4 | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 1824a6007cb1c8d5d7abcc7bf649148bc06fa72c +Author: Lasse Collin +Date: 2023-10-06 19:36:35 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 8fdc71a27d07b10a3da52432432e080b6d577642 +Author: Jia Tan +Date: 2023-09-29 20:14:39 +0800 + + CMake: Rename xz and man page symlink custom targets. + + The Ninja Generator for CMake cannot have a custom target and its + BYPRODUCTS have the same name. This has prevented Ninja builds on + Unix-like systems since the xz symlinks were introduced in + 80a1a8bb838842a2be343bd88ad1462c21c5e2c9. + + CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 38171492ded6426ddf53d0c200fa8c93fcd02a60 +Author: Lasse Collin +Date: 2023-09-27 19:54:35 +0300 + + CMake: Fix Windows build with Clang/LLVM 17. + + llvm-windres 17.0.0 has more accurate emulation of GNU windres, so + the hack for GNU windres must now be used with llvm-windres too. + + LLVM 16.0.6 has the old behavior and there likely won't be more + 16.x releases. So we can simply check for >= 17.0.0. + + The workaround must not be used with Clang that is acting in + MSVC mode. This checks for the known environments that need + the workaround instead of using "NOT MSVC". + + See also: + https://github.com/llvm/llvm-project/commit/2bcc0fdc58a220cb9921b47ec8a32c85f2511a47 + + CMakeLists.txt | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +commit 1bce6fe48334b5df33d0487a9cbe41950122230e +Author: Jia Tan +Date: 2023-09-27 00:02:11 +0800 + + liblzma: Avoid compiler warning without creating extra symbol. + + When the generic fast crc64 method is used, then we omit + lzma_crc64_table[][]. + + The C standards don't allow an empty translation unit which can be + avoided by declaring something, without exporting any symbols. + + src/liblzma/check/crc64_table.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit dce95a593e6cd9779110aa1e314abd8b35c75f6b +Author: Lasse Collin +Date: 2023-09-26 17:24:15 +0300 + + Build: Update the comment about -Werror usage in checks. + + configure.ac | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit f3c32762ae309afa2fe330e7fb397acfdedc4d37 +Author: Lasse Collin +Date: 2023-09-26 13:51:31 +0300 + + Build: Fix underquoted AC_LANG_SOURCE. + + It made no practical difference in this case. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7dd57f2f2c8fde93fa42b4dbf6d9860717723b41 +Author: Lasse Collin +Date: 2023-09-26 13:14:37 +0300 + + Build: Silence Autoconf warning. + + There was a use of AC_COMPILE_IFELSE that didn't use + AC_LANG_SOURCE and Autoconf warned about this. The omission + had been intentional but it turned out that this didn't do + what I thought it would. + + Autoconf 2.71 manual gives an impression that AC_LANG_SOURCE + inserts all #defines that have been made with AC_DEFINE so + far (confdefs.h). The idea was that omitting AC_LANG_SOURCE + would mean that only the exact code included in the + AC_COMPILE_IFELSE call would be compiled. + + With C programs this is not true: the #defines get added without + AC_LANG_SOURCE too. There seems to be no neat way to avoid this. + Thus, with the C language at least, adding AC_LANG_SOURCE makes + no other difference than silencing a warning from Autoconf. The + generated "configure" remains identical. (Docs of AC_LANG_CONFTEST + say that the #defines have been inserted since Autoconf 2.63b and + that AC_COMPILE_IFELSE uses AC_LANG_CONFTEST. So the behavior is + documented if one also reads the docs of macros that one isn't + calling directly.) + + Any extra code, including #defines, can cause problems for + these two tests because these tests must use -Werror. + CC=clang CFLAGS=-Weverything is the most extreme example. + It enables -Wreserved-macro-identifier which warns about + It's possible to write a test file that passes -Weverything but + it becomes impossible when Autoconf inserts confdefs.h. + + So this commit adds AC_LANG_SOURCE to silence Autoconf warnings. + A different solution is needed for -Werror tests. + + configure.ac | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit edec253e418562f3164a01ecc8805295fa022efa +Author: Jia Tan +Date: 2023-09-26 00:47:26 +0800 + + Build: Remove Gnulib dependency from tests. + + The tests do not use any Gnulib replacements so they do not need to link + libgnu.a or have /lib in the include path. + + tests/Makefile.am | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 46cb133ce7360496eecca1255b364c05f0205855 +Author: Jia Tan +Date: 2023-09-26 00:43:43 +0800 + + CMake: Remove /lib from tests include path. + + The tests never included anything from /lib, so this was not needed. + + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +commit 4ae13cfe0dedb8ddc3cf9ded8cd1ac09361b3bd1 +Author: Lasse Collin +Date: 2023-09-24 16:32:32 +0300 + + sysdefs.h: Update the comment about __USE_MINGW_ANSI_STDIO. + + src/common/sysdefs.h | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 660c8c29e57d30dbd5009ef1f0ec1bbe195ccef6 +Author: Lasse Collin +Date: 2023-09-22 02:33:29 +0300 + + xz: Windows: Don't (de)compress to special files like "con" or "nul". + + Before this commit, the following writes "foo" to the + console and deletes the input file: + + echo foo | xz > con_xz + xz --suffix=_xz --decompress con_xz + + It cannot happen without --suffix because names like con.xz + are also special and so attempting to decompress con.xz + (or compress con to con.xz) will already fail when opening + the input file. + + Similar thing is possible when compressing. The following + writes to "nul" and the input file "n" is deleted. + + echo foo | xz > n + xz --suffix=ul n + + Now xz checks if the destination is a special file before + continuing. DOS/DJGPP version had a check for this but + Windows (and OS/2) didn't. + + src/xz/file_io.c | 35 ++++++++++++++++++++++++++++------- + 1 file changed, 28 insertions(+), 7 deletions(-) + +commit b7ce6e80786fc0c08ed129e8ee262ea96a5473a1 +Author: Lasse Collin +Date: 2023-09-21 20:42:52 +0300 + + CMake: Wrap two overlong lines that are possible to wrap. + + CMakeLists.txt | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 1595f454d5c8257c668cccd6a86dd68175d5c430 +Author: Lasse Collin +Date: 2023-09-21 20:36:31 +0300 + + CMake: Add a comment about threads on Cygwin. + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 5be6275f19784cdd5a954f0188045c8ff4934d54 +Author: Lasse Collin +Date: 2023-09-12 21:12:34 +0300 + + CMake: Bump maximum policy version to 3.27. + + There are several new policies. CMP0149 may affect the Windows SDK + version that CMake will choose by default. The new behavior is more + predictable, always choosing the latest SDK version by default. + + The other new policies shouldn't affect this package. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e515643d7524851d1eb7dab73453e26d8521324c +Author: Lasse Collin +Date: 2023-09-08 19:08:57 +0300 + + Doxygen: Add more C macro names to PREDEFINED. + + doxygen/Doxyfile | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit e3478ae4f36cd06522a2fef023860893f068434d +Author: Lasse Collin +Date: 2023-09-11 18:47:26 +0300 + + liblzma: Move a few __attribute__ uses in function declarations. + + The API headers have many attributes but these were left + as is for now. + + src/liblzma/common/common.c | 6 ++++-- + src/liblzma/common/common.h | 8 ++++---- + src/liblzma/common/memcmplen.h | 3 ++- + 3 files changed, 10 insertions(+), 7 deletions(-) + +commit b71b8922ef3971e5ccffd1e213888d44abe21d11 +Author: Lasse Collin +Date: 2023-09-11 19:03:35 +0300 + + xz, xzdec, lzmainfo: Use tuklib_attr_noreturn. + + For compatibility with C23's [[noreturn]], tuklib_attr_noreturn + must be at the beginning of declaration (before "extern" or + "static", and even before any GNU C's __attribute__). + + This commit also moves all other function attributes to + the beginning of function declarations. "extern" is kept + at the beginning of a line so the attributes are listed on + separate lines before "extern" or "static". + + src/lzmainfo/lzmainfo.c | 6 ++++-- + src/xz/coder.c | 3 ++- + src/xz/hardware.h | 3 ++- + src/xz/message.h | 30 +++++++++++++++++------------- + src/xz/options.c | 3 ++- + src/xz/util.h | 8 ++++---- + src/xzdec/xzdec.c | 9 ++++++--- + 7 files changed, 37 insertions(+), 25 deletions(-) + +commit 359e5c6cb128dab64ea6070d21d1c240f96cea6b +Author: Lasse Collin +Date: 2023-09-11 18:53:31 +0300 + + Remove incorrect uses of __attribute__((__malloc__)). + + xrealloc() is obviously incorrect, modern GCC docs even + mention realloc() as an example where this attribute + cannot be used. + + liblzma's lzma_alloc() and lzma_alloc_zero() would be + correct uses most of the time but custom allocators + may use a memory pool or otherwise hold the pointer + so aliasing issues could happen in theory. + + The xstrdup() case likely was correct but I removed it anyway. + Now there are no __malloc__ attributes left in the code. + The allocations aren't in hot paths so this should make + no practical difference. + + src/liblzma/common/common.c | 4 ++-- + src/liblzma/common/common.h | 4 ++-- + src/xz/util.h | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +commit 589b4cba22fccb1dbc919df5d134aefb2b5a6b01 +Author: Lasse Collin +Date: 2023-09-19 14:03:45 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 43728ed2267e921fbdfa699ee1e91b105ab0e98b +Author: Lasse Collin +Date: 2023-09-14 16:35:46 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit caf00e0988ba47842cfd93dfbb17f7d30120d6e7 +Author: Lasse Collin +Date: 2023-09-14 16:34:07 +0300 + + liblzma: Mark crc64_clmul() with __attribute__((__no_sanitize_address__)). + + Thanks to Agostino Sarubbo. + Fixes: https://github.com/tukaani-project/xz/issues/62 + + src/liblzma/check/crc64_fast.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit a70e96d2da761b8b3a77bf14e08002d871e5950b +Author: Jia Tan +Date: 2023-09-12 22:36:12 +0800 + + CMake: Fix time.h checks not running on second CMake run. + + If CMake was configured more than once, HAVE_CLOCK_GETTIME and + HAVE_CLOCK_MONOTONIC would not be set as compile definitions. The check + for librt being needed to provide HAVE_CLOCK_GETTIME was also + simplified. + + CMakeLists.txt | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +commit d5275d83bd2a9701c5feb8666785007c074b1359 +Author: Jia Tan +Date: 2023-09-12 22:34:06 +0800 + + CMake: Fix unconditionally defining HAVE_CLOCK_MONOTONIC. + + If HAVE_CLOCK_GETTIME was defined, then HAVE_CLOCK_MONOTONIC was always + added as a compile definition even if the check for it failed. + + CMakeLists.txt | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit 1f6e7c68fbdeeaa9482fc77de090be63d90912fd +Author: Lasse Collin +Date: 2023-08-31 19:50:05 +0300 + + xz: Refactor thousand separator detection and disable it on MSVC. + + Now the two variations of the format strings are created with + a macro, and the whole detection code can be easily disabled + on platforms where thousand separator formatting is known to + not work (MSVC has no support, and on DJGPP 2.05 it can have + problems in some cases). + + src/xz/util.c | 89 ++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 45 insertions(+), 44 deletions(-) + +commit ef71f83973a20cc28a3221f85681922026ea33f5 +Author: Lasse Collin +Date: 2023-08-31 18:14:43 +0300 + + xz: Fix a too relaxed assertion and remove uses of SSIZE_MAX. + + SSIZE_MAX isn't readily available on MSVC. Removing it means + that there is one thing less to worry when porting to MSVC. + + src/xz/file_io.c | 5 ++--- + src/xz/file_io.h | 4 ++-- + 2 files changed, 4 insertions(+), 5 deletions(-) + +commit cf8ba7c3a89e37736b926dfbe85dffeff725db47 +Author: Jia Tan +Date: 2023-08-28 23:14:45 +0800 + + Tests: Improve invalid unpadded size check in test_lzma_index_append(). + + This check was extended to test the code added to fix a failing assert + in 68bda971bb8b666a009331455fcedb4e18d837a4. + + tests/test_index.c | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +commit 4a4180ce74788e97e90b9aab579bfd7c6dce3f59 +Author: Jia Tan +Date: 2023-08-28 21:54:41 +0800 + + Tests: Improve comments in test_index.c. + + tests/test_index.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 4b23b84b89e39a5117e16f66c3b01db4f08ed3e7 +Author: Jia Tan +Date: 2023-08-28 21:52:54 +0800 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 773f1e8622cb1465df528cb16a749517650acd93 +Author: Jia Tan +Date: 2023-08-28 21:50:16 +0800 + + liblzma: Update assert in vli_ceil4(). + + The argument to vli_ceil4() should always guarantee the return value + is also a valid lzma_vli. Thus the highest three valid lzma_vli values + are invalid arguments. All uses of the function ensure this so the + assert is updated to match this. + + src/liblzma/common/index.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 68bda971bb8b666a009331455fcedb4e18d837a4 +Author: Jia Tan +Date: 2023-08-28 21:31:25 +0800 + + liblzma: Add overflow check for Unpadded size in lzma_index_append(). + + This was not a security bug since there was no path to overflow + UINT64_MAX in lzma_index_append() or when it calls index_file_size(). + The bug was discovered by a failing assert() in vli_ceil4() when called + from index_file_size() when unpadded_sum (the sum of the compressed size + of current Stream and the unpadded_size parameter) exceeds LZMA_VLI_MAX. + + Previously, the unpadded_size parameter was checked to be not greater + than UNPADDED_SIZE_MAX, but no check was done once compressed_base was + added. + + This could not have caused an integer overflow in index_file_size() when + called by lzma_index_append(). The calculation for file_size breaks down + into the sum of: + + - Compressed base from all previous Streams + - 2 * LZMA_STREAM_HEADER_SIZE (size of the current Streams header and + footer) + - stream_padding (can be set by lzma_index_stream_padding()) + - Compressed base from the current Stream + - Unpadded size (parameter to lzma_index_append()) + + The sum of everything except for Unpadded size must be less than + LZMA_VLI_MAX. This is guarenteed by overflow checks in the functions + that can set these values including lzma_index_stream_padding(), + lzma_index_append(), and lzma_index_cat(). The maximum value for + Unpadded size is enforced by lzma_index_append() to be less than or + equal UNPADDED_SIZE_MAX. Thus, the sum cannot exceed UINT64_MAX since + LZMA_VLI_MAX is half of UINT64_MAX. + + Thanks to Joona Kannisto for reporting this. + + src/liblzma/common/index.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit b41bb79c602481d7ea93d65f5b3e3f08dc54233b +Author: Jia Tan +Date: 2023-08-28 22:18:29 +0800 + + Translations: Update the Esperanto translation. + + po/eo.po | 47 +++++++++++++++++++++++++++++------------------ + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit 6614e6d4bf8e2b5af6eb73930148e0ffc8d2265a +Author: Jia Tan +Date: 2023-08-09 20:55:36 +0800 + + Docs: Update INSTALL for --enable-threads method win95. + + The Autotools build allows win95 threads and --enable-small together now + if the compiler supports __attribute__((__constructor__)). + + INSTALL | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit bfb623ad96fa6f1dbc0c560403c4296e3c8e26c9 +Author: Jia Tan +Date: 2023-08-09 20:54:15 +0800 + + CMake: Conditionally allow win95 threads and --enable-small. + + CMakeLists.txt | 27 +++++++++++++++++++-------- + 1 file changed, 19 insertions(+), 8 deletions(-) + +commit e919ebb29ac9f5270cd7176a39d0d3b4cea875a9 +Author: Jia Tan +Date: 2023-08-09 20:35:16 +0800 + + Build: Conditionally allow win95 threads and --enable-small. + + When the compiler supports __attribute__((__constructor__)) + mythread_once() is never used, even with --enable-small. A configuration + with win95 threads and --enable-small will compile and be thread safe so + it can be allowed. + + This isn't a very common configuration since MSVC does not support + __attribute__((__constructor__)), but MINGW32 and CLANG32 environments + for MSYS2 can use win95 threads and have + __attribute__((__constructor__)) support. + + configure.ac | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +commit c0c0cd4a483a672b66a13761583bc4f84d86d501 +Author: Jamaika1 +Date: 2023-08-08 14:07:59 +0200 + + mythread.h: Fix typo error in Vista threads mythread_once(). + + The "once_" variable was accidentally referred to as just "once". This + prevented building with Vista threads when + HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR was not defined. + + src/common/mythread.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d93fbefcc48a8737fdf5678ce66d1c1d605752a0 +Author: Jia Tan +Date: 2023-08-03 20:10:21 +0800 + + Tests: Style fixes to test_lzip_decoder.c. + + tests/test_lzip_decoder.c | 36 ++++++++++++++++++++++++------------ + 1 file changed, 24 insertions(+), 12 deletions(-) + +commit 65981d8e45741fd1502e007609469e1d60312e69 +Author: Jia Tan +Date: 2023-08-03 15:56:20 +0800 + + Translations: Update the Chinese (simplified) translation. + + po/zh_CN.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a108ed589171d683c34238a87e358b87f69e39a0 +Author: Lasse Collin +Date: 2023-08-02 17:15:12 +0300 + + xz: Omit an empty paragraph on the man page. + + src/xz/xz.1 | 1 - + 1 file changed, 1 deletion(-) + +commit 03c51c5c08fe3579d8bbc8eea8251a1128001330 +Author: Jia Tan +Date: 2023-08-02 20:32:20 +0800 + + Bump version and soname for 5.4.4. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit d7fa3f1b58a77f79b1a4e12452418b5555632e18 +Author: Jia Tan +Date: 2023-08-02 20:30:07 +0800 + + Add NEWS for 5.4.4. + + NEWS | 43 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit 6a1093c0004c42eeaef312456c295671496dd67a +Author: Lasse Collin +Date: 2023-08-02 15:19:43 +0300 + + build-aux/manconv.sh: Fix US-ASCII and UTF-8 output. + + groff defaults to SGR escapes. Using -P-c passes -c to grotty + which restores the old behavior. Perhaps there is a better way to + get pure plain text output but this works for now. + + build-aux/manconv.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f6f9f5651a7e2d89f588981533155ab850e063f7 +Author: Lasse Collin +Date: 2023-08-01 19:10:43 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 0dd83ba8767dad722e0f0f94e0e4146e290a28cb +Author: Lasse Collin +Date: 2023-08-01 18:22:24 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4170a80785cc69edfc5fdfe498bed5f40db6a7ef +Author: ChanTsune <41658782+ChanTsune@users.noreply.github.com> +Date: 2023-08-01 18:17:17 +0300 + + mythread.h: Disable signal functions in builds targeting Wasm + WASI. + + signal.h in WASI SDK doesn't currently provide sigprocmask() + or sigset_t. liblzma doesn't need them so this change makes + liblzma and xzdec build against WASI SDK. xz doesn't build yet + and the tests don't either as tuktest needs setjmp() which + isn't (yet?) implemented in WASI SDK. + + Closes: https://github.com/tukaani-project/xz/pull/57 + See also: https://github.com/tukaani-project/xz/pull/56 + + (The original commit was edited a little by Lasse Collin.) + + src/common/mythread.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0db6fbe0be1545a4f25fcd6993371155b37bbb26 +Author: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> +Date: 2023-07-31 14:02:21 +0200 + + Docs: Fix typos found by codespell + + CMakeLists.txt | 4 ++-- + NEWS | 2 +- + configure.ac | 2 +- + src/liblzma/api/lzma/container.h | 4 ++-- + src/liblzma/api/lzma/filter.h | 2 +- + src/liblzma/api/lzma/lzma12.h | 4 ++-- + src/liblzma/common/block_buffer_encoder.c | 2 +- + src/liblzma/common/common.h | 2 +- + src/liblzma/common/file_info.c | 2 +- + src/liblzma/common/lzip_decoder.c | 2 +- + src/liblzma/common/stream_decoder_mt.c | 8 ++++---- + src/liblzma/common/string_conversion.c | 6 +++--- + src/liblzma/lz/lz_encoder.h | 2 +- + src/liblzma/lzma/lzma_encoder.c | 4 ++-- + src/xz/hardware.c | 4 ++-- + tests/test_filter_flags.c | 4 ++-- + tests/test_index.c | 2 +- + tests/test_vli.c | 2 +- + 18 files changed, 29 insertions(+), 29 deletions(-) + +commit 84a3a1f4e4f146b3b5fa73fe708cacb0d9f829f3 +Author: Jia Tan +Date: 2023-07-26 20:26:23 +0800 + + Update .gitignore. + + .gitignore | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 962b3d41e0c27355ba3052ef7b7d9a887de807e5 +Author: Jia Tan +Date: 2023-07-28 22:03:08 +0800 + + CMake: Conditionally allow the creation of broken symlinks. + + The CMake build will try to create broken symlinks on Unix and Unix-like + platforms. Cygwin and MSYS2 are Unix-like, but may not be able to create + broken symlinks. The value of the CYGWIN or MSYS environment variables + determine if broken symlinks are valid. + + The default for MSYS2 does not allow for broken symlinks, so the CMake + build has been broken for MSYS2 since commit + 80a1a8bb838842a2be343bd88ad1462c21c5e2c9. + + CMakeLists.txt | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 75 insertions(+), 7 deletions(-) + +commit 19899340cf74d98304f9f5b726c72e85c7017d72 +Author: Jia Tan +Date: 2023-07-24 21:43:44 +0800 + + liblzma: Prevent an empty translation unit in Windows builds. + + To workaround Automake lacking Windows resource compiler support, an + empty source file is compiled to overwrite the resource files for static + library builds. Translation units without an external declaration are + not allowed by the C standard and result in a warning when used with + -Wempty-translation-unit (Clang) or -pedantic (GCC). + + src/liblzma/Makefile.am | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit ef7fbe83937abd7f55f1637c1d08b559f1d3d6cc +Author: Jia Tan +Date: 2023-07-21 18:05:44 +0800 + + Tests: Skip .lz files in test_files.sh if not configured. + + Previously if the lzip decoder was not configured then test_files.sh + would pass the lzip tests instead of skipping them. + + tests/test_files.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e49815ba7aa610b72e8724025eceee23c27e7b23 +Author: Jia Tan +Date: 2023-07-20 22:11:13 +0800 + + Tests: Add ARM64 filter test to test_compress.sh. + + tests/test_compress.sh | 1 + + 1 file changed, 1 insertion(+) + +commit db5b57b827c2b084586c51da1b8a3ab0984bdb40 +Author: Jia Tan +Date: 2023-07-22 18:37:56 +0800 + + Translations: Update the Vietnamese translation. + + po/vi.po | 45 ++++++++++++++++++++++++++++----------------- + 1 file changed, 28 insertions(+), 17 deletions(-) + +commit e6ba5014081c98cb068253b3e5f9e372dd157f3c +Author: Jia Tan +Date: 2023-07-20 20:30:05 +0800 + + Translations: Update the Croatian translation. + + po/hr.po | 49 ++++++++++++++++++++++++++++++------------------- + 1 file changed, 30 insertions(+), 19 deletions(-) + +commit 82657a1f10a25050a3e9c246c41deb785cccba3a +Author: Jia Tan +Date: 2023-07-20 20:28:32 +0800 + + Translations: Update the Korean man page translations. + + po4a/ko.po | 1255 ++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 629 insertions(+), 626 deletions(-) + +commit fab35907d13efbe7c457e00a310123335d7bae3e +Author: Jia Tan +Date: 2023-07-20 20:25:24 +0800 + + Translations: Update the Korean translation. + + po/ko.po | 45 ++++++++++++++++++++++++++++----------------- + 1 file changed, 28 insertions(+), 17 deletions(-) + +commit f530fe1964c34797fa3b775ec5804d68007c1579 +Author: Jia Tan +Date: 2023-07-20 20:24:05 +0800 + + Translations: Update the Polish translation. + + po/pl.po | 47 +++++++++++++++++++++++++++++------------------ + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit 10b3500cc2617aabdbc802a63164ce0a3683ad2b +Author: Jia Tan +Date: 2023-07-20 20:22:23 +0800 + + Translations: Update the German man page translations. + + po4a/de.po | 1255 ++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 629 insertions(+), 626 deletions(-) + +commit 3d14e8a34dba176f975326924ae28a3ab5fee165 +Author: Jia Tan +Date: 2023-07-20 20:18:44 +0800 + + Translations: Update the German translation. + + po/de.po | 47 +++++++++++++++++++++++++++++------------------ + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit bdcc180a2da15039c47455c1cafd1ce9aff442e4 +Author: Jia Tan +Date: 2023-07-20 20:17:10 +0800 + + Translations: Update the Chinese (simplified) translation. + + po/zh_CN.po | 47 +++++++++++++++++++++++++++++------------------ + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit 844240350d33cb46ba8827b74dc8758e2abed9e5 +Author: Jia Tan +Date: 2023-07-20 20:15:47 +0800 + + Translations: Update the Swedish translation. + + po/sv.po | 47 +++++++++++++++++++++++++++++------------------ + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit bdc7952bcfbc20c134f723ff5cbf84ab690fb4fc +Author: Jia Tan +Date: 2023-07-20 20:14:00 +0800 + + Translations: Update the Ukrainian man page translations. + + po4a/uk.po | 1253 ++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 628 insertions(+), 625 deletions(-) + +commit 143396e070c8d8afb56e3a5f688b214222cf71e0 +Author: Jia Tan +Date: 2023-07-20 20:09:15 +0800 + + Translations: Update the Ukrainian translation. + + po/uk.po | 45 ++++++++++++++++++++++++++++----------------- + 1 file changed, 28 insertions(+), 17 deletions(-) + +commit 1b8146d64eaac51b40079f5788b85c1eb79e35de +Author: Jia Tan +Date: 2023-07-20 20:06:57 +0800 + + Translations: Update the Spanish translation. + + po/es.po | 47 +++++++++++++++++++++++++++++------------------ + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit f947ce09d79ef8fa6549d350c4d72e4a8a9fa697 +Author: Jia Tan +Date: 2023-07-20 20:05:19 +0800 + + Translations: Update the Romanian translation. + + po/ro.po | 48 ++++++++++++++++++++++++++++++------------------ + 1 file changed, 30 insertions(+), 18 deletions(-) + +commit f681301a368def3f597a7c7bea7cb3f7a2f933e7 +Author: Jia Tan +Date: 2023-07-20 20:02:56 +0800 + + Translations: Update the Romanian man page translations. + + po4a/ro.po | 1254 ++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 629 insertions(+), 625 deletions(-) + +commit 8bc3146c6be920b56283f4ee846456cb34ae4b6f +Author: Jia Tan +Date: 2023-07-13 21:26:47 +0800 + + xz: Update man page Authors and date. + + src/xz/xz.1 | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit c2905540ef905412b54c76488758712d3e2a0f9d +Author: Jia Tan +Date: 2023-07-18 23:19:09 +0800 + + xz: Slight reword in xz man page for consistency. + + Changed will print => prints in xz --robot --version description to + match --robot --info-memory description. + + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2600d3352449faf57d9cb3fa00cbe40548a1310f +Author: Jia Tan +Date: 2023-07-18 22:49:57 +0800 + + liblzma: Improve comment in string_conversion.c. + + The comment used "flag" when referring to decoder options. Just + referring to them as options is more clear and consistent. + + src/liblzma/common/string_conversion.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 98fc14541eec3e1dcf694075c8533f19a3cee552 +Author: Jia Tan +Date: 2023-05-13 21:21:54 +0800 + + liblzma: Reword lzma_str_list_filters() documentation. + + Reword "options required" to "options read". The previous wording + may have suggested that the options listed were all required when + the filters are used for encoding or decoding. Now it should be + more clear that the options listed are the ones relevant for + encoding or decoding. + + src/liblzma/api/lzma/filter.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1ac79b4cbaecf3f4930a5d8ce6f7e1f2b63c2a01 +Author: Lasse Collin +Date: 2023-07-18 17:37:33 +0300 + + xz: Translate the second "%s: " in message.c since French needs "%s : ". + + This string is used to print a filename when using "xz -v" and + stderr isn't a terminal. + + src/xz/message.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 97851be2c6c64494f23c3a735601c13d4387820b +Author: Lasse Collin +Date: 2023-07-18 14:35:33 +0300 + + xz: Make "%s: %s" translatable because French needs "%s : %s". + + src/xz/args.c | 5 ++++- + src/xz/coder.c | 8 ++++---- + src/xz/file_io.c | 8 ++++---- + src/xz/list.c | 11 ++++++----- + 4 files changed, 18 insertions(+), 14 deletions(-) + +commit b406828a6dfd3caa4f77efe3ff3e3eea263eee62 +Author: Lasse Collin +Date: 2023-07-18 13:57:54 +0300 + + liblzma: Tweak #if condition in memcmplen.h. + + Maybe ICC always #defines _MSC_VER on Windows but now + it's very clear which code will get used. + + src/liblzma/common/memcmplen.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ef4a07ad9434f81417395f6fe0bb331e027a703b +Author: Lasse Collin +Date: 2023-07-18 13:49:43 +0300 + + liblzma: Omit unnecessary parenthesis in a preprocessor directive. + + src/liblzma/common/memcmplen.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 64ee0caaea06654b28afaee850fb187a11bf9cb2 +Author: Jia Tan +Date: 2023-06-28 20:22:38 +0800 + + liblzma: Prevent warning for MSYS2 Windows build. + + In lzma_memcmplen(), the header file is only included if + _MSC_VER and _M_X64 are both defined but _BitScanForward64() was + previously used if _M_X64 was defined. GCC for MSYS2 defines _M_X64 but + not _MSC_VER so _BitScanForward64() was used without including + . + + Now, lzma_memcmplen() will use __builtin_ctzll() for MSYS2 GCC builds as + expected. + + src/liblzma/common/memcmplen.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit ba177057643dae6e9c167ee26471181c199c8a00 +Author: Jia Tan +Date: 2023-07-14 23:20:33 +0800 + + Docs: Add a new section to INSTALL for Tests. + + The new Tests section describes basic information about the tests, how + to run them, and important details when cross compiling. We have had a + few questions about how to compile the tests without running them, so + hopefully this information will help others with the same question in the + future. + + Fixes: https://github.com/tukaani-project/xz/issues/54 + + INSTALL | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 64 insertions(+), 17 deletions(-) + +commit 0745b900fafa5ac2c31e8ec3cfba3053457c8b1f +Author: Jia Tan +Date: 2023-07-14 21:10:27 +0800 + + Docs: Update README. + + This adds an entry to "Other implementations of the .xz format" for + XZ for Java. + + README | 4 ++++ + 1 file changed, 4 insertions(+) + +commit c972d44103c4edf88e73917ef08bde69db9d06cb +Author: Jia Tan +Date: 2023-07-18 13:27:46 +0300 + + xz: Fix typo in man page. + + The Memory limit information section described three output + columns when it actually has six. This was reworded to + "multiple" to make it more future proof. + + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6e21f1b4e2c580b64d258e3b81ac9e44d53b9283 +Author: Jia Tan +Date: 2023-07-14 21:30:25 +0800 + + Tests: Improve feature testing for skipping. + + Fixed a bug where test_compress_* would all fail if arm64 or armthumb + filters were enabled for compression but arm was disabled. Since the + grep tests only checked for "define HAVE_ENCODER_ARM", this would match + on HAVE_ENCODER_ARM64 or HAVE_ENCODER_ARMTHUMB. + + Now the config.h feature test requires " 1" at the end to prevent the + prefix problem. have_feature() was also updated for this even though + there were known current bugs affecting it. This is just in case future + features have a similar prefix problem. + + tests/test_compress.sh | 4 ++-- + tests/test_files.sh | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 26c37d290c0884a4518a26b949575420a77fb938 +Author: Jia Tan +Date: 2023-07-10 20:56:28 +0800 + + Translations: Update the Chinese (traditional) translation. + + po/zh_TW.po | 659 ++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 377 insertions(+), 282 deletions(-) + +commit 2ec65181e28335692a3a4fac4fefc4303111d355 +Author: Jia Tan +Date: 2023-07-08 20:03:59 +0800 + + Translations: Update the Vietnamese translation. + + po/vi.po | 620 +++++++++++++++++++++++++++++++++++---------------------------- + 1 file changed, 349 insertions(+), 271 deletions(-) + +commit c44c7e7590db1b89c97e106f5c516bf69189e233 +Author: Jia Tan +Date: 2023-06-28 20:46:31 +0800 + + Tests: Fix memory leaks in test_index. + + Several tests were missing calls to lzma_index_end() to clean up the + lzma_index structs. The memory leaks were discovered by using + -fsanitize=address with GCC. + + tests/test_index.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit b9499c94fccc03eba5311b5305f04149a7c5af65 +Author: Jia Tan +Date: 2023-06-28 20:43:29 +0800 + + Tests: Fix memory leaks in test_block_header. + + test_block_header was not properly freeing the filter options between + calls to lzma_block_header_decode(). The memory leaks were discovered by + using -fsanitize=address with GCC. + + tests/test_block_header.c | 38 ++++++++++++++++++++++---------------- + 1 file changed, 22 insertions(+), 16 deletions(-) + +commit 1155471651ad456c5f90aee6435931fae65682bf +Author: Jia Tan +Date: 2023-06-28 20:31:11 +0800 + + liblzma: Prevent uninitialzed warning in mt stream encoder. + + This change only impacts the compiler warning since it was impossible + for the wait_abs struct in stream_encode_mt() to be used before it was + initialized since mythread_condtime_set() will always be called before + mythread_cond_timedwait(). + + Since the mythread.h code is different between the POSIX and + Windows versions, this warning was only present on Windows builds. + + Thanks to Arthur S for reporting the warning and providing an initial + patch. + + src/liblzma/common/stream_encoder_mt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 62dd1c9bf0c66679ceeebc8b99bca136ca43bcb9 +Author: Jia Tan +Date: 2023-06-07 00:10:38 +0800 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit d04eb78ab3892d3678c180437dd66379efa051fd +Author: Benjamin Buch +Date: 2023-06-06 15:32:45 +0200 + + CMake: Protects against double find_package + + Boost iostream uses `find_package` in quiet mode and then again uses + `find_package` with required. This second call triggers a + `add_library cannot create imported target "LibLZMA::LibLZMA" + because another target with the same name already exists.` + + This can simply be fixed by skipping the alias part on secondary + `find_package` runs. + + CMakeLists.txt | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit 12ea1fb29763dd72376aca73d69621aff01eaa7f +Author: Jia Tan +Date: 2023-05-31 20:26:42 +0800 + + Translations: Update the Esperanto translation. + + po/eo.po | 185 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 92 insertions(+), 93 deletions(-) + +commit a4d45c07c1e4aa0ea9410b4eed7301c97e960319 +Author: Jia Tan +Date: 2023-05-31 20:25:00 +0800 + + Translations: Update the Croatian translation. + + po/hr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f51b7bcea6f948db9529b3e6d850e76a30cc0e96 +Author: Jia Tan +Date: 2023-05-31 20:15:53 +0800 + + Translations: Update the Chinese (simplified) translation. + + po/zh_CN.po | 317 ++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 157 insertions(+), 160 deletions(-) + +commit d5b81c19a7594fbb913bb3450360bc2145f29568 +Author: Jia Tan +Date: 2023-05-17 23:12:13 +0800 + + Translations: Update German translation of man pages. + + po4a/de.po | 52 ++++++++++++---------------------------------------- + 1 file changed, 12 insertions(+), 40 deletions(-) + +commit 36860a3e30d5675b4dba3a343159458d8864bceb +Author: Jia Tan +Date: 2023-05-17 23:09:18 +0800 + + Translations: Update the German translation. + + po/de.po | 189 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 94 insertions(+), 95 deletions(-) + +commit f05641ef0d4990c4c58f459039d412475b94b37d +Author: Jia Tan +Date: 2023-05-17 20:30:01 +0800 + + Translations: Update the Croatian translation. + + po/hr.po | 187 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 93 insertions(+), 94 deletions(-) + +commit b852f6f11d43cafce871cd158c80488f86619a63 +Author: Jia Tan +Date: 2023-05-17 20:26:54 +0800 + + Translations: Update Korean translation of man pages. + + po4a/ko.po | 3015 ++++++++++++------------------------------------------------ + 1 file changed, 568 insertions(+), 2447 deletions(-) + +commit fdcb78fb6f5313eda363869690685471d7ab9731 +Author: Jia Tan +Date: 2023-05-17 20:13:01 +0800 + + Translations: Update the Korean translation. + + po/ko.po | 319 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 158 insertions(+), 161 deletions(-) + +commit 9e39cebe3ccdd4bc320ce6e7eea989bdd167c8b2 +Author: Jia Tan +Date: 2023-05-16 23:49:09 +0800 + + Translations: Update the Spanish translation. + + po/es.po | 319 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 158 insertions(+), 161 deletions(-) + +commit 7a578d1d8293fc1cf7c6f9df76bc6a0e55c51a14 +Author: Jia Tan +Date: 2023-05-16 23:47:23 +0800 + + Translations: Update the Romanian translation. + + po/ro.po | 195 ++++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 98 insertions(+), 97 deletions(-) + +commit 362320fea5383bae179763763625532bad6d10e8 +Author: Jia Tan +Date: 2023-05-16 23:45:43 +0800 + + Translations: Update Romanian translation of man pages. + + po4a/ro.po | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit 29c5a870be23d0a565b959404b34a8b1babef7df +Author: Jia Tan +Date: 2023-05-16 23:43:51 +0800 + + Translations: Update Ukrainian translation of man pages. + + po4a/uk.po | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 5ee57572773207371712b1bbcd9b5b8c1baad2cc +Author: Jia Tan +Date: 2023-05-16 23:37:54 +0800 + + Translations: Update the Ukrainian translation. + + po/uk.po | 321 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 159 insertions(+), 162 deletions(-) + +commit dfc257bdb224780d3c8cdeca5a8e52848b9adc0a +Author: Jia Tan +Date: 2023-05-16 23:07:35 +0800 + + Translations: Update the Polish translation. + + po/pl.po | 316 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 155 insertions(+), 161 deletions(-) + +commit f6df4c4ab7378d2971ae1606f4eecc011ea5fc6d +Author: Jia Tan +Date: 2023-05-16 22:52:14 +0800 + + Translations: Update the Swedish translation. + + po/sv.po | 319 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 158 insertions(+), 161 deletions(-) + +commit 25da22e0521ec698dae4eb5e994b4cd3f4708b60 +Author: Jia Tan +Date: 2023-05-16 21:21:38 +0800 + + Translations: Update the Esperanto translation. + + po/eo.po | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +commit 4f57a9c9915b7b9267885cf9fca58e5c8208458d +Author: Jia Tan +Date: 2023-05-11 23:49:23 +0800 + + liblzma: Adds lzma_nothrow to MicroLZMA API functions. + + None of the liblzma functions may throw an exception, so this + attribute should be applied to all liblzma API functions. + + src/liblzma/api/lzma/container.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 238b4e5458b4bd2cadefb768b8ea7c6b70a191ac +Author: Jia Tan +Date: 2023-05-04 20:38:52 +0800 + + Translations: Update the Croatian translation. + + po/hr.po | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 0cee63c3c6c4f9084a5e7fa7c15a1863ac8e5ffc +Author: Jia Tan +Date: 2023-05-04 19:50:42 +0800 + + Bump version and soname for 5.4.3. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 01f937ea9a49005c5091c0165fa0c1e572dd1749 +Author: Jia Tan +Date: 2023-05-02 20:39:56 +0800 + + Add NEWS for 5.4.3. + + NEWS | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit e9b9ea953179502d5245b4e6ca4f5ffe9d5797b1 +Author: Lasse Collin +Date: 2023-05-03 22:46:42 +0300 + + tuklib_integer.h: Fix a recent copypaste error in Clang detection. + + Wrong line was changed in 7062348bf35c1e4cbfee00ad9fffb4a21aa6eff7. + Also, this has >= instead of == since ints larger than 32 bits would + work too even if not relevant in practice. + + src/common/tuklib_integer.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit be6e39a8622f0d905072874ec25b1ffd155b12e1 +Author: Jia Tan +Date: 2023-04-20 20:15:00 +0800 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 9e343a46cf87a345799222c0b0b3a6f3358dde0c +Author: Jia Tan +Date: 2023-04-19 22:22:16 +0800 + + Windows: Include when needed. + + Legacy Windows did not need to #include to use the MSVC + intrinsics. Newer versions likely just issue a warning, but the MSVC + documentation says to include the header file for the intrinsics we use. + + GCC and Clang can "pretend" to be MSVC on Windows, so extra checks are + needed in tuklib_integer.h to only include when it will is + actually needed. + + src/common/tuklib_integer.h | 6 ++++++ + src/liblzma/common/memcmplen.h | 10 ++++++++++ + 2 files changed, 16 insertions(+) + +commit 12321a9390acc076b414035a46df9d7545ac379f +Author: Jia Tan +Date: 2023-04-19 21:59:03 +0800 + + tuklib_integer: Use __builtin_clz() with Clang. + + Clang has support for __builtin_clz(), but previously Clang would + fallback to either the MSVC intrinsic or the regular C code. This was + discovered due to a bug where a new version of Clang required the + header file in order to use the MSVC intrinsics. + + Thanks to Anton Kochkov for notifying us about the bug. + + src/common/tuklib_integer.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit d1f0e01c395960efd6c29ff144eda4f4c8c1c6d3 +Author: Lasse Collin +Date: 2023-04-14 18:42:33 +0300 + + liblzma: Update project maintainers in lzma.h. + + AUTHORS was updated earlier, lzma.h was simply forgotten. + + src/liblzma/api/lzma.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8204c5d1304e1e3b7487801b4acaf8e3179a6c52 +Author: Jia Tan +Date: 2023-04-13 20:45:19 +0800 + + liblzma: Cleans up old commented out code. + + src/liblzma/common/alone_encoder.c | 11 ----------- + 1 file changed, 11 deletions(-) + +commit 32980d1562bc031013306be1c787761fa63da87d +Author: Jia Tan +Date: 2023-03-28 22:32:40 +0800 + + CMake: Update liblzma-config.cmake generation. + + Now that the threading is configurable, the liblzma CMake package only + needs the threading library when using POSIX threads. + + CMakeLists.txt | 33 ++++++++++++++++++++++----------- + 1 file changed, 22 insertions(+), 11 deletions(-) + +commit 023907faa965476fb921a6344253c50e0ba795f9 +Author: Jia Tan +Date: 2023-03-28 22:25:33 +0800 + + CMake: Allows setting thread method. + + The thread method is now configurable for the CMake build. It matches + the Autotools build by allowing ON (pick the best threading method), + OFF (no threading), posix, win95, and vista. If both Windows and + posix threading are both available, then ON will choose Windows + threading. Windows threading will also not use: + + target_link_libraries(liblzma Threads::Threads) + + since on systems like MinGW-w64 it would link the posix threads + without purpose. + + CMakeLists.txt | 144 +++++++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 104 insertions(+), 40 deletions(-) + +commit ba176d77cbb164b13006516660fc1ff6c59dedb5 +Author: Jia Tan +Date: 2023-03-24 20:05:59 +0800 + + CMake: Only build xzdec if decoders are enabled. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c99d697df800e9bc47e09facf88bcfdb9e0264a5 +Author: Jia Tan +Date: 2023-03-22 15:42:04 +0800 + + Build: Removes redundant check for LZMA1 filter support. + + src/liblzma/lzma/Makefile.inc | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +commit 54a2fd8c850e626343b79c4cc8fcac2f638ec890 +Author: Lasse Collin +Date: 2023-03-23 15:14:29 +0200 + + CMake: Bump maximum policy version to 3.26. + + It adds only one new policy related to FOLDERS which we don't use. + This makes it clear that the code is compatible with the policies + up to 3.26. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 622d0fdc02d5f565c2872d79bc70c669c95c8284 +Author: Jia Tan +Date: 2023-03-21 23:36:00 +0800 + + CMake: Conditionally build xz list.* files if decoders are enabled. + + CMakeLists.txt | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 3e2dc523c596cd770a6a7c58cacc0d0d8761e853 +Author: Jia Tan +Date: 2023-02-25 11:46:50 +0800 + + CMake: Allow configuring features as cache variables. + + This allows users to change the features they build either in + CMakeCache.txt or by using a CMake GUI. The sources built for + liblzma are affected by this too, so only the necessary files + will be compiled. + + CMakeLists.txt | 528 ++++++++++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 391 insertions(+), 137 deletions(-) + +commit 0c053f97337fa4ead77acefb577e8e86f8ef388d +Author: Lasse Collin +Date: 2023-03-21 14:07:51 +0200 + + Build: Add a comment that AC_PROG_CC_C99 is needed for Autoconf 2.69. + + It's obsolete in Autoconf >= 2.70 and just an alias for AC_PROG_CC + but Autoconf 2.69 requires AC_PROG_CC_C99 to get a C99 compiler. + + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +commit 915d4f6058d52f84d2b58b0a5f3c8272eaa6c1bd +Author: Lasse Collin +Date: 2023-03-21 14:04:37 +0200 + + Build: configure.ac: Use AS_IF and AS_CASE where required. + + This makes no functional difference in the generated configure + (at least with the Autotools versions I have installed) but this + change might prevent future bugs like the one that was just + fixed in the commit 5a5bd7f871818029d5ccbe189f087f591258c294. + + configure.ac | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +commit b848c039586ed2cddb6fb033680dac107cc5143f +Author: Lasse Collin +Date: 2023-03-21 13:12:03 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit c775ba1602a74f29dbc2088bbe4d02c23fc32ba1 +Author: Lasse Collin +Date: 2023-03-21 13:11:49 +0200 + + Build: Fix --disable-threads breaking the building of shared libs. + + This is broken in the releases 5.2.6 to 5.4.2. A workaround + for these releases is to pass EGREP='grep -E' as an argument + to configure in addition to --disable-threads. + + The problem appeared when m4/ax_pthread.m4 was updated in + the commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad which + introduced the use of AC_EGREP_CPP. AC_EGREP_CPP calls + AC_REQUIRE([AC_PROG_EGREP]) to set the shell variable EGREP + but this was only executed if POSIX threads were enabled. + Libtool code also has AC_REQUIRE([AC_PROG_EGREP]) but Autoconf + omits it as AC_PROG_EGREP has already been required earlier. + Thus, if not using POSIX threads, the shell variable EGREP + would be undefined in the Libtool code in configure. + + ax_pthread.m4 is fine. The bug was in configure.ac which called + AX_PTHREAD conditionally in an incorrect way. Using AS_CASE + ensures that all AC_REQUIREs get always run. + + Thanks to Frank Busse for reporting the bug. + Fixes: https://github.com/tukaani-project/xz/issues/45 + + configure.ac | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 0673c9ec98b6bae12b33dc295564514aaa26e2fc +Author: Lasse Collin +Date: 2023-03-19 22:45:59 +0200 + + liblzma: Silence -Wsign-conversion in SSE2 code in memcmplen.h. + + Thanks to Christian Hesse for reporting the issue. + Fixes: https://github.com/tukaani-project/xz/issues/44 + + src/liblzma/common/memcmplen.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 6ca8046ecbc7a1c81ee08f544bfd1414819fb2e8 +Author: Jia Tan +Date: 2023-03-18 23:22:06 +0800 + + Bump version and soname for 5.4.2. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit ce4f246600db10e77fc93d492ea045b4c9830bc6 +Author: Jia Tan +Date: 2023-03-18 22:10:57 +0800 + + Add NEWS for 5.4.2. + + NEWS | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +commit 3634fe330788fc0df217acdb6581031a851600a3 +Author: Lasse Collin +Date: 2023-03-18 16:00:54 +0200 + + Update the copy of GNU GPLv3 from gnu.org to COPYING.GPLv3. + + COPYING.GPLv3 | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 97679d25ce7cb014328f1455bb338903c003d54f +Author: Lasse Collin +Date: 2023-03-18 15:51:57 +0200 + + Change a few HTTP URLs to HTTPS. + + The xz man page timestamp was intentionally left unchanged. + + INSTALL | 2 +- + README | 8 ++++---- + configure.ac | 2 +- + dos/INSTALL.txt | 4 ++-- + src/liblzma/api/lzma.h | 8 ++++---- + src/liblzma/check/sha256.c | 2 +- + src/xz/xz.1 | 2 +- + windows/INSTALL-MinGW.txt | 10 +++++----- + 8 files changed, 19 insertions(+), 19 deletions(-) + +commit 01a67e89a56c3ebf5f6681bd06f0edc22a1ae594 +Author: Jia Tan +Date: 2023-03-18 00:40:28 +0800 + + CMake: Fix typo in a comment. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5dca3f5cbab31105196c89cd6df0a9bbc3307c05 +Author: Lasse Collin +Date: 2023-03-17 18:36:22 +0200 + + Windows: build.bash: Copy liblzma API docs to the output package. + + windows/build.bash | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit ae252862b30b509ab88b2bbcaa08e8d51b57e928 +Author: Lasse Collin +Date: 2023-03-17 08:53:38 +0200 + + Windows: Add microlzma_*.c to the VS project files. + + These should have been included in 5.3.2alpha already. + + windows/vs2013/liblzma.vcxproj | 2 ++ + windows/vs2013/liblzma_dll.vcxproj | 2 ++ + windows/vs2017/liblzma.vcxproj | 2 ++ + windows/vs2017/liblzma_dll.vcxproj | 2 ++ + windows/vs2019/liblzma.vcxproj | 2 ++ + windows/vs2019/liblzma_dll.vcxproj | 2 ++ + 6 files changed, 12 insertions(+) + +commit 147d282cc3733e2723df82622b6540ddfb52635e +Author: Lasse Collin +Date: 2023-03-17 08:43:51 +0200 + + CMake: Add microlzma_*.c to the build. + + These should have been included in 5.3.2alpha already. + + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +commit 4523a5ee29f45c0256af67a15771bc8bbd25ba53 +Author: Lasse Collin +Date: 2023-03-17 08:41:36 +0200 + + Build: Update comments about unaligned access to mention 64-bit. + + cmake/tuklib_integer.cmake | 7 +++---- + m4/tuklib_integer.m4 | 4 ++-- + 2 files changed, 5 insertions(+), 6 deletions(-) + +commit 82aacb40367dc580b09c5a7b270f6c98b63e49b9 +Author: Lasse Collin +Date: 2023-03-17 00:02:30 +0200 + + Tests: Update .gitignore. + + .gitignore | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 5d022c24921eec938604a8cb10d70aa08dbd8575 +Author: Lasse Collin +Date: 2023-03-14 20:04:03 +0200 + + po4a/update-po: Display the script name consistently in error messages. + + po4a/update-po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 896295117324f323c0b8db6a31ad6ebfaa88793d +Author: Jia Tan +Date: 2023-03-17 01:30:36 +0800 + + Doc: Rename Doxygen HTML doc directory name liblzma => api. + + When the docs are installed, calling the directory "liblzma" is + confusing since multiple other files in the doc directory are for + liblzma. This should also make it more natural for distros when they + package the documentation. + + .gitignore | 2 +- + Makefile.am | 18 +++++++++--------- + PACKAGERS | 4 ++-- + doxygen/Doxyfile | 2 +- + doxygen/update-doxygen | 18 +++++++++--------- + 5 files changed, 22 insertions(+), 22 deletions(-) + +commit 94097157fae308b2c1a5edb4e8597c68b45eeaea +Author: Jia Tan +Date: 2023-03-16 22:07:15 +0800 + + liblzma: Remove note from lzma_options_bcj about the ARM64 exception. + + This was left in by mistake since an early version of the ARM64 filter + used a different struct for its options. + + src/liblzma/api/lzma/bcj.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit da16d0b73b79d7785ece6f78a577fadd1fb59d0e +Author: Lasse Collin +Date: 2023-03-15 19:19:13 +0200 + + COPYING: Add a note about the included Doxygen-generated HTML. + + COPYING | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit e57c74f9ef19201f72c106f2c347596f40229936 +Author: Jia Tan +Date: 2023-03-16 21:41:09 +0800 + + Doc: Update PACKAGERS with details about liblzma API docs install. + + PACKAGERS | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +commit 7e2fa48bb73edb25457232e2e62a4f81c6b95281 +Author: Jia Tan +Date: 2023-03-16 21:38:32 +0800 + + liblzma: Add set lzma.h as the main page for Doxygen documentation. + + The \mainpage command is used in the first block of comments in lzma.h. + This changes the previously nearly empty index.html to use the first + comment block in lzma.h for its contents. + + lzma.h is no longer documented separately, but this is for the better + since lzma.h only defined a few macros that users do not need to use. + The individual API header files all have a disclaimer that they should + not be #included directly, so there should be no confusion on the fact + that lzma.h should be the only header used by applications. + + Additionally, the note "See ../lzma.h for information about liblzma as + a whole." was removed since lzma.h is now the main page of the + generated HTML and does not have its own page anymore. So it would be + confusing in the HTML version and was only a "nice to have" when + browsing the source files. + + src/liblzma/api/lzma.h | 1 + + src/liblzma/api/lzma/base.h | 2 -- + src/liblzma/api/lzma/bcj.h | 2 -- + src/liblzma/api/lzma/block.h | 2 -- + src/liblzma/api/lzma/check.h | 2 -- + src/liblzma/api/lzma/container.h | 2 -- + src/liblzma/api/lzma/delta.h | 2 -- + src/liblzma/api/lzma/filter.h | 2 -- + src/liblzma/api/lzma/hardware.h | 2 -- + src/liblzma/api/lzma/index.h | 2 -- + src/liblzma/api/lzma/index_hash.h | 4 +--- + src/liblzma/api/lzma/lzma12.h | 2 -- + src/liblzma/api/lzma/stream_flags.h | 2 -- + src/liblzma/api/lzma/version.h | 2 -- + src/liblzma/api/lzma/vli.h | 2 -- + 15 files changed, 2 insertions(+), 29 deletions(-) + +commit d42977c7acfdf7fd9acc8803cf411eca7dc10478 +Author: Jia Tan +Date: 2023-03-16 21:37:32 +0800 + + Build: Generate doxygen documentation in autogen.sh. + + Another command line option (--no-doxygen) was added to disable + creating the doxygen documenation in cases where it not wanted or + if the doxygen tool is not installed. + + autogen.sh | 35 +++++++++++++++++++++++++++++------ + 1 file changed, 29 insertions(+), 6 deletions(-) + +commit 8fc712fcf41d821069c670f22b8bf628e7a4a877 +Author: Jia Tan +Date: 2023-03-16 21:35:55 +0800 + + Build: Create doxygen/update-doxygen script. + + This is a helper script to generate the Doxygen documentation. It can be + run in 'liblzma' or 'internal' mode by setting the first argument. It + will default to 'liblzma' mode and only generate documentation for the + liblzma API header files. + + The helper script will be run during the custom mydist hook when we + create releases. This hook already alters the source directory, so its + fine to do it here too. This way, we can include the Doxygen generated + files in the distrubtion and when installing. + + In 'liblzma' mode, the JavaScript is stripped from the .html files and + the .js files are removed. This avoids license hassle from jQuery and + other libraries that Doxygen 1.9.6 puts into jquery.js in minified form. + + Makefile.am | 1 + + doxygen/update-doxygen | 111 +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 112 insertions(+) + +commit 77d2c025d19fbac7277c63239cfb1338f02c66c0 +Author: Jia Tan +Date: 2023-03-16 21:34:36 +0800 + + Build: Install Doxygen docs and include in distribution if generated. + + Added a install-data-local target to install the Doxygen documentation + only when it has been generated. In order to correctly remove the docs, + a corresponding uninstall-local target was added. + + If the doxygen docs exist in the source tree, they will also be included + in the distribution now too. + + Makefile.am | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 9af8f6f947a43974a4ff025f4c896f2fb4c91b4f +Author: Jia Tan +Date: 2023-01-03 20:37:30 +0800 + + Doxygen: Refactor Doxyfile.in to doxygen/Doxyfile. + + Instead of having Doxyfile.in configured by Autoconf, the Doxyfile + can have the tags that need to be configured piped into the doxygen + command through stdin with the overrides after Doxyfile's contents. + + Going forward, the documentation should be generated in two different + modes: liblzma or internal. + + liblzma is useful for most users. It is the documentation for just + the liblzma API header files. This is the default. + + internal is for people who want to understand how xz and liblzma work. + It might be useful for people who want to contribute to the project. + + .gitignore | 3 +- + Doxyfile.in | 1234 ------------------------- + Makefile.am | 1 - + configure.ac | 1 - + doxygen/Doxyfile | 2684 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 2686 insertions(+), 1237 deletions(-) + +commit 1c558a26928b753fcf1c0d4bce9c0643285edd86 +Author: Jia Tan +Date: 2023-02-28 23:22:36 +0800 + + Tests: Remove unused macros and functions. + + tests/tests.h | 75 ----------------------------------------------------------- + 1 file changed, 75 deletions(-) + +commit 7479a69a45a1b8fdb9a209e11f247dce11ac1ba0 +Author: Jia Tan +Date: 2023-01-12 22:29:07 +0800 + + Tests: Refactors existing lzma_index tests. + + Converts the existing lzma_index tests into tuktests and covers every + API function from index.h except for lzma_file_info_decoder, which can + be tested in the future. + + tests/test_index.c | 2036 ++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 1492 insertions(+), 544 deletions(-) + +commit fd56d5353360279c10e8e5e05f5bc6ea03f64584 +Author: Lasse Collin +Date: 2023-03-07 19:59:23 +0200 + + xz: Make Capsicum sandbox more strict with stdin and stdout. + + src/xz/file_io.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit d1bdaaebc68cae7f0ba457fa990b520df2186fd1 +Author: Lasse Collin +Date: 2023-03-11 19:31:40 +0200 + + xz: Don't fail if Capsicum is enabled but kernel doesn't support it. + + (This commit combines related commits from the master branch.) + + If Capsicum support is missing from the kernel or xz is being run + in an emulator that lacks Capsicum suport, the syscalls will fail + and set errno to ENOSYS. Previously xz would display and error and + exit, making xz unusable. Now it will check for ENOSYS and run + without sandbox support. Other tools like ssh behave similarly. + + Displaying a warning for missing Capsicum support was considered + but such extra output would quickly become annoying. It would also + break test_scripts.sh in "make check". + + Also move cap_enter() to be the first step instead of the last one. + This matches the example in the cap_rights_limit(2) man page. With + the current code it shouldn't make any practical difference though. + + Thanks to Xin Li for the bug report, suggesting a fix, and testing: + https://github.com/tukaani-project/xz/pull/43 + + Thanks to Jia Tan for most of the original commits. + + src/xz/file_io.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +commit 5d351c69c19d212ddd2cf1f3bdb24900820c6776 +Author: Jia Tan +Date: 2023-02-04 21:06:35 +0800 + + Build: Adjust CMake version search regex. + + Now, the LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, and LZMA_VERSION_PATCH + macros do not need to be on consecutive lines in version.h. They can be + separated by more whitespace, comments, or even other content, as long + as they appear in the proper order (major, minor, patch). + + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +commit b82d4831e3f2339c4cdbc47776c99462088c11b7 +Author: Jia Tan +Date: 2023-01-26 09:50:21 +0800 + + liblzma: Improve documentation for version.h. + + Specified parameter and return values for API functions and documented + a few more of the macros. + + src/liblzma/api/lzma/version.h | 29 ++++++++++++++++++++++------- + 1 file changed, 22 insertions(+), 7 deletions(-) + +commit 2caba3efe3e0c2d7c6dca00e22c56812326a34e6 +Author: Jia Tan +Date: 2023-02-24 23:46:23 +0800 + + liblzma: Clarify lzma_lzma_preset() documentation in lzma12.h. + + lzma_lzma_preset() does not guarentee that the lzma_options_lzma are + usable in an encoder even if it returns false (success). If liblzma + is built with default configurations, then the options will always be + usable. However if the match finders hc3, hc4, or bt4 are disabled, then + the options may not be usable depending on the preset level requested. + + The documentation was updated to reflect this complexity, since this + behavior was unclear before. + + src/liblzma/api/lzma/lzma12.h | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 594f904673ba55a833adfa60bbab6b60d4902d08 +Author: Lasse Collin +Date: 2023-02-27 18:38:35 +0200 + + CMake: Require that the C compiler supports C99 or a newer standard. + + Thanks to autoantwort for reporting the issue and suggesting + a different patch: + https://github.com/tukaani-project/xz/pull/42 + + CMakeLists.txt | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 88101143cb774bca6b7006c8335b09dc3f334140 +Author: Jia Tan +Date: 2023-02-24 18:10:37 +0800 + + Tests: Small tweak to test-vli.c. + + The static global variables can be disabled if encoders and decoders + are not built. If they are not disabled and -Werror is used, it will + cause an usused warning as an error. + + tests/test_vli.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 4042dbf03a06e019ccdd1e9d1b94cf613d62d5a9 +Author: Jia Tan +Date: 2023-02-06 21:46:43 +0800 + + liblzma: Replace '\n' -> newline in filter.h documentation. + + The '\n' renders as a newline when the comments are converted to html + by Doxygen. + + src/liblzma/api/lzma/filter.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3971f5c5024750ce8286891c6f79ae1661047483 +Author: Jia Tan +Date: 2023-02-06 21:45:37 +0800 + + liblzma: Shorten return description for two functions in filter.h. + + Shorten the description for lzma_raw_encoder_memusage() and + lzma_raw_decoder_memusage(). + + src/liblzma/api/lzma/filter.h | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit 5e61b39432752b6cd1a7b518f0f9e4f0c3f0f242 +Author: Jia Tan +Date: 2023-02-06 21:44:45 +0800 + + liblzma: Reword a few lines in filter.h + + src/liblzma/api/lzma/filter.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 8a53533869defa1191b41f176a0312cb53a139e2 +Author: Jia Tan +Date: 2023-02-06 21:35:06 +0800 + + liblzma: Improve documentation in filter.h. + + All functions now explicitly specify parameter and return values. + The notes and code annotations were moved before the parameter and + return value descriptions for consistency. + + Also, the description above lzma_filter_encoder_is_supported() about + not being able to list available filters was removed since + lzma_str_list_filters() will do this. + + src/liblzma/api/lzma/filter.h | 226 ++++++++++++++++++++++++++---------------- + 1 file changed, 143 insertions(+), 83 deletions(-) + +commit 6d05b08b17ac8cb93165ee8f310fdd925b0b258f +Author: Lasse Collin +Date: 2023-02-23 20:46:16 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit dfc9a54082e0fc7b3b796ea15336b5075acc79d5 +Author: Lasse Collin +Date: 2023-02-21 22:57:10 +0200 + + liblzma: Avoid null pointer + 0 (undefined behavior in C). + + In the C99 and C17 standards, section 6.5.6 paragraph 8 means that + adding 0 to a null pointer is undefined behavior. As of writing, + "clang -fsanitize=undefined" (Clang 15) diagnoses this. However, + I'm not aware of any compiler that would take advantage of this + when optimizing (Clang 15 included). It's good to avoid this anyway + since compilers might some day infer that pointer arithmetic implies + that the pointer is not NULL. That is, the following foo() would then + unconditionally return 0, even for foo(NULL, 0): + + void bar(char *a, char *b); + + int foo(char *a, size_t n) + { + bar(a, a + n); + return a == NULL; + } + + In contrast to C, C++ explicitly allows null pointer + 0. So if + the above is compiled as C++ then there is no undefined behavior + in the foo(NULL, 0) call. + + To me it seems that changing the C standard would be the sane + thing to do (just add one sentence) as it would ensure that a huge + amount of old code won't break in the future. Based on web searches + it seems that a large number of codebases (where null pointer + 0 + occurs) are being fixed instead to be future-proof in case compilers + will some day optimize based on it (like making the above foo(NULL, 0) + return 0) which in the worst case will cause security bugs. + + Some projects don't plan to change it. For example, gnulib and thus + many GNU tools currently require that null pointer + 0 is defined: + + https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00000.html + + https://www.gnu.org/software/gnulib/manual/html_node/Other-portability-assumptions.html + + In XZ Utils null pointer + 0 issue should be fixed after this + commit. This adds a few if-statements and thus branches to avoid + null pointer + 0. These check for size > 0 instead of ptr != NULL + because this way bugs where size > 0 && ptr == NULL will likely + get caught quickly. None of them are in hot spots so it shouldn't + matter for performance. + + A little less readable version would be replacing + + ptr + offset + + with + + offset != 0 ? ptr + offset : ptr + + or creating a macro for it: + + #define my_ptr_add(ptr, offset) \ + ((offset) != 0 ? ((ptr) + (offset)) : (ptr)) + + Checking for offset != 0 instead of ptr != NULL allows GCC >= 8.1, + Clang >= 7, and Clang-based ICX to optimize it to the very same code + as ptr + offset. That is, it won't create a branch. So for hot code + this could be a good solution to avoid null pointer + 0. Unfortunately + other compilers like ICC 2021 or MSVC 19.33 (VS2022) will create a + branch from my_ptr_add(). + + Thanks to Marcin Kowalczyk for reporting the problem: + https://github.com/tukaani-project/xz/issues/36 + + src/liblzma/common/block_decoder.c | 5 ++++- + src/liblzma/common/block_encoder.c | 7 +++++-- + src/liblzma/common/common.c | 20 ++++++++++++++------ + src/liblzma/common/index_decoder.c | 13 ++++++++++--- + src/liblzma/common/index_encoder.c | 11 +++++++++-- + src/liblzma/common/index_hash.c | 13 ++++++++++--- + src/liblzma/common/lzip_decoder.c | 6 +++++- + src/liblzma/delta/delta_decoder.c | 7 ++++++- + src/liblzma/delta/delta_encoder.c | 12 ++++++++++-- + src/liblzma/simple/simple_coder.c | 6 ++++-- + 10 files changed, 77 insertions(+), 23 deletions(-) + +commit f6dce49cb656b358e2fb2a3032e35e20af34dc84 +Author: Jia Tan +Date: 2023-02-07 00:00:44 +0800 + + liblzma: Adjust container.h for consistency with filter.h. + + src/liblzma/api/lzma/container.h | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +commit 173d240bb4763aedc8c01df4d9c83e311d954c33 +Author: Jia Tan +Date: 2023-02-07 00:00:09 +0800 + + liblzma: Fix small typos and reword a few things in filter.h. + + src/liblzma/api/lzma/container.h | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +commit 17797bacde3f7264048ef0976c137a600148d6cf +Author: Jia Tan +Date: 2023-02-06 23:42:08 +0800 + + liblzma: Convert list of flags in lzma_mt to bulleted list. + + src/liblzma/api/lzma/container.h | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 37da0e727161b401b8bfd8dccf163a4b2fc0460b +Author: Jia Tan +Date: 2023-01-26 23:17:41 +0800 + + liblzma: Fix typo in documentation in container.h + + lzma_microlzma_decoder -> lzma_microlzma_encoder + + src/liblzma/api/lzma/container.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b8331077c626e6bf14f4671d09b561146eaf816a +Author: Jia Tan +Date: 2023-01-26 23:16:34 +0800 + + liblzma: Improve documentation for container.h + + Standardizing each function to always specify parameters and return + values. Also moved the parameters and return values to the end of each + function description. + + src/liblzma/api/lzma/container.h | 146 +++++++++++++++++++++++++-------------- + 1 file changed, 93 insertions(+), 53 deletions(-) + +commit b9a3511bb61d3b6ce49abd33dce6155a573f5272 +Author: Jia Tan +Date: 2023-02-22 20:59:41 +0800 + + CMake: Add LZIP decoder test to list of tests. + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit cd82ef2fb48b174c57cd03b84a9a0f978772cb89 +Author: Lasse Collin +Date: 2023-02-17 20:56:49 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 076e911ba25cadf2cbdfbd0f65991a002e210c0b +Author: Lasse Collin +Date: 2023-02-17 20:48:28 +0200 + + Build: Use only the generic symbol versioning on MicroBlaze. + + On MicroBlaze, GCC 12 is broken in sense that + __has_attribute(__symver__) returns true but it still doesn't + support the __symver__ attribute even though the platform is ELF + and symbol versioning is supported if using the traditional + __asm__(".symver ...") method. Avoiding the traditional method is + good because it breaks LTO (-flto) builds with GCC. + + See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766 + + For now the only extra symbols in liblzma_linux.map are the + compatibility symbols with the patch that spread from RHEL/CentOS 7. + These require the use of __symver__ attribute or __asm__(".symver ...") + in the C code. Compatibility with the patch from CentOS 7 doesn't + seem valuable on MicroBlaze so use liblzma_generic.map on MicroBlaze + instead. It doesn't require anything special in the C code and thus + no LTO issues either. + + An alternative would be to detect support for __symver__ + attribute in configure.ac and CMakeLists.txt and fall back + to __asm__(".symver ...") but then LTO would be silently broken + on MicroBlaze. It sounds likely that MicroBlaze is a special + case so let's treat it as a such because that is simpler. If + a similar issue exists on some other platform too then hopefully + someone will report it and this can be reconsidered. + + (This doesn't do the same fix in CMakeLists.txt. Perhaps it should + but perhaps CMake build of liblzma doesn't matter much on MicroBlaze. + The problem breaks the build so it's easy to notice and can be fixed + later.) + + Thanks to Vincent Fazio for reporting the problem and proposing + a patch (in the end that solution wasn't used): + https://github.com/tukaani-project/xz/pull/32 + + configure.ac | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit bc34e5ac9996667d2c1ec9a7895ec5931ac4caea +Author: Lasse Collin +Date: 2023-02-16 21:09:00 +0200 + + liblzma: Very minor API doc tweaks. + + Use "member" to refer to struct members as that's the term used + by the C standard. + + Use lzma_options_delta.dist and such in docs so that in Doxygen's + HTML output they will link to the doc of the struct member. + + Clean up a few trailing white spaces too. + + src/liblzma/api/lzma/block.h | 6 +++--- + src/liblzma/api/lzma/delta.h | 6 +++--- + src/liblzma/api/lzma/index.h | 10 +++++----- + src/liblzma/api/lzma/stream_flags.h | 6 +++--- + 4 files changed, 14 insertions(+), 14 deletions(-) + +commit d31fbd28be5b79eb682db50004b0fb7aad5299ec +Author: Jia Tan +Date: 2023-02-17 00:54:33 +0800 + + liblzma: Adjust spacing in doc headers in bcj.h. + + src/liblzma/api/lzma/bcj.h | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 701e9be6bede19771895f756082db0c017f86f07 +Author: Jia Tan +Date: 2023-02-17 00:44:44 +0800 + + liblzma: Adjust documentation in bcj.h for consistent style. + + src/liblzma/api/lzma/bcj.h | 43 ++++++++++++++++++++++--------------------- + 1 file changed, 22 insertions(+), 21 deletions(-) + +commit 762c4d0b62d2694cf3a01e030fdfe68e09e7b503 +Author: Jia Tan +Date: 2023-02-17 00:36:05 +0800 + + liblzma: Rename field => member in documentation. + + Also adjusted preset value => preset level. + + src/liblzma/api/lzma/base.h | 18 +++++++-------- + src/liblzma/api/lzma/block.h | 44 ++++++++++++++++++------------------- + src/liblzma/api/lzma/container.h | 26 +++++++++++----------- + src/liblzma/api/lzma/delta.h | 12 +++++----- + src/liblzma/api/lzma/index.h | 30 ++++++++++++------------- + src/liblzma/api/lzma/lzma12.h | 28 +++++++++++------------ + src/liblzma/api/lzma/stream_flags.h | 32 +++++++++++++-------------- + 7 files changed, 95 insertions(+), 95 deletions(-) + +commit 0ce1db0223854d94b4a0d17737ac0486a75d9e6a +Author: Lasse Collin +Date: 2023-02-16 17:59:50 +0200 + + liblzma: Silence a warning from MSVC. + + It gives C4146 here since unary minus with unsigned integer + is still unsigned (which is the intention here). Doing it + with substraction makes it clearer and avoids the warning. + + Thanks to Nathan Moinvaziri for reporting this. + + src/liblzma/check/crc64_fast.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d83da006b3e8dbad9112e6cde6b27049d193c9ec +Author: Jia Tan +Date: 2023-02-16 21:04:54 +0800 + + liblzma: Improve documentation for stream_flags.h + + Standardizing each function to always specify parameters and return + values. Also moved the parameters and return values to the end of each + function description. + + A few small things were reworded and long sentences broken up. + + src/liblzma/api/lzma/stream_flags.h | 76 ++++++++++++++++++++++--------------- + 1 file changed, 46 insertions(+), 30 deletions(-) + +commit 2796bb4736f645d34939b5d62d5958f534e41e69 +Author: Jia Tan +Date: 2023-02-14 21:50:16 +0800 + + liblzma: Improve documentation in lzma12.h. + + All functions now explicitly specify parameter and return values. + + src/liblzma/api/lzma/lzma12.h | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +commit ebebaa8d9381afea440eb1b01917117551adf68f +Author: Jia Tan +Date: 2023-01-27 22:44:06 +0800 + + liblzma: Improve documentation in check.h. + + All functions now explicitly specify parameter and return values. + Also moved the note about SHA-256 functions not being exported to the + top of the file. + + src/liblzma/api/lzma/check.h | 41 ++++++++++++++++++++++++++++------------- + 1 file changed, 28 insertions(+), 13 deletions(-) + +commit 765fa2865aab97ea713c1715922e322b3cf599a7 +Author: Jia Tan +Date: 2023-02-08 21:33:52 +0800 + + liblzma: Improve documentation in index.h + + All functions now explicitly specify parameter and return values. + + src/liblzma/api/lzma/index.h | 177 ++++++++++++++++++++++++++++++------------- + 1 file changed, 126 insertions(+), 51 deletions(-) + +commit 918e208af5960728b6def01e692b395f7d8e3701 +Author: Jia Tan +Date: 2023-02-08 20:35:32 +0800 + + liblzma: Reword a comment in index.h. + + src/liblzma/api/lzma/index.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 1f157d214bc09338876d2467b549935679abc0bf +Author: Jia Tan +Date: 2023-02-08 20:30:23 +0800 + + liblzma: Omit lzma_index_iter's internal field from Doxygen docs. + + Add \private above this field and its sub-fields since it is not meant + to be modified by users. + + src/liblzma/api/lzma/index.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +commit 28757fa46d8e0f0a9c17628b2b6af9bcb3cd96fc +Author: Jia Tan +Date: 2023-01-21 21:32:03 +0800 + + liblzma: Fix documentation for LZMA_MEMLIMIT_ERROR. + + LZMA_MEMLIMIT_ERROR was missing the "<" character needed to put + documentation after a member. + + src/liblzma/api/lzma/base.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 135d5a1a65a9e199b9a5550c1f788cf43cd81018 +Author: Jia Tan +Date: 2023-01-21 00:29:38 +0800 + + liblzma: Improve documentation for base.h. + + Standardizing each function to always specify params and return values. + Also fixed a small grammar mistake. + + src/liblzma/api/lzma/base.h | 30 +++++++++++++++++++++++++----- + 1 file changed, 25 insertions(+), 5 deletions(-) + +commit 2287d5668384e289d51e72724997dc920483768e +Author: Jia Tan +Date: 2023-02-14 00:08:33 +0800 + + liblzma: Minor improvements to vli.h. + + Added [out] annotations to parameters that are pointers and can have + their value changed. Also added a clarification to lzma_vli_is_valid. + + src/liblzma/api/lzma/vli.h | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit 7124b8a16ae60cb2e93218ff531868eebd673bde +Author: Jia Tan +Date: 2023-02-10 21:38:02 +0800 + + liblzma: Add comments for macros in delta.h. + + Document LZMA_DELTA_DIST_MIN and LZMA_DELTA_DIST_MAX for completeness + and to avoid Doxygen warnings. + + src/liblzma/api/lzma/delta.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 59c7bb8931159fdb1a31bbbeaed0e6984e2d3c81 +Author: Jia Tan +Date: 2023-02-10 21:35:23 +0800 + + liblzma: Improve documentation in index_hash.h. + + All functions now explicitly specify parameter and return values. + Also reworded the description of lzma_index_hash_init() for readability. + + src/liblzma/api/lzma/index_hash.h | 36 +++++++++++++++++++++++++++--------- + 1 file changed, 27 insertions(+), 9 deletions(-) + +commit e970c28ac3cb2e8051925f81db2fe953664c2645 +Author: Jia Tan +Date: 2023-02-03 00:33:32 +0800 + + liblzma: Fix bug in lzma_str_from_filters() not checking filters[] length. + + The bug is only a problem in applications that do not properly terminate + the filters[] array with LZMA_VLI_UNKNOWN or have more than + LZMA_FILTERS_MAX filters. This bug does not affect xz. + + src/liblzma/common/string_conversion.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 85e01266a96689448abb249da6c6abc3afcd4a4e +Author: Jia Tan +Date: 2023-02-03 00:32:47 +0800 + + Tests: Create test_filter_str.c. + + Tests lzma_str_to_filters(), lzma_str_from_filters(), and + lzma_str_list_filters() API functions. + + CMakeLists.txt | 1 + + tests/Makefile.am | 2 + + tests/test_filter_str.c | 593 ++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 596 insertions(+) + +commit 3fa0f3ba12dd3383f62dbfa18a864f9b4217fa0a +Author: Jia Tan +Date: 2023-01-22 08:49:00 +0800 + + liblzma: Fix typos in comments in string_conversion.c. + + src/liblzma/common/string_conversion.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 32dbe045d74e94f75c53236fa2a6c0454d7b6d9e +Author: Jia Tan +Date: 2023-02-03 00:20:20 +0800 + + liblzma: Clarify block encoder and decoder documentation. + + Added a few sentences to the description for lzma_block_encoder() and + lzma_block_decoder() to highlight that the Block Header must be coded + before calling these functions. + + src/liblzma/api/lzma/block.h | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +commit ccf12acbfa7331b1bbb99ec55879186eb35f879f +Author: Jia Tan +Date: 2023-02-03 00:12:24 +0800 + + Update lzma_block documentation for lzma_block_uncomp_encode(). + + src/liblzma/api/lzma/block.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit 6a0b168dd9dc1ef437255c4bfdc6eff8b96fdb24 +Author: Jia Tan +Date: 2023-02-03 00:11:37 +0800 + + liblzma: Minor edits to lzma_block header_size documentation. + + src/liblzma/api/lzma/block.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 84ce36f90e68471fec1f0e61cd93ac7ed9ab4883 +Author: Jia Tan +Date: 2023-02-03 00:11:07 +0800 + + liblzma: Enumerate functions that read version in lzma_block. + + src/liblzma/api/lzma/block.h | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +commit d6620774682830d606f57109861b6763805b3492 +Author: Jia Tan +Date: 2023-02-03 00:10:34 +0800 + + liblzma: Clarify comment in block.h. + + src/liblzma/api/lzma/block.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 880adb5aa25f66a53d81c2f3acc716f7a4d373d1 +Author: Jia Tan +Date: 2023-02-03 00:07:23 +0800 + + liblzma: Improve documentation for block.h. + + Standardizing each function to always specify params and return values. + Output pointer parameters are also marked with doxygen style [out] to + make it clear. Any note sections were also moved above the parameter and + return sections for consistency. + + src/liblzma/api/lzma/block.h | 96 ++++++++++++++++++++++++++++++++++---------- + 1 file changed, 75 insertions(+), 21 deletions(-) + +commit b5b1b1f061c342271e4977ce5cba604a19c0ca52 +Author: Jia Tan +Date: 2023-02-01 23:38:30 +0800 + + liblzma: Clarify a comment about LZMA_STR_NO_VALIDATION. + + The flag description for LZMA_STR_NO_VALIDATION was previously confusing + about the treatment for filters than cannot be used with .xz format + (lzma1) without using LZMA_STR_ALL_FILTERS. Now, it is clear that + LZMA_STR_NO_VALIDATION is not a super set of LZMA_STR_ALL_FILTERS. + + src/liblzma/api/lzma/filter.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit e904e778b82b14f2779aab80d6c8f3c01a3fc54b +Author: Jia Tan +Date: 2023-01-27 20:14:51 +0800 + + Translations: Add Brazilian Portuguese translation of man pages. + + Thanks to Rafael Fontenelle. + + po4a/po4a.conf | 2 +- + po4a/pt_BR.po | 3677 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 3678 insertions(+), 1 deletion(-) + +commit e9c47e79c9584ba1126f5fa0dbe6c96e67411aa6 +Author: Jia Tan +Date: 2023-01-24 20:48:50 +0800 + + liblzma: Fix documentation in filter.h for lzma_str_to_filters() + + The previous documentation for lzma_str_to_filters() was technically + correct, but misleading. lzma_str_to_filters() returns NULL on success, + which is in practice always defined to 0. This is the same value as + LZMA_OK, but lzma_str_to_filters() does not return lzma_ret so we should + be more clear. + + src/liblzma/api/lzma/filter.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 99575947a58a60416c570eb78038d18a1ea4cef4 +Author: Jia Tan +Date: 2023-01-07 21:55:06 +0800 + + xz: Refactor duplicated check for custom suffix when using --format=raw + + src/xz/args.c | 8 ++++++++ + src/xz/suffix.c | 26 ++++++++------------------ + src/xz/suffix.h | 8 ++++++++ + 3 files changed, 24 insertions(+), 18 deletions(-) + +commit 76dec92fcca4a9ccd2063ed6d5d9e3474665baad +Author: Jia Tan +Date: 2023-01-20 21:53:14 +0800 + + liblzma: Set documentation on all reserved fields to private. + + This prevents the reserved fields from being part of the generated + Doxygen documentation. + + src/liblzma/api/lzma/base.h | 17 +++++++++++++++ + src/liblzma/api/lzma/block.h | 43 +++++++++++++++++++++++++++++++++++++ + src/liblzma/api/lzma/container.h | 24 +++++++++++++++++++++ + src/liblzma/api/lzma/delta.h | 12 +++++++++++ + src/liblzma/api/lzma/index.h | 27 +++++++++++++++++++++++ + src/liblzma/api/lzma/lzma12.h | 22 +++++++++++++++++++ + src/liblzma/api/lzma/stream_flags.h | 28 ++++++++++++++++++++++++ + 7 files changed, 173 insertions(+) + +commit bd213d06ebf92cf42eeb97e7c578bddc857f8ea8 +Author: Jia Tan +Date: 2022-12-21 23:59:43 +0800 + + liblzma: Highlight liblzma API headers should not be included directly. + + This improves the generated Doxygen HTML files to better highlight + how to properly use the liblzma API header files. + + src/liblzma/api/lzma/base.h | 5 +++-- + src/liblzma/api/lzma/bcj.h | 5 +++-- + src/liblzma/api/lzma/block.h | 5 +++-- + src/liblzma/api/lzma/check.h | 5 +++-- + src/liblzma/api/lzma/container.h | 5 +++-- + src/liblzma/api/lzma/delta.h | 5 +++-- + src/liblzma/api/lzma/filter.h | 5 +++-- + src/liblzma/api/lzma/hardware.h | 5 +++-- + src/liblzma/api/lzma/index.h | 5 +++-- + src/liblzma/api/lzma/index_hash.h | 5 +++-- + src/liblzma/api/lzma/lzma12.h | 5 +++-- + src/liblzma/api/lzma/stream_flags.h | 5 +++-- + src/liblzma/api/lzma/version.h | 5 +++-- + src/liblzma/api/lzma/vli.h | 5 +++-- + 14 files changed, 42 insertions(+), 28 deletions(-) + +commit 257dbff0ba1a7bc45a74d203ece015c9f70c88cd +Author: Jia Tan +Date: 2023-01-19 20:35:09 +0800 + + tuklib_physmem: Silence warning from -Wcast-function-type on MinGW-w64. + + tuklib_physmem depends on GetProcAddress() for both MSVC and MinGW-w64 + to retrieve a function address. The proper way to do this is to cast the + return value to the type of function pointer retrieved. Unfortunately, + this causes a cast-function-type warning, so the best solution is to + simply ignore the warning. + + src/common/tuklib_physmem.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 720ad4a44282a7ee59aa9920eaf495d85d245d97 +Author: Jia Tan +Date: 2023-01-16 21:35:45 +0800 + + xz: Add missing comment for coder_set_compression_settings() + + src/xz/coder.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 88dc19163421282369c0989e997c05f9a447edc6 +Author: Jia Tan +Date: 2023-01-16 20:55:10 +0800 + + xz: Do not set compression settings with raw format in list mode. + + Calling coder_set_compression_settings() in list mode with verbose mode + on caused the filter chain and memory requirements to print. This was + unnecessary since the command results in an error and not consistent + with other formats like lzma and alone. + + src/xz/args.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 039e0ab13efb144642f9d99eeeb9c668e76bb430 +Author: Jia Tan +Date: 2023-01-13 20:37:06 +0800 + + Translations: Update the Brazilian Portuguese translation. + + po/pt_BR.po | 603 ++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 344 insertions(+), 259 deletions(-) + +commit 718f7a60e740b26b8353965edaaddc7d4deb4d85 +Author: Lasse Collin +Date: 2023-01-12 13:04:05 +0200 + + Build: Omit -Wmissing-noreturn from the default warnings. + + It's not that important. It can be annoying in builds that + disable many features since in those cases the tests programs + will correctly trigger this warning with Clang. + + configure.ac | 1 - + 1 file changed, 1 deletion(-) + +commit 3ccedb09724c998c39d708c945f6da5852c39e13 +Author: Lasse Collin +Date: 2023-01-12 06:05:58 +0200 + + xz: Use ssize_t for the to-be-ignored return value from write(fd, ptr, 1). + + It makes no difference here as the return value fits into an int + too and it then gets ignored but this looks better. + + src/xz/file_io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 09fbd2f0527def89e839c8907de4fe7ef6bc5019 +Author: Lasse Collin +Date: 2023-01-12 06:01:12 +0200 + + xz: Silence warnings from -Wsign-conversion in a 32-bit build. + + src/common/tuklib_mbstr_fw.c | 2 +- + src/xz/list.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 683d3f178ef1487b5418be49f331b0131a101b40 +Author: Lasse Collin +Date: 2023-01-12 05:38:48 +0200 + + liblzma: Silence another warning from -Wsign-conversion in a 32-bit build. + + It doesn't warn on a 64-bit system because truncating + a ptrdiff_t (signed long) to uint32_t is diagnosed under + -Wconversion by GCC and -Wshorten-64-to-32 by Clang. + + src/liblzma/lz/lz_encoder_mf.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 2b8062ef94a38d0f9ad0d1b309e8748db52f5c15 +Author: Lasse Collin +Date: 2023-01-12 04:46:45 +0200 + + liblzma: Silence a warning from -Wsign-conversion in a 32-bit build. + + src/common/mythread.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b16b9c0d22227012518595c2222facc73bd833a8 +Author: Lasse Collin +Date: 2023-01-12 04:17:24 +0200 + + Build: Make configure add more warning flags for GCC and Clang. + + -Wstrict-aliasing was removed from the list since it is enabled + by -Wall already. + + A normal build is clean with these on GNU/Linux x86-64 with + GCC 12.2.0 and Clang 14.0.6. + + configure.ac | 36 +++++++++++++++++++++++++++++++----- + 1 file changed, 31 insertions(+), 5 deletions(-) + +commit c47ecd6d3909d0d3ff48dfd6e2ee41e7c7130b94 +Author: Lasse Collin +Date: 2023-01-12 04:14:18 +0200 + + Tests: Fix warnings from clang --Wassign-enum. + + Explicitly casting the integer to lzma_check silences the warning. + Since such an invalid value is needed in multiple tests, a constant + INVALID_LZMA_CHECK_ID was added to tests.h. + + The use of 0x1000 for lzma_block.check wasn't optimal as if + the underlying type is a char then 0x1000 will be truncated to 0. + However, in these test cases the value is ignored, thus even with + such truncation the test would have passed. + + tests/test_block_header.c | 6 +++--- + tests/test_check.c | 2 +- + tests/test_stream_flags.c | 8 ++++---- + tests/tests.h | 9 +++++++++ + 4 files changed, 17 insertions(+), 8 deletions(-) + +commit 34e13ce015232968731de2a9ec3440a08b0084b1 +Author: Lasse Collin +Date: 2023-01-12 03:51:07 +0200 + + Tests: Silence warnings from -Wsign-conversion. + + Note that assigning an unsigned int to lzma_check doesn't warn + on GNU/Linux x86-64 since the enum type is unsigned on that + platform. The enum can be signed on some other platform though + so it's best to use enumeration type lzma_check in these situations. + + tests/test_check.c | 6 +++--- + tests/test_stream_flags.c | 10 +++++----- + 2 files changed, 8 insertions(+), 8 deletions(-) + +commit 6671d0fe46b77f0fafce860836b7a12dc3cda14a +Author: Lasse Collin +Date: 2023-01-12 03:19:59 +0200 + + liblzma: Silence warnings from clang -Wconditional-uninitialized. + + This is similar to 2ce4f36f179a81d0c6e182a409f363df759d1ad0. + The actual initialization of the variables is done inside + mythread_sync() macro. Clang doesn't seem to see that + the initialization code inside the macro is always executed. + + src/liblzma/common/stream_decoder_mt.c | 8 +++++--- + src/liblzma/common/stream_encoder_mt.c | 2 +- + 2 files changed, 6 insertions(+), 4 deletions(-) + +commit d3e833ca1d2abda54648494c33aca73a40a47efe +Author: Lasse Collin +Date: 2023-01-12 03:11:40 +0200 + + Fix warnings from clang -Wdocumentation. + + src/liblzma/check/check.h | 4 ---- + src/liblzma/lz/lz_encoder_mf.c | 4 ++-- + src/xz/options.c | 4 ++-- + 3 files changed, 4 insertions(+), 8 deletions(-) + +commit 977dd2e26bc50efec8d30fb90380394042d24558 +Author: Lasse Collin +Date: 2023-01-12 03:04:28 +0200 + + Tests: test_lzip_decoder: Remove trailing white-space. + + tests/test_lzip_decoder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c55157ed7437ab14f2afb7fecf331e321f2edf9a +Author: Lasse Collin +Date: 2023-01-12 03:03:55 +0200 + + Tests: test_lzip_decoder: Silence warnings from -Wsign-conversion. + + tests/test_lzip_decoder.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +commit 18b845e69752c975dfeda418ec00eda22605c2ee +Author: Lasse Collin +Date: 2023-01-11 18:52:54 +0200 + + Bump version and soname for 5.4.1. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 4080bbb844fb36701ffb978f0c41ea2c2c9f8960 +Author: Jia Tan +Date: 2023-01-11 23:58:16 +0800 + + Add NEWS for 5.4.1. + + NEWS | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 70 insertions(+) + +commit 674c89fdb8c457ebc3a0652e235d8b6cd7b7dee2 +Author: Lasse Collin +Date: 2023-01-10 11:56:11 +0200 + + sysdefs.h: Don't include strings.h anymore. + + On some platforms src/xz/suffix.c may need for + strcasecmp() but suffix.c includes the header when it needs it. + + Unless there is an old system that otherwise supports enough C99 + to build XZ Utils but doesn't have C89/C90-compatible , + there should be no need to include in sysdefs.h. + + src/common/sysdefs.h | 6 ------ + 1 file changed, 6 deletions(-) + +commit 2a6b938084fac9ddb39cd69c9beeed15c3b6f6f6 +Author: Lasse Collin +Date: 2023-01-10 11:23:41 +0200 + + xz: Include in suffix.c if needed for strcasecmp(). + + SUSv2 and POSIX.1‐2017 declare only a few functions in . + Of these, strcasecmp() is used on some platforms in suffix.c. + Nothing else in the project needs (at least if + building on a modern system). + + sysdefs.h currently includes if HAVE_STRINGS_H is + defined and suffix.c relied on this. + + Note that dos/config.h doesn't #define HAVE_STRINGS_H even though + DJGPP does have strings.h. It isn't needed with DJGPP as strcasecmp() + is also in in DJGPP. + + src/xz/suffix.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit aea639e81beb548e3114c74b6d9a894d6e036189 +Author: Jia Tan +Date: 2023-01-11 22:46:48 +0800 + + xz: Fix warning -Wformat-nonliteral on clang in message.c. + + clang and gcc differ in how they handle -Wformat-nonliteral. gcc will + allow a non-literal format string as long as the function takes its + format arguments as a va_list. + + src/xz/message.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit e3b42bfcb0f67988beee7c7022fed0361282be45 +Author: Jia Tan +Date: 2023-01-11 20:58:31 +0800 + + Tests: Fix test_filter_flags copy/paste error. + + tests/test_filter_flags.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 21625b7e11d004788e40eb5eb88d9d89f65fe347 +Author: Jia Tan +Date: 2023-01-11 20:42:29 +0800 + + Tests: Fix type-limits warning in test_filter_flags. + + This only occurs in test_filter_flags when the BCJ filters are not + configured and built. In this case, ARRAY_SIZE() returns 0 and causes a + type-limits warning with the loop variable since an unsigned number will + always be >= 0. + + tests/test_filter_flags.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +commit c337983e928682d56ce3470b286a8d5b8646e0ad +Author: Lasse Collin +Date: 2023-01-10 22:14:03 +0200 + + liblzma: CLMUL CRC64: Work around a bug in MSVC, second attempt. + + This affects only 32-bit x86 builds. x86-64 is OK as is. + + I still cannot easily test this myself. The reporter has tested + this and it passes the tests included in the CMake build and + performance is good: raw CRC64 is 2-3 times faster than the + C version of the slice-by-four method. (Note that liblzma doesn't + include a MSVC-compatible version of the 32-bit x86 assembly code + for the slice-by-four method.) + + Thanks to Iouri Kharon for figuring out a fix, testing, and + benchmarking. + + src/liblzma/check/crc64_fast.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit b7fb438ea0e3ee02e3a164f3b72fae456cbe34d7 +Author: Jia Tan +Date: 2023-01-11 01:18:50 +0800 + + Tests: Fix unused function warning in test_block_header. + + One of the global arrays of filters was only used in a test that + required both encoders and decoders to be configured in the build. + + tests/test_block_header.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 68e9ef036d18d7c3952bff0b391d5989b86934da +Author: Jia Tan +Date: 2023-01-11 01:08:03 +0800 + + Tests: Fix unused function warning in test_index_hash. + + test_index_hash does not use fill_index_hash() unless both encoders + and decoders are configured in the build. + + tests/test_index_hash.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit a387707cd8cdefbffb5b7429bda4b7fcc192954a +Author: Lasse Collin +Date: 2023-01-10 00:33:14 +0200 + + Windows: Update INSTALL-MSVC.txt to recommend CMake over project files. + + windows/INSTALL-MSVC.txt | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +commit 52902ad69518255a14b0144f0a2379e06fde5b6e +Author: Lasse Collin +Date: 2023-01-10 12:47:16 +0200 + + Revert "liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022)." + + This reverts commit 36edc65ab4cf10a131f239acbd423b4510ba52d5. + + It was reported that it wasn't a good enough fix and MSVC + still produced (different kind of) bad code when building + for 32-bit x86 if optimizations are enabled. + + Thanks to Iouri Kharon. + + src/liblzma/check/crc64_fast.c | 6 ------ + 1 file changed, 6 deletions(-) + +commit e81b9fc48ca70f9228308d3f1871cd81f9a5a496 +Author: Lasse Collin +Date: 2023-01-10 10:05:13 +0200 + + sysdefs.h: Fix a comment. + + src/common/sysdefs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6e89ab58b031aa046308a0b3504ff0a5be042571 +Author: Lasse Collin +Date: 2023-01-10 10:04:06 +0200 + + sysdefs.h: Don't include memory.h anymore even if it were available. + + It quite probably was never needed, that is, any system where memory.h + was required likely couldn't compile XZ Utils for other reasons anyway. + + XZ Utils 5.2.6 and later source packages were generated using + Autoconf 2.71 which no longer defines HAVE_MEMORY_H. So the code + being removed is no longer used anyway. + + src/common/sysdefs.h | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit 65c59ad429aa59f9df0326d9fc82931ba4a9d123 +Author: Lasse Collin +Date: 2023-01-10 08:50:26 +0200 + + CMake/Windows: Add a workaround for windres from GNU binutils. + + This is combined from the following commits in the master branch: + 443dfebced041adc88f10d824188eeef5b5821a9 + 6b117d3b1fe91eb26d533ab16a2e552f84148d47 + 5e34774c31d1b7509b5cb77a3be9973adec59ea0 + + Thanks to Iouri Kharon for the bug report, the original patch, + and testing. + + CMakeLists.txt | 32 +++++++++++++++++++++++++++++++- + 1 file changed, 31 insertions(+), 1 deletion(-) + +commit 43521e77acc907863fa4f94aae276366172cb9ee +Author: Lasse Collin +Date: 2023-01-06 22:53:38 +0200 + + Tests: test_filter_flags: Clean up minor issues. + + Here are the list of the most significant issues addressed: + - Avoid using internal common.h header. It's not good to copy the + constants like this but common.h cannot be included for use outside + of liblzma. This is the quickest thing to do that could be fixed later. + + - Omit the INIT_FILTER macro. Initialization should be done with just + regular designated initializers. + + - Use start_offset = 257 for BCJ tests. It demonstrates that Filter + Flags encoder and decoder don't validate the options thoroughly. + 257 is valid only for the x86 filter. This is a bit silly but + not a significant problem in practice because the encoder and + decoder initialization functions will catch bad alignment still. + Perhaps this should be fixed but it's not urgent and doesn't need + to be in 5.4.x. + + - Various tweaks to comments such as filter id -> Filter ID + + tests/test_filter_flags.c | 153 +++++++++++++++++++++++----------------------- + 1 file changed, 78 insertions(+), 75 deletions(-) + +commit 6b44cead95d767414272dc3a67898a36bfdf95b3 +Author: Jia Tan +Date: 2022-12-29 23:33:33 +0800 + + Tests: Refactors existing filter flags tests. + + Converts the existing filter flags tests into tuktests. + + tests/test_filter_flags.c | 655 ++++++++++++++++++++++++++++++++-------------- + 1 file changed, 457 insertions(+), 198 deletions(-) + +commit 1bbefa9659b202ba31bd244a9d0e4f0d37ff3ed7 +Author: Lasse Collin +Date: 2023-01-08 00:32:29 +0200 + + Tests: tuktest.h: Support tuktest_malloc(0). + + It's not needed in XZ Utils at least for now. It's good to support + it still because if such use is needed later, it wouldn't be + caught on GNU/Linux since malloc(0) from glibc returns non-NULL. + + tests/tuktest.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ce3a3fbc7c2c399aeed644d54f3bd56ac914dfee +Author: Lasse Collin +Date: 2023-01-07 21:57:11 +0200 + + CMake: Update cmake_minimum_required from 3.13...3.16 to 3.13...3.25. + + The changes listed on cmake-policies(7) for versions 3.17 to 3.25 + shouldn't affect this project. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 99fcd57f2ea35eaa94e09f674d5364329c880fa2 +Author: Lasse Collin +Date: 2023-01-08 00:24:23 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit c0c13d9d82eb8a4302c8bbb8b4c5178d285fe9ab +Author: Lasse Collin +Date: 2023-01-07 19:50:35 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 3d45987451b1c3bb42697b29341824c0e5484cba +Author: Lasse Collin +Date: 2023-01-09 11:27:24 +0200 + + CMake: Fix a copypaste error in xzdec Windows resource file handling. + + It was my mistake. Thanks to Iouri Kharon for the bug report. + + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 706bce5018d7cf83094e13454a0731169ec119b5 +Author: Lasse Collin +Date: 2023-01-07 19:50:03 +0200 + + CMake/Windows: Add resource files to xz.exe and xzdec.exe. + + The command line tools cannot be built with MSVC for now but + they can be built with MinGW-w64. + + Thanks to Iouri Kharon for the bug report and the original patch. + + CMakeLists.txt | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit e96dee55df04113c33b387ccdb6cb70935422d91 +Author: Lasse Collin +Date: 2023-01-09 12:22:05 +0200 + + liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022). + + I haven't tested with MSVC myself and there doesn't seem to be + information about the problem online, so I'm relying on the bug report. + + Thanks to Iouri Kharon for the bug report and the patch. + + src/liblzma/check/crc64_fast.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 52bc1ee34dda9bb6fb40175e5952863066681b77 +Author: Lasse Collin +Date: 2023-01-07 19:31:15 +0200 + + Build: Require that _mm_set_epi64x() is usable to enable CLMUL support. + + VS2013 doesn't have _mm_set_epi64x() so this way CLMUL gets + disabled with VS2013. + + Thanks to Iouri Kharon for the bug report. + + CMakeLists.txt | 3 ++- + configure.ac | 8 ++++++-- + 2 files changed, 8 insertions(+), 3 deletions(-) + +commit bad44cfe19e8be8ae76755369be2a34abcd2b4fa +Author: Jia Tan +Date: 2022-12-29 00:25:18 +0800 + + Tests: Creates test_index_hash.c + + Tests all API functions exported from index_hash.h. Does not have a + dedicated test for lzma_index_hash_end. + + [Minor edits were made by Lasse Collin.] + + .gitignore | 1 + + CMakeLists.txt | 2 + + tests/Makefile.am | 3 + + tests/test_index_hash.c | 388 ++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 394 insertions(+) + +commit 692ccdf5516dfe55fb6e9c5cdfb31f4c02c1ecd1 +Author: Jia Tan +Date: 2023-01-05 20:57:25 +0800 + + liblzma: Remove common.h include from common/index.h. + + common/index.h is needed by liblzma internally and tests. common.h will + include and define many things that are not needed by the tests. + + Also, this prevents include order problems because both common.h and + lzma.h define LZMA_API. On most platforms it results only in a warning + but on Windows it would break the build as the definition in common.h + must be used only for building liblzma itself. + + src/liblzma/common/index.c | 1 + + src/liblzma/common/index.h | 9 +++++++-- + src/liblzma/common/index_decoder.h | 1 + + src/liblzma/common/stream_buffer_encoder.c | 1 + + 4 files changed, 10 insertions(+), 2 deletions(-) + +commit 2ac7bafc8f07c1edefe96a4a7a040ddfff0eb5bb +Author: Jia Tan +Date: 2022-08-17 20:20:16 +0800 + + liblzma: Add NULL check to lzma_index_hash_append. + + This is for consistency with lzma_index_append. + + src/liblzma/common/index_hash.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit db714d30e0c74d1dd4af1a23ed62b44e0e8e4efc +Author: Jia Tan +Date: 2022-08-17 17:59:51 +0800 + + liblzma: Replaced hardcoded 0x0 index indicator byte with macro + + src/liblzma/common/index.h | 3 +++ + src/liblzma/common/index_decoder.c | 2 +- + src/liblzma/common/index_encoder.c | 2 +- + src/liblzma/common/index_hash.c | 2 +- + src/liblzma/common/stream_decoder.c | 3 ++- + src/liblzma/common/stream_decoder_mt.c | 2 +- + 6 files changed, 9 insertions(+), 5 deletions(-) + +commit 39d2585dcd3e827cfc3c46025ab6708c4aeb36c6 +Author: Jia Tan +Date: 2023-01-06 20:43:31 +0800 + + Style: Change #if !defined() to #ifndef in mythread.h. + + src/common/mythread.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3f0130aa288e4ed57ace609517db9700a41223af +Author: Jia Tan +Date: 2023-01-06 20:35:55 +0800 + + Build: Add missing stream_decoder_mt.c to .vcxproj files. + + The line in the .vcxproj files for building with was missing in 5.4.0. + Thank to Hajin Jang for reporting the issue. + + windows/vs2013/liblzma.vcxproj | 1 + + windows/vs2013/liblzma_dll.vcxproj | 1 + + windows/vs2017/liblzma.vcxproj | 1 + + windows/vs2017/liblzma_dll.vcxproj | 1 + + windows/vs2019/liblzma.vcxproj | 1 + + windows/vs2019/liblzma_dll.vcxproj | 1 + + 6 files changed, 6 insertions(+) + +commit f204d1050a515d17851eed9049862ce5a9c729c1 +Author: Lasse Collin +Date: 2023-01-04 22:40:54 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 34a9c2d650d6c30bd88e1b21910dd863209aa884 +Author: Lasse Collin +Date: 2023-01-04 18:40:28 +0200 + + Tests: Adjust style in test_compress.sh. + + tests/test_compress.sh | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +commit 761c208d58e0c3daa0f46e68b406adfc318d2a46 +Author: Jia Tan +Date: 2023-01-04 23:58:58 +0800 + + Tests: Replace non portable shell parameter expansion + + The shell parameter expansion using # and ## is not supported in + Solaris 10 Bourne shell (/bin/sh). Even though this is POSIX, it is not fully + portable, so we should avoid it. + + tests/create_compress_files.c | 2 +- + tests/test_compress.sh | 20 +++++++++++++------- + tests/test_compress_prepared_bcj_sparc | 2 +- + tests/test_compress_prepared_bcj_x86 | 2 +- + 4 files changed, 16 insertions(+), 10 deletions(-) + +commit 8a7cbc074547e55e57f4f3696f69bedeb05e14c4 +Author: Jia Tan +Date: 2023-01-03 21:02:38 +0800 + + Translations: Add Korean translation of man pages. + + Thanks to Seong-ho Cho + + po4a/ko.po | 5552 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po4a/po4a.conf | 2 +- + 2 files changed, 5553 insertions(+), 1 deletion(-) + +commit ca2af49bb8be5995eb0e6a3abf457622626d49a7 +Author: Jia Tan +Date: 2023-01-03 20:47:27 +0800 + + Translations: Update the Esperanto translation. + + po/eo.po | 620 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 332 insertions(+), 288 deletions(-) + +commit bfba3394aed03311fe9a746d3141b2e16d8b9325 +Author: Lasse Collin +Date: 2023-01-02 17:05:07 +0200 + + Build: Fix config.h comments. + + configure.ac | 2 +- + m4/tuklib_progname.m4 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 507648ad114c2ae0cd6d181063e1ac07e8106718 +Author: Jia Tan +Date: 2023-01-02 22:33:48 +0800 + + Build: Only define HAVE_PROGRAM_INVOCATION_NAME if it is set to 1. + + HAVE_DECL_PROGRAM_INVOCATION_NAME is renamed to + HAVE_PROGRAM_INVOCATION_NAME. Previously, + HAVE_DECL_PROGRAM_INVOCATION_NAME was always set when + building with autotools. CMake would only set this when it was 1, and the + dos/config.h did not define it. The new macro definition is consistent + across build systems. + + cmake/tuklib_progname.cmake | 5 ++--- + m4/tuklib_progname.m4 | 5 ++++- + src/common/tuklib_progname.c | 2 +- + src/common/tuklib_progname.h | 2 +- + 4 files changed, 8 insertions(+), 6 deletions(-) + +commit ab5229d32adfec1f3fbc95228d9dd6f560732ab5 +Author: Lasse Collin +Date: 2022-12-30 20:10:08 +0200 + + Tests: test_check: Test corner cases of CLMUL CRC64. + + tests/test_check.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 8791826f31733fda0a13b411c2ed930faaeb25aa +Author: Lasse Collin +Date: 2022-12-30 19:36:49 +0200 + + Tests: Clarify a comment in test_lzip_decoder.c. + + tests/test_lzip_decoder.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit c410d812ea12bfc74f6b727c1a799478c79f19ca +Author: Jia Tan +Date: 2022-12-29 01:55:19 +0800 + + xz: Includes and conditionally in mytime.c. + + Previously, mytime.c depended on mythread.h for to be included. + + src/xz/mytime.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 501c6013d4a59fae5d4368e9657c4885493db809 +Author: Jia Tan +Date: 2022-12-29 01:15:27 +0800 + + liblzma: Includes sys/time.h conditionally in mythread + + Previously, was always included, even if mythread only used + clock_gettime. is still needed even if clock_gettime is not used + though because struct timespec is needed for mythread_condtime. + + src/common/mythread.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 9e3cb514b5b95bd235dcdff3db4436f57444ee4f +Author: Jia Tan +Date: 2022-12-29 01:10:53 +0800 + + Build: No longer require HAVE_DECL_CLOCK_MONOTONIC to always be set. + + Previously, if threading was enabled HAVE_DECL_CLOCK_MONOTONIC would always + be set to 0 or 1. However, this macro was needed in xz so if xz was not + built with threading and HAVE_DECL_CLOCK_MONOTONIC was not defined but + HAVE_CLOCK_GETTIME was, it caused a warning during build. Now, + HAVE_DECL_CLOCK_MONOTONIC has been renamed to HAVE_CLOCK_MONOTONIC and + will only be set if it is 1. + + CMakeLists.txt | 8 +++----- + configure.ac | 5 ++++- + src/common/mythread.h | 4 ++-- + src/xz/mytime.c | 5 ++--- + 4 files changed, 11 insertions(+), 11 deletions(-) + +commit 6fc3e5467911572fa9af4021ea46396261aae796 +Author: Jia Tan +Date: 2022-12-28 01:14:07 +0800 + + Translations: Add Ukrainian translations of man pages. + + Thanks to Yuri Chornoivan + + po4a/po4a.conf | 2 +- + po4a/uk.po | 3676 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 3677 insertions(+), 1 deletion(-) + +commit e84f2ab7f8bc38cd8f8befa0bb398656c3c11f8e +Author: Jia Tan +Date: 2022-12-22 23:14:53 +0800 + + liblzma: Update documentation for lzma_filter_encoder. + + src/liblzma/common/filter_encoder.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit b14b8dbba9a3b232787ae218b46430b9246383dd +Author: Jia Tan +Date: 2022-12-21 21:12:03 +0800 + + Tests: Adds lzip decoder tests + + .gitignore | 1 + + tests/Makefile.am | 2 + + tests/test_lzip_decoder.c | 471 ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 474 insertions(+) + +commit 09a114805e1d4f9a02a06cee7dbf2f5014d1f710 +Author: Jia Cheong Tan +Date: 2022-12-20 22:05:21 +0800 + + Doxygen: Update .gitignore for generating docs for in source build. + + In source builds are not recommended, but we should still ignore + the generated artifacts. + + .gitignore | 2 ++ + 1 file changed, 2 insertions(+) + +commit d3e6fe44196bf9478ad193522e2b48febf2eca6b +Author: Jia Tan +Date: 2022-12-20 20:46:44 +0800 + + liblzma: Fix lzma_microlzma_encoder() return value. + + Using return_if_error on lzma_lzma_lclppb_encode was improper because + return_if_error is expecting an lzma_ret value, but + lzma_lzma_lclppb_encode returns a boolean. This could result in + lzma_microlzma_encoder, which would be misleading for applications. + + src/liblzma/common/microlzma_encoder.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit b55a27b46f52524a4a8d9cdef03e6689cefc1375 +Author: Lasse Collin +Date: 2022-12-16 18:30:02 +0200 + + liblzma: Update authors list in arm64.c. + + src/liblzma/simple/arm64.c | 1 + + 1 file changed, 1 insertion(+) + +commit 2fd28d2b7cec3468324a6f15eff7e73c285b1d7d +Author: Jia Tan +Date: 2022-12-16 20:58:55 +0800 + + CMake: Update .gitignore for CMake artifacts from in source build. + + In source builds are not recommended, but we can make it easier + by ignoring the generated artifacts from CMake. + + .gitignore | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +commit b69da6d4bb6bb11fc0cf066920791990d2b22a06 +Author: Lasse Collin +Date: 2022-12-13 20:37:17 +0200 + + Bump version to 5.4.0 and soname to 5.4.0. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 6 +++--- + src/liblzma/liblzma_generic.map | 2 +- + src/liblzma/liblzma_linux.map | 2 +- + 4 files changed, 6 insertions(+), 6 deletions(-) + +commit 20869eb3fb280ff4f271ef527b12b6bf68b05e19 +Author: Lasse Collin +Date: 2022-12-13 20:29:39 +0200 + + Update INSTALL: CMake on Windows isn't experimental anymore. + + Using CMake to build liblzma should work on a few other OSes + but building the command line tools is still subtly broken. + + It is known that shared library versioning may differ between + CMake and Libtool builds on some OSes, most notably Darwin. + + INSTALL | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit cbbd84451944e3e8c63acfaa3c923f6d8aff7852 +Author: Lasse Collin +Date: 2022-12-13 19:47:53 +0200 + + Add NEWS for 5.4.0. + + NEWS | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 202 insertions(+) + +commit c3e94d37e8d10a3e96019864b6f5d7b578db2c14 +Author: Lasse Collin +Date: 2022-12-13 17:41:20 +0200 + + Fix a typo in NEWS. + + NEWS | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0d2a2e0a545c3da2b3e9500f1e531eb903087245 +Author: Lasse Collin +Date: 2022-12-13 17:41:03 +0200 + + Add NEWS for 5.2.10. + + NEWS | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 177ece1c8eb007188fb1b04eff09ca2193fbdea6 +Author: Lasse Collin +Date: 2022-12-13 12:30:45 +0200 + + Tests: Fix a typo in tests/files/README. + + tests/files/README | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 60f45bdbaa6b07558b3f4baac285739b0c6342f5 +Author: Lasse Collin +Date: 2022-12-13 12:30:09 +0200 + + Tests: Add two ARM64 test files. + + tests/files/README | 7 +++++++ + tests/files/good-1-arm64-lzma2-1.xz | Bin 0 -> 512 bytes + tests/files/good-1-arm64-lzma2-2.xz | Bin 0 -> 488 bytes + tests/test_files.sh | 5 +++++ + 4 files changed, 12 insertions(+) + +commit f5e419550619c548c7c35d7e367cf00580a56521 +Author: Lasse Collin +Date: 2022-12-12 22:44:21 +0200 + + Translations: Update the Catalan translation. + + po/ca.po | 657 +++++++++++++++++++++++++++++---------------------------------- + 1 file changed, 306 insertions(+), 351 deletions(-) + +commit 0fb9d355da3789b1757040af475b4e6bbc8b8af8 +Author: Lasse Collin +Date: 2022-12-12 19:18:12 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit e5b6c161c61a37c54dcb76a99bbb83ac4abe02dc +Author: Lasse Collin +Date: 2022-12-12 19:07:58 +0200 + + Update AUTHORS. + + AUTHORS | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit f2d98e691099d82054d5f3071ef6f5e809932e44 +Author: Lasse Collin +Date: 2022-12-12 15:31:14 +0200 + + Docs: Omit multi-threaded decompress from TODO. + + The TODO file outdated still. + + TODO | 2 -- + 1 file changed, 2 deletions(-) + +commit b42908c42a4cc091db45a7e5ba0e0ecceaa3f6da +Author: Lasse Collin +Date: 2022-12-11 21:16:09 +0200 + + Docs: Update xz-file-format.txt to 1.1.0 for ARM64 filter. + + doc/xz-file-format.txt | 29 ++++++++++++++++++++++------- + 1 file changed, 22 insertions(+), 7 deletions(-) + +commit 854f2f5946b353cb0963fd6dfd54d363adc89b9f +Author: Lasse Collin +Date: 2022-12-11 21:13:57 +0200 + + xz: Rename --experimental-arm64 to --arm64. + + src/xz/args.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 31dbd1e5fb65831915a7bbb531c3f19aea8d57a5 +Author: Lasse Collin +Date: 2022-12-11 21:13:06 +0200 + + liblzma: Change LZMA_FILTER_ARM64 to the official Filter ID 0x0A. + + src/liblzma/api/lzma/bcj.h | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +commit 01b3549e523edac899ec4925b282ceddd20da116 +Author: Lasse Collin +Date: 2022-12-08 19:24:22 +0200 + + xz: Make args_info.files_name a const pointer. + + src/xz/args.c | 2 +- + src/xz/args.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit bc665b84ea6bf7946394a08122177efe41b26a5f +Author: Lasse Collin +Date: 2022-12-08 19:18:16 +0200 + + xz: Don't modify argv[]. + + The code that parses --memlimit options and --block-list modified + the argv[] when parsing the option string from optarg. This was + visible in "ps auxf" and such and could be confusing. I didn't + understand it back in the day when I wrote that code. Now a copy + is allocated when modifiable strings are needed. + + src/xz/args.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +commit a13064e1c290de7933db72b6dffbd65cfce59c9f +Author: Lasse Collin +Date: 2022-12-08 18:18:57 +0200 + + Translations: Update the German man page translations. + + po4a/de.po | 4570 ++++++++++++++++++------------------------------------------ + 1 file changed, 1374 insertions(+), 3196 deletions(-) + +commit 8bdbe42a8d0d75dff70206b923fc4bce5c69a40a +Author: Jia Tan +Date: 2022-12-06 23:05:56 +0800 + + Translations: Update the German translation. + + po/de.po | 586 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 315 insertions(+), 271 deletions(-) + +commit 5c304b57c24ef40ff57f864301065f0244c05bde +Author: Jia Tan +Date: 2022-12-06 23:04:25 +0800 + + Translations: Update the Turkish translation. + + po/tr.po | 221 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 108 insertions(+), 113 deletions(-) + +commit 6d86781fdb937970486500447ebb49b98244235b +Author: Jia Tan +Date: 2022-12-06 23:02:11 +0800 + + Translations: Update the Croatian translation. + + po/hr.po | 228 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 113 insertions(+), 115 deletions(-) + +commit 7a5b4b8075eb36026b1796f04ffed5830c42396a +Author: Jia Tan +Date: 2022-12-06 22:56:30 +0800 + + Translations: Add Romanian translation of man pages. + + Thanks to Remus-Gabriel Chelu. + + po4a/po4a.conf | 2 +- + po4a/ro.po | 3692 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 3693 insertions(+), 1 deletion(-) + +commit c6977e7400088177556e8771bcb839eb7d90caa3 +Author: Jia Tan +Date: 2022-12-06 22:52:13 +0800 + + Translations: Update the Romanian translation. + + po/ro.po | 294 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 147 insertions(+), 147 deletions(-) + +commit ac2a747e939c2cbccff7a49c399769af5e02d2ab +Author: Lasse Collin +Date: 2022-12-08 17:30:09 +0200 + + liblzma: Check for unexpected NULL pointers in block_header_decode(). + + The API docs gave an impression that such checks are done + but they actually weren't done. In practice it made little + difference since the calling code has a bug if these are NULL. + + Thanks to Jia Tan for the original patch that checked for + block->filters == NULL. + + src/liblzma/common/block_header_decoder.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 24790f49ae66938c1c7574315e1c0aba1ed5ed25 +Author: Lasse Collin +Date: 2022-12-01 20:59:32 +0200 + + Bump version number for 5.3.5beta. + + This also sorts the symbol names alphabetically in liblzma_*.map. + + src/liblzma/api/lzma/version.h | 4 ++-- + src/liblzma/liblzma_generic.map | 10 +++++----- + src/liblzma/liblzma_linux.map | 10 +++++----- + 3 files changed, 12 insertions(+), 12 deletions(-) + +commit 7e53c5bcb3c2c17f47c096c06ff6b1481e6ecafa +Author: Lasse Collin +Date: 2022-12-01 20:57:26 +0200 + + Add NEWS for 5.3.5beta. + + NEWS | 43 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit 5865f2aaac326fcbd9f8a7d62defa230e4cb644e +Author: Lasse Collin +Date: 2022-12-01 20:57:09 +0200 + + Update THANKS. + + THANKS | 3 +++ + 1 file changed, 3 insertions(+) + +commit 62b270988ec67314d69976df484d2974c6eacfda +Author: Lasse Collin +Date: 2022-12-01 20:04:17 +0200 + + liblzma: Use __has_attribute(__symver__) to fix Clang detection. + + If someone sets up Clang to define __GNUC__ to 10 or greater + then symvers broke. __has_attribute is supported by such GCC + and Clang versions that don't support __symver__ so this should + be much better and simpler way to detect if __symver__ is + actually supported. + + Thanks to Tomasz Gajc for the bug report. + + src/liblzma/common/common.h | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +commit f9ca7d45162664ddd9fb70e19335c2426e5d75bb +Author: Lasse Collin +Date: 2022-12-01 18:51:52 +0200 + + liblzma: Omit zero-skipping from ARM64 filter. + + It has some complicated downsides and its usefulness is more limited + than I originally thought. So this change is bad for certain very + specific situations but a generic solution that works for other + filters (and is otherwise better too) is planned anyway. And this + way 7-Zip can use the same compatible filter for the .7z format. + + This is still marked as experimental with a new temporary Filter ID. + + src/liblzma/api/lzma/bcj.h | 2 +- + src/liblzma/simple/arm64.c | 81 +++++++++++++--------------------------------- + 2 files changed, 24 insertions(+), 59 deletions(-) + +commit 5baec3f0a9c85e6abf45c0f652f699b074129a8b +Author: Lasse Collin +Date: 2022-12-01 18:13:27 +0200 + + xz: Omit the special notes about ARM64 filter on the man page. + + src/xz/xz.1 | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 0c3627b51862eb0dcdd4fc283d046250571991c6 +Author: Lasse Collin +Date: 2022-12-01 18:12:03 +0200 + + liblzma: Don't be over-specific in lzma_str_to_filters API doc. + + src/liblzma/api/lzma/filter.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 94adf057f27b1970f493dc99cd166407d7255639 +Author: Lasse Collin +Date: 2022-12-01 17:54:23 +0200 + + liblzma: Silence unused variable warning when BCJ filters are disabled. + + Thanks to Jia Tan for the original patch. + + src/liblzma/common/string_conversion.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit c68af4441744e5ffc41a472e1be9c9d53a1d9780 +Author: Lasse Collin +Date: 2022-12-01 17:38:03 +0200 + + Translations: Update the Chinese (simplified) translation. + + po/zh_CN.po | 608 ++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 348 insertions(+), 260 deletions(-) + +commit 3be6942e5c27d29995d41da52fbe274e4ce4a537 +Author: Lasse Collin +Date: 2022-11-30 18:55:03 +0200 + + Add NEWS for 5.2.9. + + NEWS | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 7c16e312cb2f40b81154c0e5be13a3c6b8da485d +Author: Jia Tan +Date: 2022-11-30 23:33:08 +0800 + + xz: Remove message_filters_to_str function prototype from message.h. + + This was forgotten from 7484744af6cbabe81e92af7d9e061dfd597fff7b. + + src/xz/message.h | 16 ---------------- + 1 file changed, 16 deletions(-) + +commit 764955e2d4f2a5e8d6d6fec63af694f799e050e7 +Author: Lasse Collin +Date: 2022-11-30 18:08:34 +0200 + + Change the bug report address. + + It forwards to me and Jia Tan. + + Also update the IRC reference in README as #tukaani was moved + to Libera Chat long ago. + + CMakeLists.txt | 2 +- + README | 11 +++++------ + configure.ac | 2 +- + dos/config.h | 2 +- + windows/README-Windows.txt | 2 +- + 5 files changed, 9 insertions(+), 10 deletions(-) + +commit c21983c76031e01da01ad3c6cc716fe4b8a75070 +Author: Lasse Collin +Date: 2022-11-30 17:50:17 +0200 + + Build: Add string_conversion.c to CMake, DOS, and VS files. + + CMakeLists.txt | 1 + + dos/Makefile | 1 + + windows/vs2013/liblzma.vcxproj | 1 + + windows/vs2013/liblzma_dll.vcxproj | 1 + + windows/vs2017/liblzma.vcxproj | 1 + + windows/vs2017/liblzma_dll.vcxproj | 1 + + windows/vs2019/liblzma.vcxproj | 1 + + windows/vs2019/liblzma_dll.vcxproj | 1 + + 8 files changed, 8 insertions(+) + +commit 30be0c35d24eb5175459d69dbf7d92e2b087ef82 +Author: Lasse Collin +Date: 2022-11-30 17:38:32 +0200 + + Update to HTTPS URLs in AUTHORS. + + AUTHORS | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 0a72b9ca2fe20082da9b7128fe0d908af947a851 +Author: Jia Tan +Date: 2022-11-30 00:52:06 +0800 + + liblzma: Improve documentation for string to filter functions. + + src/liblzma/api/lzma/filter.h | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +commit a6e21fcede3b196160a52dd294d965c508a4bb33 +Author: Lasse Collin +Date: 2022-11-29 22:27:42 +0200 + + liblzma: Two fixes to lzma_str_list_filters() API docs. + + Thanks to Jia Tan. + + src/liblzma/api/lzma/filter.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 7484744af6cbabe81e92af7d9e061dfd597fff7b +Author: Lasse Collin +Date: 2022-11-28 21:57:47 +0200 + + xz: Use lzma_str_from_filters(). + + Two uses: Displaying encoder filter chain when compressing with -vv, + and displaying the decoder filter chain in --list -vv. + + src/xz/list.c | 28 ++++++--- + src/xz/message.c | 175 +++---------------------------------------------------- + 2 files changed, 28 insertions(+), 175 deletions(-) + +commit cedeeca2ea6ada5b0411b2ae10d7a859e837f203 +Author: Lasse Collin +Date: 2022-11-28 21:37:48 +0200 + + liblzma: Add lzma_str_to_filters, _from_filters, and _list_filters. + + lzma_str_to_filters() uses static error messages which makes + them not very precise. It tells the position in the string + where an error occurred though which helps quite a bit if + applications take advantage of it. Dynamic error messages can + be added later with a new flag if it seems important enough. + + src/liblzma/api/lzma/filter.h | 258 +++++++ + src/liblzma/common/Makefile.inc | 1 + + src/liblzma/common/string_conversion.c | 1302 ++++++++++++++++++++++++++++++++ + src/liblzma/liblzma_generic.map | 3 + + src/liblzma/liblzma_linux.map | 3 + + 5 files changed, 1567 insertions(+) + +commit 072ebf7b1335421193ffa9d4a70d5533786b8995 +Author: Lasse Collin +Date: 2022-11-28 21:02:19 +0200 + + liblzma: Make lzma_validate_chain() available outside filter_common.c. + + src/liblzma/common/filter_common.c | 8 ++++---- + src/liblzma/common/filter_common.h | 3 +++ + 2 files changed, 7 insertions(+), 4 deletions(-) + +commit 5f22bd2d37e3bd01a5d701b51750eb51f09c11bf +Author: Lasse Collin +Date: 2022-11-28 10:51:03 +0200 + + liblzma: Remove lzma_lz_decoder_uncompressed() as it's now unused. + + src/liblzma/lz/lz_decoder.c | 14 -------------- + src/liblzma/lz/lz_decoder.h | 3 --- + 2 files changed, 17 deletions(-) + +commit cee83206465b95729ab649aa2f57fdbde8dcaf89 +Author: Lasse Collin +Date: 2022-11-28 10:48:53 +0200 + + liblzma: Use LZMA1EXT feature in lzma_microlzma_decoder(). + + Here too this avoids the slightly ugly method to set + the uncompressed size. + + Also moved the setting of dict_size to the struct initializer. + + src/liblzma/common/microlzma_decoder.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit e310e8b6a490dfb468f4ed68feff246d776b323c +Author: Lasse Collin +Date: 2022-11-28 10:28:20 +0200 + + liblzma: Use LZMA1EXT feature in lzma_alone_decoder(). + + This avoids the need to use the slightly ugly method to + set the uncompressed size. + + src/liblzma/common/alone_decoder.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +commit 33b8a24b6646a9dbfd8358405aec466b13078559 +Author: Lasse Collin +Date: 2022-11-27 23:16:21 +0200 + + liblzma: Add LZMA_FILTER_LZMA1EXT to support LZMA1 without end marker. + + Some file formats need support for LZMA1 streams that don't use + the end of payload marker (EOPM) alias end of stream (EOS) marker. + So far liblzma API has supported decompressing such streams via + lzma_alone_decoder() when .lzma header specifies a known + uncompressed size. Encoding support hasn't been available in the API. + + Instead of adding a new LZMA1-only API for this purpose, this commit + adds a new filter ID for use with raw encoder and decoder. The main + benefit of this approach is that then also filter chains are possible, + for example, if someone wants to implement support for .7z files that + use the x86 BCJ filter with LZMA1 (not BCJ2 as that isn't supported + in liblzma). + + src/liblzma/api/lzma/lzma12.h | 123 ++++++++++++++++++++++++++++++-- + src/liblzma/common/filter_common.c | 7 ++ + src/liblzma/common/filter_decoder.c | 6 ++ + src/liblzma/common/filter_encoder.c | 9 +++ + src/liblzma/lzma/lzma2_encoder.c | 2 +- + src/liblzma/lzma/lzma_decoder.c | 26 ++++++- + src/liblzma/lzma/lzma_encoder.c | 40 +++++++++-- + src/liblzma/lzma/lzma_encoder.h | 3 +- + src/liblzma/lzma/lzma_encoder_private.h | 3 + + 9 files changed, 204 insertions(+), 15 deletions(-) + +commit 9a304bf1e45b3ddf61aaeaa7c764915b34618ede +Author: Lasse Collin +Date: 2022-11-27 18:43:07 +0200 + + liblzma: Avoid unneeded use of void pointer in LZMA decoder. + + src/liblzma/lzma/lzma_decoder.c | 3 +-- + src/liblzma/lzma/lzma_decoder.h | 2 +- + 2 files changed, 2 insertions(+), 3 deletions(-) + +commit 218394958c7683f892275bb40eae880620feebcc +Author: Lasse Collin +Date: 2022-11-27 18:20:33 +0200 + + liblzma: Pass the Filter ID to LZ encoder and decoder. + + This allows using two Filter IDs with the same + initialization function and data structures. + + src/liblzma/common/alone_decoder.c | 1 + + src/liblzma/common/alone_encoder.c | 1 + + src/liblzma/common/common.h | 7 +++++-- + src/liblzma/common/lzip_decoder.c | 1 + + src/liblzma/common/microlzma_decoder.c | 1 + + src/liblzma/common/microlzma_encoder.c | 1 + + src/liblzma/lz/lz_decoder.c | 5 +++-- + src/liblzma/lz/lz_decoder.h | 3 ++- + src/liblzma/lz/lz_encoder.c | 5 +++-- + src/liblzma/lz/lz_encoder.h | 3 ++- + src/liblzma/lzma/lzma2_decoder.c | 3 ++- + src/liblzma/lzma/lzma2_encoder.c | 3 ++- + src/liblzma/lzma/lzma_decoder.c | 2 +- + src/liblzma/lzma/lzma_encoder.c | 2 +- + 14 files changed, 26 insertions(+), 12 deletions(-) + +commit 1663c7676b76f4c514031797f3db1896e8100f7f +Author: Lasse Collin +Date: 2022-11-27 01:03:16 +0200 + + liblzma: Remove two FIXME comments. + + src/liblzma/common/filter_encoder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 11fe708db783ac36ebeeb85da164e29e8c300910 +Author: Lasse Collin +Date: 2022-11-26 22:25:30 +0200 + + xz: Use lzma_filters_free(). + + src/xz/list.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit e782af9110d8499c7ac2929bc871540eefea5ea1 +Author: Lasse Collin +Date: 2022-11-26 22:21:13 +0200 + + liblzma: Use lzma_filters_free() in more places. + + src/liblzma/common/block_header_decoder.c | 20 ++------------------ + src/liblzma/common/stream_decoder.c | 4 +--- + src/liblzma/common/stream_decoder_mt.c | 22 +++++----------------- + 3 files changed, 8 insertions(+), 38 deletions(-) + +commit 90caaded2dc6db1d6a55b01160d7e87f4a423628 +Author: Lasse Collin +Date: 2022-11-25 18:04:37 +0200 + + liblzma: Omit simple coder init functions if they are disabled. + + src/liblzma/simple/arm.c | 4 ++++ + src/liblzma/simple/armthumb.c | 4 ++++ + src/liblzma/simple/ia64.c | 4 ++++ + src/liblzma/simple/powerpc.c | 4 ++++ + src/liblzma/simple/sparc.c | 4 ++++ + src/liblzma/simple/x86.c | 4 ++++ + 6 files changed, 24 insertions(+) + +commit 5cd9f0df78cc4f8a7807bf6104adea13034fbb45 +Author: Lasse Collin +Date: 2022-11-24 23:24:59 +0200 + + xz: Allow nice_len 2 and 3 even if match finder requires 3 or 4. + + Now that liblzma accepts these, we avoid the extra check and + there's one message less for translators too. + + src/xz/options.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 3be88ae071371caa279b44e13f4836fb178fe4ae +Author: Lasse Collin +Date: 2022-11-24 23:23:55 +0200 + + liblzma: Allow nice_len 2 and 3 even if match finder requires 3 or 4. + + That is, if the specified nice_len is smaller than the minimum + of the match finder, silently use the match finder's minimum value + instead of reporting an error. The old behavior is annoying to users + and it complicates xz options handling too. + + src/liblzma/lz/lz_encoder.c | 14 +++++++++----- + src/liblzma/lz/lz_encoder.h | 9 +++++++++ + src/liblzma/lzma/lzma_encoder.c | 11 ++++++++--- + 3 files changed, 26 insertions(+), 8 deletions(-) + +commit 93439cfafe1768b3b18d67d2356ef7e7559bba59 +Author: Lasse Collin +Date: 2022-11-24 16:25:10 +0200 + + liblzma: Add lzma_filters_update() support to the multi-threaded encoder. + + A tiny downside of this is that now a 1-4 tiny allocations are made + for every Block because each worker thread needs its own copy of + the filter chain. + + src/liblzma/api/lzma/filter.h | 36 +++++++------ + src/liblzma/common/stream_encoder_mt.c | 96 +++++++++++++++++++++++++++++++--- + 2 files changed, 109 insertions(+), 23 deletions(-) + +commit 17ac51e689794eb41cab3e80946fec689caea2d2 +Author: Lasse Collin +Date: 2022-11-24 14:53:22 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 06824396b2b6c84f3a235cb7c19c2a9701167797 +Author: Lasse Collin +Date: 2022-11-24 14:52:44 +0200 + + Build: Don't put GNU/Linux-specific symbol versions into static liblzma. + + It not only makes no sense to put symbol versions into a static library + but it can also cause breakage. + + By default Libtool #defines PIC if building a shared library and + doesn't define it for static libraries. This is documented in the + Libtool manual. It can be overriden using --with-pic or --without-pic. + configure.ac detects if --with-pic or --without-pic is used and then + gives an error if neither --disable-shared nor --disable-static was + used at the same time. Thus, in normal situations it works to build + both shared and static library at the same time on GNU/Linux, + only --with-pic or --without-pic requires that only one type of + library is built. + + Thanks to John Paul Adrian Glaubitz from Debian for reporting + the problem that occurred on ia64: + https://www.mail-archive.com/xz-devel@tukaani.org/msg00610.html + + CMakeLists.txt | 5 +- + configure.ac | 143 +++++++++++++++++++++++++++++--------------- + src/liblzma/common/common.h | 12 ++++ + 3 files changed, 111 insertions(+), 49 deletions(-) + +commit e1acf7107291f8b3d6d609a7133331ff36d35d14 +Author: Lasse Collin +Date: 2022-11-24 01:32:16 +0200 + + liblzma: Refactor to use lzma_filters_free(). + + lzma_filters_free() sets the options to NULL and ids to + LZMA_VLI_UNKNOWN so there is no need to do it by caller; + the filter arrays will always be left in a safe state. + + Also use memcpy() instead of a loop to copy a filter chain + when it is known to be safe to copy LZMA_FILTERS_MAX + 1 + (even if the elements past the terminator might be uninitialized). + + src/liblzma/common/stream_encoder.c | 16 ++++------------ + src/liblzma/common/stream_encoder_mt.c | 11 ++--------- + 2 files changed, 6 insertions(+), 21 deletions(-) + +commit cb05dbcf8b868441ec805016222f3fd77f1c5caa +Author: Lasse Collin +Date: 2022-11-24 01:26:37 +0200 + + liblzma: Fix another invalid free() after memory allocation failure. + + This time it can happen when lzma_stream_encoder_mt() is used + to reinitialize an existing multi-threaded Stream encoder + and one of 1-4 tiny allocations in lzma_filters_copy() fail. + + It's very similar to the previous bug + 10430fbf3820dafd4eafd38ec8be161a6978ed2b, happening with + an array of lzma_filter structures whose old options are freed + but the replacement never arrives due to a memory allocation + failure in lzma_filters_copy(). + + src/liblzma/common/stream_encoder_mt.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 75f1a6c26df4ce329da0882786403e3ccf5cd898 +Author: Jia Tan +Date: 2022-05-05 20:53:42 +0800 + + liblzma: Add support for LZMA_SYNC_FLUSH in the Block encoder. + + The documentation mentions that lzma_block_encoder() supports + LZMA_SYNC_FLUSH but it was never added to supported_actions[] + in the internal structure. Because of this, LZMA_SYNC_FLUSH could + not be used with the Block encoder unless it was the next coder + after something like stream_encoder() or stream_encoder_mt(). + + src/liblzma/common/block_encoder.c | 1 + + 1 file changed, 1 insertion(+) + +commit d0901645170b638c517f5c50866b6ef48f491c65 +Author: Lasse Collin +Date: 2022-11-24 01:02:50 +0200 + + liblzma: Add new API function lzma_filters_free(). + + This is small but convenient and should have been added + a long time ago. + + src/liblzma/api/lzma/filter.h | 21 +++++++++++++++++++++ + src/liblzma/common/filter_common.c | 26 ++++++++++++++++++++++++++ + src/liblzma/liblzma_generic.map | 1 + + src/liblzma/liblzma_linux.map | 1 + + 4 files changed, 49 insertions(+) + +commit ae1f8a723dcde2f2c5cf444bcbb5fc5026b3c3c5 +Author: Lasse Collin +Date: 2022-11-24 00:02:31 +0200 + + CMake: Don't use symbol versioning with static library. + + CMakeLists.txt | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 48c1b99dc537a27e1ca929d8837e778e5ba32191 +Author: Lasse Collin +Date: 2022-11-23 21:55:22 +0200 + + liblzma: Add lzma_attr_warn_unused_result to lzma_filters_copy(). + + src/liblzma/api/lzma/filter.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 10430fbf3820dafd4eafd38ec8be161a6978ed2b +Author: Lasse Collin +Date: 2022-11-23 21:26:21 +0200 + + liblzma: Fix invalid free() after memory allocation failure. + + The bug was in the single-threaded .xz Stream encoder + in the code that is used for both re-initialization and for + lzma_filters_update(). To trigger it, an application had + to either re-initialize an existing encoder instance with + lzma_stream_encoder() or use lzma_filters_update(), and + then one of the 1-4 tiny allocations in lzma_filters_copy() + (called from stream_encoder_update()) must fail. An error + was correctly reported but the encoder state was corrupted. + + This is related to the recent fix in + f8ee61e74eb40600445fdb601c374d582e1e9c8a which is good but + it wasn't enough to fix the main problem in stream_encoder.c. + + src/liblzma/common/stream_encoder.c | 39 +++++++++++++++++++++++++++++-------- + 1 file changed, 31 insertions(+), 8 deletions(-) + +commit cafd6dc397ca8b5b5f7775e8d6876b8fe70f8e70 +Author: Lasse Collin +Date: 2022-11-22 16:37:15 +0200 + + liblzma: Fix language in a comment. + + src/liblzma/common/stream_encoder.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c392bf8ccba857baaf50399c4b460119befacd54 +Author: Lasse Collin +Date: 2022-11-22 11:20:17 +0200 + + liblzma: Fix infinite loop in LZMA encoder init with dict_size >= 2 GiB. + + The encoder doesn't support dictionary sizes larger than 1536 MiB. + This is validated, for example, when calculating the memory usage + via lzma_raw_encoder_memusage(). It is also enforced by the LZ + part of the encoder initialization. However, LZMA encoder with + LZMA_MODE_NORMAL did an unsafe calculation with dict_size before + such validation and that results in an infinite loop if dict_size + was 2 << 30 or greater. + + src/liblzma/lzma/lzma_encoder.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +commit f50534c973a591ccf65485adfc827a8a7126ca6c +Author: Lasse Collin +Date: 2022-11-21 13:02:33 +0200 + + liblzma: Fix two Doxygen commands in the API headers. + + These were caught by clang -Wdocumentation. + + src/liblzma/api/lzma/hardware.h | 2 +- + src/liblzma/api/lzma/index_hash.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 649d4872ed2f55196114a061d45b416fc4353569 +Author: Lasse Collin +Date: 2022-11-19 19:09:55 +0200 + + xz: Refactor duplicate code from hardware_memlimit_mtenc_get(). + + src/xz/hardware.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d327743bb547a53364e5951a16e5f1663fe4b9ff +Author: Lasse Collin +Date: 2022-11-19 19:06:13 +0200 + + xz: Add support --threads=+N so that -T+1 gives threaded mode. + + src/xz/args.c | 18 +++++++++++++++--- + src/xz/hardware.c | 17 +++++++++++++++-- + src/xz/hardware.h | 1 + + src/xz/xz.1 | 21 ++++++++++++++++++++- + 4 files changed, 51 insertions(+), 6 deletions(-) + +commit a11a2b8b5e830ba682c1d81aaa7078842b296995 +Author: Jia Tan +Date: 2022-11-19 23:18:04 +0800 + + CMake: Adds test_memlimit to CMake tests + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 2af8d9e9b3f44f62d19e7c39297ec63af2e8c64f +Author: Lasse Collin +Date: 2022-11-15 19:10:21 +0200 + + Translations: Update the Korean translation. + + po/ko.po | 652 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 371 insertions(+), 281 deletions(-) + +commit 16ac05677292f7e21a4feaddcfb2ab062ea5f385 +Author: Lasse Collin +Date: 2022-11-15 19:09:28 +0200 + + Translations: Update the Turkish translation. + + po/tr.po | 568 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 310 insertions(+), 258 deletions(-) + +commit b9a67d9a5fa207062d4aa8a01639234609315d31 +Author: Lasse Collin +Date: 2022-11-15 10:58:39 +0200 + + Bump version number for 5.3.4alpha. + + src/liblzma/api/lzma/version.h | 2 +- + src/liblzma/liblzma_generic.map | 2 +- + src/liblzma/liblzma_linux.map | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit 5b999ba289b3280457b7386b9ac65dbbdf1575a5 +Author: Lasse Collin +Date: 2022-11-15 10:54:40 +0200 + + Add NEWS for 5.3.4alpha. + + NEWS | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 96 insertions(+) + +commit ce8db9e37da4f6c87691c5066f51f91f2411c44a +Author: Lasse Collin +Date: 2022-11-15 10:54:08 +0200 + + Add NEWS for 5.2.8. + + NEWS | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +commit b56bc8251d2736224af6bdaaae734ceb8926a879 +Author: Lasse Collin +Date: 2022-11-14 23:19:57 +0200 + + Revert "liblzma: Simple/BCJ filters: Allow disabling generic BCJ options." + + This reverts commit 177bdc922cb17bd0fd831ab8139dfae912a5c2b8 + and also does equivalent change to arm64.c. + + Now that ARM64 filter will use lzma_options_bcj, this change + is not needed anymore. + + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/arm64.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 4 ++-- + src/liblzma/simple/simple_private.h | 2 +- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 3 +-- + 9 files changed, 10 insertions(+), 11 deletions(-) + +commit 8370ec8edf9ddf8d1d9fef03d8d1027503ec4c35 +Author: Lasse Collin +Date: 2022-11-14 23:14:41 +0200 + + Replace the experimental ARM64 filter with a new experimental version. + + This is incompatible with the previous version. + + This has space/tab fixes in filter_*.c and bcj.h too. + + src/liblzma/api/lzma/bcj.h | 41 +----- + src/liblzma/common/filter_common.c | 14 +- + src/liblzma/common/filter_decoder.c | 12 +- + src/liblzma/common/filter_encoder.c | 17 +-- + src/liblzma/simple/arm64.c | 283 ++++++++++++++---------------------- + src/liblzma/simple/simple_decoder.h | 4 - + src/liblzma/simple/simple_encoder.h | 2 - + src/xz/args.c | 2 +- + src/xz/message.c | 13 +- + src/xz/options.c | 39 ----- + src/xz/options.h | 7 - + 11 files changed, 147 insertions(+), 287 deletions(-) + +commit f644473a211394447824ea00518d0a214ff3f7f2 +Author: Lasse Collin +Date: 2022-11-14 21:34:57 +0200 + + liblzma: Add fast CRC64 for 32/64-bit x86 using SSSE3 + SSE4.1 + CLMUL. + + It also works on E2K as it supports these intrinsics. + + On x86-64 runtime detection is used so the code keeps working on + older processors too. A CLMUL-only build can be done by using + -msse4.1 -mpclmul in CFLAGS and this will reduce the library + size since the generic implementation and its 8 KiB lookup table + will be omitted. + + On 32-bit x86 this isn't used by default for now because by default + on 32-bit x86 the separate assembly file crc64_x86.S is used. + If --disable-assembler is used then this new CLMUL code is used + the same way as on 64-bit x86. However, a CLMUL-only build + (-msse4.1 -mpclmul) won't omit the 8 KiB lookup table on + 32-bit x86 due to a currently-missing check for disabled + assembler usage. + + The configure.ac check should be such that the code won't be + built if something in the toolchain doesn't support it but + --disable-clmul-crc option can be used to unconditionally + disable this feature. + + CLMUL speeds up decompression of files that have compressed very + well (assuming CRC64 is used as a check type). It is know that + the CLMUL code is significantly slower than the generic code for + tiny inputs (especially 1-8 bytes but up to 16 bytes). If that + is a real-world problem then there is already a commented-out + variant that uses the generic version for small inputs. + + Thanks to Ilya Kurdyukov for the original patch which was + derived from a white paper from Intel [1] (published in 2009) + and public domain code from [2] (released in 2016). + + [1] https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf + [2] https://github.com/rawrunprotected/crc + + CMakeLists.txt | 26 ++- + INSTALL | 12 ++ + configure.ac | 59 +++++- + src/liblzma/check/crc64_fast.c | 449 +++++++++++++++++++++++++++++++++++++++- + src/liblzma/check/crc64_table.c | 21 +- + 5 files changed, 554 insertions(+), 13 deletions(-) + +commit 3b466bc79672bb2b06d1245a500588e6026e0ba0 +Author: Lasse Collin +Date: 2022-11-14 20:14:34 +0200 + + Translations: Update the Swedish translation one more time. + + po/sv.po | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit e963379a8622ebdff6ce78e76b803bcd1e1d16d6 +Author: Lasse Collin +Date: 2022-11-14 19:34:15 +0200 + + Translations: Update the Swedish translation again. + + po/sv.po | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit a4bc689a823a2254f29ac9d233170add5121b307 +Author: Lasse Collin +Date: 2022-11-14 19:07:45 +0200 + + Translations: Update the Swedish translation. + + po/sv.po | 671 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 382 insertions(+), 289 deletions(-) + +commit bbf2073d824ab4ba33bed4b77f467435abd333a5 +Author: Lasse Collin +Date: 2022-11-14 18:58:09 +0200 + + Translations: Update the Ukrainian translation. + + po/uk.po | 618 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 354 insertions(+), 264 deletions(-) + +commit ac10b1b3622e70881595586edfb8a3ebdcd76bb6 +Author: Lasse Collin +Date: 2022-11-14 17:58:07 +0200 + + Build: Omit x86_64 from --enable-assembler. + + It didn't do anything. There are only 32-bit x86 assembly files + and it feels likely that new files won't be added as intrinsics + in C are more portable across toolchains and OSes. + + configure.ac | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit eb0f1450ad9f23dac03050d9c8375980240aee21 +Author: Lasse Collin +Date: 2022-11-14 16:00:52 +0200 + + liblzma: Use __attribute__((__constructor__)) if available. + + This uses it for CRC table initializations when using --disable-small. + It avoids mythread_once() overhead. It also means that then + --disable-small --disable-threads is thread-safe if this attribute + is supported. + + CMakeLists.txt | 15 +++++++++++++++ + INSTALL | 4 +++- + configure.ac | 31 ++++++++++++++++++++++++++++--- + src/liblzma/check/crc32_small.c | 7 +++++++ + src/liblzma/check/crc64_small.c | 5 +++++ + src/liblzma/lz/lz_encoder.c | 2 +- + 6 files changed, 59 insertions(+), 5 deletions(-) + +commit 6553f49b11dafad35c73b05f12e14865ea1fd8a1 +Author: Lasse Collin +Date: 2022-11-12 21:19:52 +0200 + + Translations: Update the Romanian translation. + + po/ro.po | 651 +++++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 380 insertions(+), 271 deletions(-) + +commit db97e69e12393becc29f8febd53133d0d36989bd +Author: Lasse Collin +Date: 2022-11-12 21:17:45 +0200 + + Translations: Update the Hungarian translation. + + po/hu.po | 625 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 357 insertions(+), 268 deletions(-) + +commit 2bbb9c0f3829a8b121b36998d273a6c6f92000f4 +Author: Lasse Collin +Date: 2022-11-11 17:58:57 +0200 + + Translations: Update the Finnish translation. + + po/fi.po | 610 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 348 insertions(+), 262 deletions(-) + +commit 3c8cbb8137b6f8ed9416c1209d73cdbcb015251f +Author: Lasse Collin +Date: 2022-11-11 17:58:18 +0200 + + Translations: Update the Croatian translation. + + po/hr.po | 680 +++++++++++++++++++++++++++++++++++---------------------------- + 1 file changed, 381 insertions(+), 299 deletions(-) + +commit 26c3359eac0988d6f3986735cd1363bec1678e8e +Author: Lasse Collin +Date: 2022-11-11 17:57:18 +0200 + + Translations: Update the Polish translation. + + po/pl.po | 569 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 309 insertions(+), 260 deletions(-) + +commit 577e467b137c735afb8de6ae71ac7a73c2960cc4 +Author: Lasse Collin +Date: 2022-11-11 17:56:44 +0200 + + Translations: Update the Spanish translation. + + po/es.po | 598 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 344 insertions(+), 254 deletions(-) + +commit f9b4ff6e9a0f1678650775582d3e4fe782abce97 +Author: Lasse Collin +Date: 2022-11-11 17:16:03 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit a39961ef211e1bf030b17edeea3cff29fe263b67 +Author: Lasse Collin +Date: 2022-11-11 17:15:25 +0200 + + liblzma: Fix building with Intel ICC (the classic compiler). + + It claims __GNUC__ >= 10 but doesn't support __symver__ attribute. + + Thanks to Stephen Sachs. + + src/liblzma/common/common.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c715f683dcb1a817d565da292cddfbceda643e12 +Author: Lasse Collin +Date: 2022-11-11 14:35:58 +0200 + + liblzma: Fix incorrect #ifdef for x86 SSE2 support. + + __SSE2__ is the correct macro for SSE2 support with GCC, Clang, + and ICC. __SSE2_MATH__ means doing floating point math with SSE2 + instead of 387. Often the latter macro is defined if the first + one is but it was still a bug. + + src/liblzma/common/memcmplen.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit bd334ae56afe7f642ad4d0f1ac19e74e82daa1ce +Author: Lasse Collin +Date: 2022-11-11 13:27:06 +0200 + + Add NEWS for 5.2.7 (forgotten cherry-pick from v5.2). + + NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +commit 3c7860cf49de6f81046b3a4034a89f3a4803a576 +Author: Lasse Collin +Date: 2022-11-11 13:16:21 +0200 + + xzdiff: Add support for .lz files. + + The other scripts don't need changes for .lz support because + in those scripts it is enough that xz supports .lz. + + src/scripts/xzdiff.in | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit d76c752a6d77052e5ad57ade555082585f7ac5d8 +Author: Lasse Collin +Date: 2022-11-11 12:23:58 +0200 + + Scripts: Ignore warnings from xz. + + In practice this means making the scripts work when + the input files have an unsupported check type which + isn't a problem in practice unless support for + some check types has been disabled at build time. + + src/scripts/xzdiff.in | 5 +++-- + src/scripts/xzgrep.in | 2 +- + src/scripts/xzless.in | 4 ++-- + src/scripts/xzmore.in | 4 ++-- + 4 files changed, 8 insertions(+), 7 deletions(-) + +commit 6552535afd1fe29d726ab6e68cf14ce3624fd48c +Author: Lasse Collin +Date: 2022-11-10 12:34:43 +0200 + + Translations: Rename poa4/fr_FR.po to po4a/fr.po. + + That's how it is preferred at the Translation Project. + On my system /usr/share/man/fr_FR doesn't contain any + other man pages than XZ Utils while /usr/share/man/fr + has quite a few, so this will fix that too. + + Thanks to Benno Schulenberg from the Translation Project. + + po4a/{fr_FR.po => fr.po} | 0 + po4a/po4a.conf | 2 +- + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 0918159ce4c75bfb60aff0193b559f8a9f41d25a +Author: Lasse Collin +Date: 2022-11-09 18:48:50 +0200 + + xz: Update the man page about BCJ filters, including upcoming --arm64. + + The --arm64 isn't actually implemented yet in the form + described in this commit. + + Thanks to Jia Tan. + + src/xz/xz.1 | 66 +++++++++++++++++++++++++++---------------------------------- + 1 file changed, 29 insertions(+), 37 deletions(-) + +commit ba2ae3596f6be1587495f33b367488f6e00e56f1 +Author: Lasse Collin +Date: 2022-11-09 18:14:14 +0200 + + xz: Add --arm64 to --long-help and omit endianness from ARM(-Thumb). + + Modern 32-bit ARM in big endian mode use little endian for + instruction encoding still, so the filters work on such + executables too. It's likely less confusing for users this way. + + The --arm64 option hasn't been implemented yet (there is + --experimental-arm64 but it's different). The --arm64 option + is added now anyway because this is the likely result and the + strings need to be ready for translators. + + Thanks to Jia Tan. + + src/xz/message.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 802d57d9215d9c81dbee86edb43c9e93a7f7ec55 +Author: Lasse Collin +Date: 2022-11-09 15:12:13 +0200 + + Windows: Update the VS project files for ARM64 and .lz support. + + windows/vs2013/config.h | 9 +++++++++ + windows/vs2013/liblzma.vcxproj | 5 ++++- + windows/vs2013/liblzma_dll.vcxproj | 5 ++++- + windows/vs2017/config.h | 9 +++++++++ + windows/vs2017/liblzma.vcxproj | 3 +++ + windows/vs2017/liblzma_dll.vcxproj | 3 +++ + windows/vs2019/config.h | 9 +++++++++ + windows/vs2019/liblzma.vcxproj | 5 ++++- + windows/vs2019/liblzma_dll.vcxproj | 5 ++++- + 9 files changed, 49 insertions(+), 4 deletions(-) + +commit 5846aeda05972bc803c6094821ae836229ebe691 +Author: Lasse Collin +Date: 2022-11-09 14:57:48 +0200 + + DOS: Update Makefile and config.h to include ARM64 and .lz support. + + dos/Makefile | 2 ++ + dos/config.h | 9 +++++++++ + 2 files changed, 11 insertions(+) + +commit 781da8d6c44de6aa278c916375250668a0b107f2 +Author: Lasse Collin +Date: 2022-11-09 14:45:05 +0200 + + CMake: Add lzip decoder files and #define to the build. + + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +commit df8ad4af65a9c4846b108550d0083770a69dee64 +Author: Lasse Collin +Date: 2022-11-09 14:41:56 +0200 + + Docs: Update INSTALL and also add new prohibited options to PACKAGERS. + + INSTALL | 49 +++++++++++++++++++++++++++++++++++++++++-------- + PACKAGERS | 2 ++ + 2 files changed, 43 insertions(+), 8 deletions(-) + +commit c8ef089c149afaab413c3a51be827dd1d11afe0e +Author: Lasse Collin +Date: 2022-10-20 17:39:06 +0300 + + Tests: Test the .lz files in test_files.sh. + + tests/test_files.sh | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit c8f70ebb4628ceb6cb29cc9195d9deadf69d2bd7 +Author: Lasse Collin +Date: 2022-10-20 15:35:59 +0300 + + Tests: Add .lz (lzip) test files. + + tests/files/README | 109 +++++++++++++++++++++++++++++---- + tests/files/bad-1-v0-uncomp-size.lz | Bin 0 -> 42 bytes + tests/files/bad-1-v1-crc32.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-dict-1.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-dict-2.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-magic-1.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-magic-2.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-member-size.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-trailing-magic.lz | Bin 0 -> 54 bytes + tests/files/bad-1-v1-uncomp-size.lz | Bin 0 -> 50 bytes + tests/files/good-1-v0-trailing-1.lz | Bin 0 -> 59 bytes + tests/files/good-1-v0.lz | Bin 0 -> 42 bytes + tests/files/good-1-v1-trailing-1.lz | Bin 0 -> 67 bytes + tests/files/good-1-v1-trailing-2.lz | Bin 0 -> 70 bytes + tests/files/good-1-v1.lz | Bin 0 -> 50 bytes + tests/files/good-2-v0-v1.lz | Bin 0 -> 78 bytes + tests/files/good-2-v1-v0.lz | Bin 0 -> 78 bytes + tests/files/good-2-v1-v1.lz | Bin 0 -> 86 bytes + tests/files/unsupported-1-v234.lz | Bin 0 -> 50 bytes + 19 files changed, 98 insertions(+), 11 deletions(-) + +commit 731db13e6fa3ad3e3fc786c0ccf6eac4cce6865f +Author: Lasse Collin +Date: 2022-10-19 22:32:51 +0300 + + xz: Remove the commented-out FORMAT_GZIP, gzip, .gz, and .tgz. + + src/xz/args.c | 2 -- + src/xz/coder.h | 1 - + src/xz/suffix.c | 9 --------- + 3 files changed, 12 deletions(-) + +commit 3176f992c55b8d788c4633809aaf9447376a5a12 +Author: Lasse Collin +Date: 2022-10-08 21:28:15 +0300 + + xz: Add .lz (lzip) decompression support. + + If configured with --disable-lzip-decoder then --long-help will + still list `lzip' in --format but I left it like that since + due to translations it would be messy to have two help strings. + Features are disabled only in special situations so wrong help + in such a situation shouldn't matter much. + + Thanks to Michał Górny for the original patch. + + src/xz/args.c | 9 ++++++++ + src/xz/coder.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- + src/xz/coder.h | 3 +++ + src/xz/message.c | 2 +- + src/xz/suffix.c | 26 ++++++++++++++++++---- + src/xz/xz.1 | 46 +++++++++++++++++++++++++++++++++----- + 6 files changed, 141 insertions(+), 13 deletions(-) + +commit 034086e1ae1459210837a24e04878435c86dc41b +Author: Lasse Collin +Date: 2022-10-08 00:29:20 +0300 + + liblzma: Add .lz support to lzma_auto_decoder(). + + Thanks to Michał Górny for the original patch. + + src/liblzma/api/lzma/container.h | 10 ++++++---- + src/liblzma/common/Makefile.inc | 3 ++- + src/liblzma/common/auto_decoder.c | 23 +++++++++++++++++------ + src/liblzma/common/lzip_decoder.h | 22 ++++++++++++++++++++++ + 4 files changed, 47 insertions(+), 11 deletions(-) + +commit 0538db038f3cdc352007dacb42454aa1806b8e40 +Author: Lasse Collin +Date: 2022-10-06 15:50:20 +0300 + + liblzma: Add .lz (lzip) decompression support (format versions 0 and 1). + + Support for format version 0 was removed from lzip 1.18 for some + reason. .lz format version 0 files are rare (and old) but some + source packages were released in this format, and some people might + have personal files in this format too. It's very little extra code + to support it along side format version 1 so this commits adds + support for both. + + The Sync Flush marker extentension to the original .lz format + version 1 isn't supported. It would require changes to the + LZMA decoder itself. Such files are very rare anyway. + + See the API doc for lzma_lzip_decoder() for more details about + the .lz format support. + + Thanks to Michał Górny for the original patch. + + configure.ac | 21 ++ + src/liblzma/api/lzma/container.h | 62 +++++- + src/liblzma/common/Makefile.inc | 5 + + src/liblzma/common/lzip_decoder.c | 413 ++++++++++++++++++++++++++++++++++++++ + src/liblzma/liblzma_generic.map | 1 + + src/liblzma/liblzma_linux.map | 1 + + 6 files changed, 501 insertions(+), 2 deletions(-) + +commit 633d48a075b9ce4b9c08a7a56a7eb4cabc18100c +Author: Lasse Collin +Date: 2022-11-09 14:17:23 +0200 + + liblzma: Add the missing Makefile.inc change for --disable-microlzma. + + This was forgotten from commit 59c4d6e1390f6f4176f43ac1dad1f7ac03c449b8. + + src/liblzma/common/Makefile.inc | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 724285dadbdc88765c8fb83eab9816575a260966 +Author: Lasse Collin +Date: 2022-11-09 14:10:52 +0200 + + xz: Add comments about stdin and src_st.st_size. + + "xz -v < regular_file > out.xz" doesn't display the percentage + and estimated remaining time because it doesn't even try to + check the input file size when input is read from stdin. + This could be improved but for now there's just a comment + to remind about it. + + src/xz/coder.c | 9 +++++++++ + src/xz/file_io.c | 4 ++++ + 2 files changed, 13 insertions(+) + +commit f723eec68b0e44234910f669a29119de33018967 +Author: Lasse Collin +Date: 2022-11-09 12:48:22 +0200 + + xz: Fix displaying of file sizes in progress indicator in passthru mode. + + It worked for one input file since the counters are zero when + xz starts but they weren't reset when starting a new file in + passthru mode. For example, if files A, B, and C are one byte each, + then "xz -dcvf A B C" would show file sizes as 1, 2, and 3 bytes + instead of 1, 1, and 1 byte. + + src/xz/coder.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 69265d0f223ddf1d66f799b8b047df22923e376f +Author: Lasse Collin +Date: 2022-11-09 11:27:20 +0200 + + xz: Add a comment why --to-stdout is not in --help. + + It is on the man page still. + + src/xz/message.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit fe6b8852a3c6a0eb5a3c33512e0a69af257d3bc7 +Author: Lasse Collin +Date: 2022-11-08 23:05:37 +0200 + + xz: Make xz -lvv show that the upcoming --arm64 needs 5.4.0 to decompress. + + src/xz/list.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +commit fb3f05ac9f2b4b0e3643401960fbeab31997ac7a +Author: Lasse Collin +Date: 2022-11-08 22:26:54 +0200 + + Docs: Update faq.txt a little. + + doc/faq.txt | 66 ++++++++++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 43 insertions(+), 23 deletions(-) + +commit 05331f091ec3b68eccbfb2a9a7a576072768fb4b +Author: Lasse Collin +Date: 2022-11-08 16:57:17 +0200 + + Translations: Update Turkish translation. + + po/tr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ed3a4822963b4940d84e6f44d47277c394fc046d +Author: Lasse Collin +Date: 2022-11-08 14:55:32 +0200 + + Translations: Update Croatian translation. + + po/hr.po | 190 ++++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 96 insertions(+), 94 deletions(-) + +commit 4746f5ec721316bc4c6fec9905b2902e0360e0af +Author: Lasse Collin +Date: 2022-11-08 14:13:03 +0200 + + liblzma: Update API docs about decoder flags. + + src/liblzma/api/lzma/container.h | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +commit 8779a9db5d0cec00c9dc9e9965dd2dda04f9d80d +Author: Lasse Collin +Date: 2022-11-08 14:01:50 +0200 + + liblzma: Use the return_if_error() macro in alone_decoder.c. + + src/liblzma/common/alone_decoder.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 3f4990b6822961e75cd9b4e2e82b1df63f6f8fcc +Author: Lasse Collin +Date: 2022-11-08 14:00:58 +0200 + + liblzma: Fix a comment in auto_decoder.c. + + src/liblzma/common/auto_decoder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 026a5897c72a2041ae08ceec54ce8b1cdeb51334 +Author: Lasse Collin +Date: 2022-11-08 13:43:19 +0200 + + xz: Initialize the pledge(2) sandbox at the very beginning of main(). + + It feels better that the initializations are sandboxed too. + They don't do anything that the pledge() call wouldn't allow. + + src/xz/main.c | 27 ++++++++++++++------------- + 1 file changed, 14 insertions(+), 13 deletions(-) + +commit 49a59f6ca001c3ce9affa2c162b437aad021b4d5 +Author: Lasse Collin +Date: 2022-11-07 22:51:16 +0200 + + xz: Extend --robot --info-memory output. + + Now it includes everything that the human-readable --info-memory shows. + + src/xz/hardware.c | 24 +++++++++++++++--------- + src/xz/xz.1 | 47 +++++++++++++++++++++++++++++++++++++++++------ + 2 files changed, 56 insertions(+), 15 deletions(-) + +commit 5e2450c75cbac966c62cf2231c824f2cc91ddba8 +Author: Lasse Collin +Date: 2022-11-07 17:22:04 +0200 + + liblzma: Include cached memory in reported memusage in threaded decoder. + + This affects lzma_memusage() and lzma_memlimit_set() when used + with the threaded decompressor. Now all allocations are reported + by lzma_memusage() (so it's not misleading) and lzma_memlimit_set() + cannot lower the limit below that value. + + The alternative would have been to allow lowering the limit if + doing so is possible by freeing the cached memory but since + the primary use case of lzma_memlimit_set() is to increase + memlimit after LZMA_MEMLIMIT_ERROR this simple approach + was selected. + + The cached memory was always included when enforcing + the memory usage limit while decoding. + + Thanks to Jia Tan. + + src/liblzma/common/stream_decoder_mt.c | 22 +++++++++++++++++++--- + 1 file changed, 19 insertions(+), 3 deletions(-) + +commit 1fc6e7dd1fabdb60124d449b99273330ccab3ff1 +Author: Jia Tan +Date: 2022-11-07 16:24:14 +0200 + + xz: Avoid a compiler warning in progress_speed() in message.c. + + This should be smaller too since it avoids the string constants. + + src/xz/message.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit cf118c014683069b5dbe91898acdc40f2f0a1f5d +Author: Lasse Collin +Date: 2022-10-31 16:26:05 +0200 + + Build: Clarify comment in configure.ac about SSE2. + + configure.ac | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit aad3c609ffb72f581a7a2b67be3ad70b2b327840 +Author: Lasse Collin +Date: 2022-10-31 16:16:37 +0200 + + Build: Remove obsolete commented-out lines from configure.ac. + + configure.ac | 4 ---- + 1 file changed, 4 deletions(-) + +commit e53e0e2186c6b8ce866bd19aec52f1c318ed31ba +Author: Lasse Collin +Date: 2022-10-31 13:31:58 +0200 + + Windows: Fix mythread_once() macro with Vista threads. + + Don't call InitOnceComplete() if initialization was already done. + + So far mythread_once() has been needed only when building + with --enable-small. windows/build.bash does this together + with --disable-threads so the Vista-specific mythread_once() + is never needed by those builds. VS project files or + CMake-builds don't support HAVE_SMALL builds at all. + + src/common/mythread.h | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 48dde3bab9dc04081acb5aa7cf7c5044b8a49f58 +Author: Lasse Collin +Date: 2022-10-31 11:54:44 +0200 + + liblzma: Silence -Wconversion warning from crc64_fast.c. + + src/liblzma/check/crc64_fast.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit a243c617ff249d915ac123de4f536b80322c1fdb +Author: Lasse Collin +Date: 2022-10-31 11:49:47 +0200 + + CMake: Sync tuklib_cpucores.cmake with tuklib_cpucores.m4. + + This was forgotten from commit 2611c4d90535652d3eb7ef4a026a6691276fab43. + + cmake/tuklib_cpucores.cmake | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 05c72de06fcaaedc78f8abba7d5ec568ddcf1e75 +Author: Lasse Collin +Date: 2022-10-27 15:49:18 +0300 + + Tests: test_files.sh: Make it not fail if features were disabled at build. + + It now tries to test as many files as easily possible. + The exit status indicates skipping if any of the files were + skipped. This way it is easy to notice if something is being + skipped when it isn't expected. + + tests/test_files.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 46 insertions(+), 4 deletions(-) + +commit b3459327a51f4b8239d19e6c34b4e0c6bc2d81de +Author: Lasse Collin +Date: 2022-10-27 15:30:13 +0300 + + Tests: test_files.sh: Suppress an expected warning from the log. + + xz (but not xzdec) will normally warn about unsupported check + but since we are testing specifically such a file, it's better + to silence that warning so that it doesn't look suspicious in + test_files.sh.log. + + The use of -q and -Q in xzdec is just for consistency and + doesn't affect the result at least for now. + + tests/test_files.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 798c86e4231e0835ab76ccd0810c8ea30833b2ce +Author: Lasse Collin +Date: 2022-10-27 15:27:50 +0300 + + Tests: test_files.sh: Print the reason for skipping if xz & xzdec missing. + + tests/test_files.sh | 1 + + 1 file changed, 1 insertion(+) + +commit c1dd8524e1af07f16b790463899de06a6a5fcc08 +Author: Lasse Collin +Date: 2022-10-27 01:12:40 +0300 + + Tests: Keep test_compress_* working when some filters are unavailable. + + tests/test_compress.sh | 34 ++++++++++++++++++++-------------- + 1 file changed, 20 insertions(+), 14 deletions(-) + +commit ce30ada91951d0746879ae438da11f1ee8a90aa0 +Author: Jia Tan +Date: 2022-10-23 21:01:08 +0800 + + Tests: test_bcj_exact_size skips properly now if PowerPC filter disabled. + + tests/test_bcj_exact_size.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 89c5cfcacaca7130509fac836e2f30c46b824502 +Author: Lasse Collin +Date: 2022-10-26 00:05:57 +0300 + + Tests: Test also unsupported-*.xz. + + tests/test_files.sh | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +commit a4b214b93ac741edef9c41e55865b0b867ca2587 +Author: Lasse Collin +Date: 2022-10-25 23:45:03 +0300 + + Build: Use AC_CONFIG_HEADERS instead of the ancient AC_CONFIG_HEADER. + + We require Autoconf >= 2.69 and that has AC_CONFIG_HEADERS. + + There is a warning about AC_PROG_CC_C99 being obsolete but + it cannot be removed because it is needed with Autoconf 2.69. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 04f299b64e73f50afc188c2590ebebc6b73ed744 +Author: Lasse Collin +Date: 2022-10-25 23:31:44 +0300 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive. + + m4/ax_pthread.m4 | 29 ++++++++++++++++++++++------- + 1 file changed, 22 insertions(+), 7 deletions(-) + +commit 59c4d6e1390f6f4176f43ac1dad1f7ac03c449b8 +Author: Lasse Collin +Date: 2022-10-25 23:28:34 +0300 + + Build: Add configure option --disable-microlzma. + + MicroLZMA was made for EROFS and used by erofs-utils. + It might be used by something else in the future but + those wanting a smaller build for specific situations + can now disable this rarely-needed feature. + + configure.ac | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit 054ccd6d14b2cc6eddc56897af280d3221414150 +Author: Lasse Collin +Date: 2022-10-25 23:09:11 +0300 + + xz: Fix --single-stream with an empty .xz Stream. + + Example: + + $ xz -dc --single-stream good-0-empty.xz + xz: good-0-empty.xz: Internal error (bug) + + The code, that is tries to catch some input file issues early, + didn't anticipate LZMA_STREAM_END which is possible in that + code only when --single-stream is used. + + src/xz/coder.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 563288ea705e83ff5cb292adf794650c263bca1d +Author: Lasse Collin +Date: 2022-10-25 21:11:58 +0300 + + xz: Add support for OpenBSD's pledge() sandbox. + + configure.ac | 12 +++++++++--- + src/xz/file_io.c | 11 +++++++++++ + src/xz/main.c | 13 +++++++++++++ + src/xz/private.h | 2 +- + 4 files changed, 34 insertions(+), 4 deletions(-) + +commit f9913e8ee2ba0b1e4ff4d0aa4c001aae305ed944 +Author: Lasse Collin +Date: 2022-10-25 19:07:17 +0300 + + xz: Fix decompressor behavior if input uses an unsupported check type. + + Now files with unsupported check will make xz display + a warning, set the exit status to 2 (unless --no-warn is used), + and then decompress the file normally. This is how it was + supposed to work since the beginning but this was broken by + the commit 231c3c7098f1099a56abb8afece76fc9b8699f05, that is, + a little before 5.0.0 was released. The buggy behavior displayed + a message, set exit status 1 (error), and xz didn't attempt to + to decompress the file. + + This doesn't matter today except for special builds that disable + CRC64 or SHA-256 at build time (but such builds should be used + in special situations only). The bug matters if new check type + is added in the future and an old xz version is used to decompress + such a file; however, it's likely that such files would use a new + filter too and an old xz wouldn't be able to decompress the file + anyway. + + The first hunk in the commit is the actual fix. The second hunk + is a cleanup since LZMA_TELL_ANY_CHECK isn't used in xz. + + There is a test file for unsupported check type but it wasn't + used by test_files.sh, perhaps due to different behavior between + xz and the simpler xzdec. + + src/xz/coder.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +commit aa4fe145b9486adc454f44fd3e09be9add808a0f +Author: Lasse Collin +Date: 2022-10-25 18:36:19 +0300 + + xz: Clarify the man page: input file isn't removed if an error occurs. + + src/xz/xz.1 | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 8b46ae8cdeddfd7dc01fec92971b8696e9a96c5d +Author: Lasse Collin +Date: 2022-10-25 18:30:55 +0300 + + xz: Refactor to remove is_empty_filename(). + + Long ago it was used in list.c too but nowadays it's needed + only in io_open_src() so it's nicer to avoid a separate function. + + src/xz/file_io.c | 4 +++- + src/xz/util.c | 12 ------------ + src/xz/util.h | 4 ---- + 3 files changed, 3 insertions(+), 17 deletions(-) + +commit 85624015978b0de294cff3df79006df987c552b1 +Author: Lasse Collin +Date: 2022-10-25 18:23:54 +0300 + + xz: If input file cannot be removed, treat it as a warning, not error. + + Treating it as a warning (message + exit status 2) matches gzip + and it seems more logical as at that point the output file has + already been successfully closed. When it's a warning it is + possible to suppress it with --no-warn. + + src/xz/file_io.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit fda9f85f52c546f7ca0313cf89481da4707fecb3 +Author: Lasse Collin +Date: 2022-10-24 16:25:09 +0300 + + liblzma: Threaded decoder: Stop the worker threads on errors. + + It's waste of CPU time and electricity to leave the unfinished + worker threads running when it is known that their output will + get ignored. + + src/liblzma/common/stream_decoder_mt.c | 33 ++++++++++++++++++++++++++------- + 1 file changed, 26 insertions(+), 7 deletions(-) + +commit 2611c4d90535652d3eb7ef4a026a6691276fab43 +Author: Lasse Collin +Date: 2022-10-20 20:22:50 +0300 + + tuklib_cpucores: Use HW_NCPUONLINE on OpenBSD. + + On OpenBSD the number of cores online is often less + than what HW_NCPU would return because OpenBSD disables + simultaneous multi-threading (SMT) by default. + + Thanks to Christian Weisgerber. + + m4/tuklib_cpucores.m4 | 5 +++++ + src/common/tuklib_cpucores.c | 9 +++++++++ + 2 files changed, 14 insertions(+) + +commit 424ac91c7e0419393ff2bde4f62e21fa611c776d +Author: Lasse Collin +Date: 2022-10-19 19:39:35 +0300 + + Tests: Skip tests in test_*.sh if encoders and/or decoders are disabled. + + This isn't perfect as the scripts can still fail if only + certain filters are disabled. This is still an improvement + as now "make check" has better behavior when all encoders + or decoders are disabled. + + Grepping ../config.h is simple and fairly clean but it only + works if config.h was created. CMake builds don't create + config.h but they don't use these test scripts either. + + Thanks to Sebastian Andrzej Siewior for reporting the problem. + Thanks to Jia Tan for the original patch which grepped xz + error messages instead of config.h. + + tests/test_compress.sh | 12 ++++++++++++ + tests/test_files.sh | 11 +++++++++++ + tests/test_scripts.sh | 11 +++++++++++ + 3 files changed, 34 insertions(+) + +commit ca8bf9d7c5a30be8ba1eeb106fd892f19e83ed09 +Author: Lasse Collin +Date: 2022-10-19 18:54:34 +0300 + + Test: Remove the (exit 1) lines. + + I suspect that I used these in the original version because + Autoconf's manual describes that such a trick is needed in + some specific situations for portability reasons. None of those + situations listed on Autoconf 2.71 manual apply to these test + scripts though so this cleans them up. + + tests/test_compress.sh | 10 ---------- + tests/test_files.sh | 9 --------- + tests/test_scripts.sh | 6 ------ + 3 files changed, 25 deletions(-) + +commit 82fcb7cfc17ce62f79ebc7ca2374e1daca5e4d5e +Author: Lasse Collin +Date: 2022-10-19 17:14:57 +0300 + + Tests: Fix a warning in test_memlimit.c when decoders are disabled. + + tests/test_memlimit.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit b5f8271b45b9b0e59485ffba3640ca3418835ec4 +Author: Lasse Collin +Date: 2022-10-19 17:11:46 +0300 + + Tests: Add test_memlimit to .gitignore. + + Thanks to Jia Tan. + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit 6a86e81cab202d0a812a7b2e9efacaf70c58ba38 +Author: Jia Tan +Date: 2022-10-06 21:53:09 +0300 + + Tests: Refactor test_stream_flags.c. + + Converts test_stream_flags to tuktest. Also the test will now + compile and skip properly if encoders or decoders are disabled. + + Thanks to Sebastian Andrzej Siewior. + + tests/test_stream_flags.c | 533 ++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 416 insertions(+), 117 deletions(-) + +commit 827ac5b4821491fd3afe0d0e1ddac326253aeb66 +Author: Jia Tan +Date: 2022-10-06 17:00:38 +0800 + + Tests: Refactor test_block_header.c. + + test_block_header now achieves higher test coverage. Also the + test will now compile and skip properly if encoders or decoders + are disabled. + + Thanks to Sebastian Andrzej Siewior. + + tests/test_block_header.c | 486 +++++++++++++++++++++++++++++++++++----------- + 1 file changed, 370 insertions(+), 116 deletions(-) + +commit 84963318952064a93bfc52edd6b0ef70593384ee +Author: Jia Tan +Date: 2022-10-05 23:54:12 +0800 + + Tests: Fix compilation issues. + + test_bcj_exact_size, test_check, test_hardware, and test_index will + all now compile and skip properly if encoders or decoders are disabled. + + Also fixed a small typo (disabed -> disabled). + + Thanks to Sebastian Andrzej Siewior. + + tests/test_bcj_exact_size.c | 20 ++++++++++++++------ + tests/test_check.c | 8 +++++++- + tests/test_hardware.c | 2 +- + tests/test_index.c | 6 ++++++ + tests/test_memlimit.c | 16 +++++++++++++++- + tests/test_vli.c | 13 +++++++++++++ + 6 files changed, 56 insertions(+), 9 deletions(-) + +commit 7dcabeec63d46b436fa5f043c3d1f09d0e15be16 +Author: Lasse Collin +Date: 2022-10-05 16:20:47 +0300 + + Tests: Include mythread.h in the tests that use MYTHREAD_ENABLED. + + tests/test_check.c | 1 + + tests/test_hardware.c | 1 + + tests/test_memlimit.c | 1 + + 3 files changed, 3 insertions(+) + +commit 14af758a770c7781af18fb66d6d21ee5b1c27f04 +Author: Jia Tan +Date: 2022-10-05 20:57:16 +0800 + + liblzma: Fix a compilation issue when encoders are disabled. + + When encoders were disabled and threading enabled, outqueue.c and + outqueue.h were not compiled. The multi threaded decoder required + these files, so compilation failed. + + src/liblzma/common/Makefile.inc | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 6ca5c354bd4620aa7f81da68870eef1b1f26288f +Author: Jia Tan +Date: 2022-10-05 16:41:38 +0800 + + Tests: Fix compilation error when threading support has been disabled. + + Now tests that require threading are skipped when threading + support has been disabled. + + Thanks to Sebastian Andrzej Siewior. + + tests/test_check.c | 4 ++++ + tests/test_hardware.c | 4 ++++ + tests/test_memlimit.c | 4 ++++ + 3 files changed, 12 insertions(+) + +commit fae37ad2affd8fe8871f4ff93d5cab5ec14d5e58 +Author: Lasse Collin +Date: 2022-10-05 14:26:00 +0300 + + tuklib_integer: Add 64-bit endianness-converting reads and writes. + + Also update the comment in liblzma's memcmplen.h. + + Thanks to Michał Górny for the original patch for the reads. + + m4/tuklib_integer.m4 | 8 ++++---- + src/common/tuklib_integer.h | 46 ++++++++++++++++++++++++++++++++++++++++-- + src/liblzma/common/memcmplen.h | 9 +++------ + 3 files changed, 51 insertions(+), 12 deletions(-) + +commit 508a44372c5b0dede8863fd0d358d4a9d8645c95 +Author: Lasse Collin +Date: 2022-09-30 12:06:13 +0300 + + liblzma: Add API doc note about the .xz decoder LZMA_MEMLIMIT_ERROR bug. + + The bug was fixed in 660739f99ab211edec4071de98889fb32ed04e98. + + src/liblzma/api/lzma/base.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 8cc9874a7974cd575aee44f218836f7acdbeb0ed +Author: Jia Tan +Date: 2022-09-21 16:15:50 +0800 + + liblzma: Add dest and src NULL checks to lzma_index_cat. + + The documentation states LZMA_PROG_ERROR can be returned from + lzma_index_cat. Previously, lzma_index_cat could not return + LZMA_PROG_ERROR. Now, the validation is similar to + lzma_index_append, which does a NULL check on the index + parameter. + + src/liblzma/common/index.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit afd5a8bf5374eba82804a999e1ea7af680784086 +Author: Jia Tan +Date: 2022-09-21 20:29:28 +0800 + + Tests: Create a test for the lzma_index_cat bug. + + tests/test_index.c | 43 ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +commit 3d5a99ca373a4e86faf671226ca6487febb9eeac +Author: Jia Tan +Date: 2022-09-21 19:28:53 +0800 + + liblzma: Fix copying of check type statistics in lzma_index_cat(). + + The check type of the last Stream in dest was never copied to + dest->checks (the code tried to copy it but it was done too late). + This meant that the value returned by lzma_index_checks() would + only include the check type of the last Stream when multiple + lzma_indexes had been concatenated. + + In xz --list this meant that the summary would only list the + check type of the last Stream, so in this sense this was only + a visual bug. However, it's possible that some applications + use this information for purposes other than merely showing + it to the users in an informational message. I'm not aware of + such applications though and it's quite possible that such + applications don't exist. + + Regular streamed decompression in xz or any other application + doesn't use lzma_index_cat() and so this bug cannot affect them. + + src/liblzma/common/index.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit a61d32172789735350a941e23baf6b587c49e5d9 +Author: Lasse Collin +Date: 2022-09-28 12:20:41 +0300 + + tuklib_physmem: Fix Unicode builds on Windows. + + Thanks to ArSaCiA Game. + + src/common/tuklib_physmem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5a4d3548ab214fdca364d5c734baf1d1fab47308 +Author: Lasse Collin +Date: 2022-09-28 11:12:07 +0300 + + Tests: Add test_memlimit.c to test restarting after LZMA_MEMLIMIT_ERROR. + + tests/Makefile.am | 2 + + tests/test_memlimit.c | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 153 insertions(+) + +commit 660739f99ab211edec4071de98889fb32ed04e98 +Author: Lasse Collin +Date: 2022-09-28 11:05:15 +0300 + + liblzma: Stream decoder: Fix restarting after LZMA_MEMLIMIT_ERROR. + + If lzma_code() returns LZMA_MEMLIMIT_ERROR it is now possible + to use lzma_memlimit_set() to increase the limit and continue + decoding. This was supposed to work from the beginning but + there was a bug. With other decoders (.lzma or threaded .xz) + this already worked correctly. + + src/liblzma/common/stream_decoder.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +commit 7e68fda58c74ad9e5b876cc22fcbe80fc0e4747b +Author: Lasse Collin +Date: 2022-09-28 11:00:23 +0300 + + liblzma: Stream decoder: Fix comments. + + src/liblzma/common/stream_decoder.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +commit f664cb25841fc1c478b819034a224a558e2ac6e7 +Author: Lasse Collin +Date: 2022-09-20 16:58:22 +0300 + + liblzma: ARM64: Add comments. + + src/liblzma/simple/arm64.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit b557b4a0eea05470fae8ba5ef4ad5a6dfb36ac41 +Author: Lasse Collin +Date: 2022-09-20 16:27:50 +0300 + + liblzma: ARM64: Fix wrong comment in API doc. + + Thanks to Jia Tan. + + src/liblzma/api/lzma/bcj.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d5b0906fa55157f48c200188a3951d80df9cb308 +Author: Lasse Collin +Date: 2022-09-19 20:24:26 +0300 + + xz: Add --experimental-arm64[=width=WIDTH]. + + It will be renamed to --arm64 once it is stable. + + Man page or --long-help weren't updated yet. + + src/xz/args.c | 7 +++++++ + src/xz/message.c | 7 +++++++ + src/xz/options.c | 39 +++++++++++++++++++++++++++++++++++++++ + src/xz/options.h | 7 +++++++ + 4 files changed, 60 insertions(+) + +commit ecb966de308c255bb4735a7307ef9901c643a9de +Author: Lasse Collin +Date: 2022-09-19 19:34:56 +0300 + + liblzma: Add experimental ARM64 BCJ filter with a temporary Filter ID. + + That is, the Filter ID will be changed once the design is final. + The current version will be removed. So files created with the + tempoary Filter ID won't be supported in the future. + + CMakeLists.txt | 3 + + configure.ac | 4 +- + src/liblzma/api/lzma/bcj.h | 35 +++++- + src/liblzma/common/filter_common.c | 9 ++ + src/liblzma/common/filter_decoder.c | 8 ++ + src/liblzma/common/filter_encoder.c | 11 ++ + src/liblzma/simple/Makefile.inc | 4 + + src/liblzma/simple/arm64.c | 227 ++++++++++++++++++++++++++++++++++++ + src/liblzma/simple/simple_coder.h | 9 ++ + src/liblzma/simple/simple_decoder.h | 4 + + src/liblzma/simple/simple_encoder.h | 2 + + 11 files changed, 313 insertions(+), 3 deletions(-) + +commit 177bdc922cb17bd0fd831ab8139dfae912a5c2b8 +Author: Lasse Collin +Date: 2022-09-17 22:42:18 +0300 + + liblzma: Simple/BCJ filters: Allow disabling generic BCJ options. + + This will be needed for the ARM64 BCJ filter as it will use + its own options struct. + + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 4 ++-- + src/liblzma/simple/simple_private.h | 2 +- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 3 ++- + 8 files changed, 10 insertions(+), 9 deletions(-) + +commit c3592d0a55114144686ecf960cb516d6b31c98e9 +Author: Lasse Collin +Date: 2022-09-16 17:08:53 +0300 + + Tests: Add a test file for lzma_index_append() integer overflow bug. + + This test fails before commit 18d7facd3802b55c287581405c4d49c98708c136. + + test_files.sh now runs xz -l for bad-3-index-uncomp-overflow.xz + because only then the previously-buggy code path gets tested. + Normal decompression doesn't use lzma_index_append() at all. + Instead, lzma_index_hash functions are used and those already + did the overflow check. + + tests/files/README | 10 ++++++++++ + tests/files/bad-3-index-uncomp-overflow.xz | Bin 0 -> 132 bytes + tests/test_files.sh | 8 ++++++++ + 3 files changed, 18 insertions(+) + +commit 982b29f828079a2a26253a40e975127a40a7d2bd +Author: Lasse Collin +Date: 2022-09-16 15:10:07 +0300 + + Translations: Add Turkish translation. + + po/LINGUAS | 1 + + po/tr.po | 977 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 978 insertions(+) + +commit 1fc088d9f6d1697924aaeac8cd1fb9918d1532e2 +Author: Lasse Collin +Date: 2022-09-16 14:09:07 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 097c7b67ce86ff16a7cef7631b39e5ca4ee3d420 +Author: Lasse Collin +Date: 2022-09-16 14:07:03 +0300 + + xzgrep: Fix compatibility with old shells. + + Running the current xzgrep on Slackware 10.1 with GNU bash 3.00.15: + + xzgrep: line 231: syntax error near unexpected token `;;' + + On SCO OpenServer 5.0.7 with Korn Shell 93r: + + syntax error at line 231 : `;;' unexpected + + Turns out that some old shells don't like apostrophes (') inside + command substitutions. For example, the following fails: + + x=$(echo foo + # asdf'zxcv + echo bar) + printf '%s\n' "$x" + + The problem was introduced by commits + 69d1b3fc29677af8ade8dc15dba83f0589cb63d6 (2022-03-29), + bd7b290f3fe4faeceb7d3497ed9bf2e6ed5e7dc5 (2022-07-18), and + a648978b20495b7aa4a8b029c5a810b5ad9d08ff (2022-07-19). + 5.2.6 is the only stable release that included + this problem. + + Thanks to Kevin R. Bulgrien for reporting the problem + on SCO OpenServer 5.0.7 and for providing the fix. + + src/scripts/xzgrep.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit f2d084fe3f0d6d71488bfc6987f26542f67bfd99 +Author: Lasse Collin +Date: 2022-09-09 14:12:30 +0300 + + Tests: Silence warnings about unused functions from tuktest.h. + + Warnings about unused tuktest_run_test conveniently tell which + test programs haven't been converted to tuktest.h yet but I + silenced that warning too for now anyway. + + It is fine to use __attribute__((__unused__)) even when the + function is actually used because the attribute only means + that the function might be unused. + + tests/tuktest.h | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit f8ee61e74eb40600445fdb601c374d582e1e9c8a +Author: Lasse Collin +Date: 2022-09-09 13:51:57 +0300 + + liblzma: lzma_filters_copy: Keep dest[] unmodified if an error occurs. + + lzma_stream_encoder() and lzma_stream_encoder_mt() always assumed + this. Before this patch, failing lzma_filters_copy() could result + in free(invalid_pointer) or invalid memory reads in stream_encoder.c + or stream_encoder_mt.c. + + To trigger this, allocating memory for a filter options structure + has to fail. These are tiny allocations so in practice they very + rarely fail. + + Certain badness in the filter chain array could also make + lzma_filters_copy() fail but both stream_encoder.c and + stream_encoder_mt.c validate the filter chain before + trying to copy it, so the crash cannot occur this way. + + src/liblzma/api/lzma/filter.h | 4 +++- + src/liblzma/common/filter_common.c | 18 ++++++++++++------ + 2 files changed, 15 insertions(+), 7 deletions(-) + +commit 18d7facd3802b55c287581405c4d49c98708c136 +Author: Jia Tan +Date: 2022-09-02 20:18:55 +0800 + + liblzma: lzma_index_append: Add missing integer overflow check. + + The documentation in src/liblzma/api/lzma/index.h suggests that + both the unpadded (compressed) size and the uncompressed size + are checked for overflow, but only the unpadded size was checked. + The uncompressed check is done first since that is more likely to + occur than the unpadded or index field size overflows. + + src/liblzma/common/index.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 9ac06cb5b85274d18f9f70d82cf2d8c9c1151bd4 +Author: Lasse Collin +Date: 2022-09-08 15:11:08 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit ba3e4ba2de034ae93a513f9c3a0823b80cdb66dc +Author: Jia Tan +Date: 2022-09-08 15:07:00 +0300 + + CMake: Clarify a comment about Windows symlinks without file extension. + + CMakeLists.txt | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 17485e884ce5c74315f29a8a1507bc706cd5cd1d +Author: Lasse Collin +Date: 2022-09-08 15:02:41 +0300 + + CMake: Update for liblzma_*.map files and fix wrong common_w32res.rc dep. + + The previous commit split liblzma.map into liblzma_linux.map and + liblzma_generic.map. This commit updates the CMake build for those. + + common_w32res.rc dependency was listed under Linux/FreeBSD while + obviously it belongs to Windows when building a DLL. + + CMakeLists.txt | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +commit 913ddc5572b9455fa0cf299be2e35c708840e922 +Author: Lasse Collin +Date: 2022-09-04 23:23:00 +0300 + + liblzma: Vaccinate against an ill patch from RHEL/CentOS 7. + + RHEL/CentOS 7 shipped with 5.1.2alpha, including the threaded + encoder that is behind #ifdef LZMA_UNSTABLE in the API headers. + In 5.1.2alpha these symbols are under XZ_5.1.2alpha in liblzma.map. + API/ABI compatibility tracking isn't done between development + releases so newer releases didn't have XZ_5.1.2alpha anymore. + + Later RHEL/CentOS 7 updated xz to 5.2.2 but they wanted to keep + the exported symbols compatible with 5.1.2alpha. After checking + the ABI changes it turned out that >= 5.2.0 ABI is backward + compatible with the threaded encoder functions from 5.1.2alpha + (but not vice versa as fixes and extensions to these functions + were made between 5.1.2alpha and 5.2.0). + + In RHEL/CentOS 7, XZ Utils 5.2.2 was patched with + xz-5.2.2-compat-libs.patch to modify liblzma.map: + + - XZ_5.1.2alpha was added with lzma_stream_encoder_mt and + lzma_stream_encoder_mt_memusage. This matched XZ Utils 5.1.2alpha. + + - XZ_5.2 was replaced with XZ_5.2.2. It is clear that this was + an error; the intention was to keep using XZ_5.2 (XZ_5.2.2 + has never been used in XZ Utils). So XZ_5.2.2 lists all + symbols that were listed under XZ_5.2 before the patch. + lzma_stream_encoder_mt and _mt_memusage are included too so + they are listed both here and under XZ_5.1.2alpha. + + The patch didn't add any __asm__(".symver ...") lines to the .c + files. Thus the resulting liblzma.so exports the threaded encoder + functions under XZ_5.1.2alpha only. Listing the two functions + also under XZ_5.2.2 in liblzma.map has no effect without + matching .symver lines. + + The lack of XZ_5.2 in RHEL/CentOS 7 means that binaries linked + against unpatched XZ Utils 5.2.x won't run on RHEL/CentOS 7. + This is unfortunate but this alone isn't too bad as the problem + is contained within RHEL/CentOS 7 and doesn't affect users + of other distributions. It could also be fixed internally in + RHEL/CentOS 7. + + The second problem is more serious: In XZ Utils 5.2.2 the API + headers don't have #ifdef LZMA_UNSTABLE for obvious reasons. + This is true in RHEL/CentOS 7 version too. Thus now programs + using new APIs can be compiled without an extra #define. However, + the programs end up depending on symbol version XZ_5.1.2alpha + (and possibly also XZ_5.2.2) instead of XZ_5.2 as they would + with an unpatched XZ Utils 5.2.2. This means that such binaries + won't run on other distributions shipping XZ Utils >= 5.2.0 as + they don't provide XZ_5.1.2alpha or XZ_5.2.2; they only provide + XZ_5.2 (and XZ_5.0). (This includes RHEL/CentOS 8 as the patch + luckily isn't included there anymore with XZ Utils 5.2.4.) + + Binaries built by RHEL/CentOS 7 users get distributed and then + people wonder why they don't run on some other distribution. + Seems that people have found out about the patch and been copying + it to some build scripts, seemingly curing the symptoms but + actually spreading the illness further and outside RHEL/CentOS 7. + + The ill patch seems to be from late 2016 (RHEL 7.3) and in 2017 it + had spread at least to EasyBuild. I heard about the events only + recently. :-( + + This commit splits liblzma.map into two versions: one for + GNU/Linux and another for other OSes that can use symbol versioning + (FreeBSD, Solaris, maybe others). The Linux-specific file and the + matching additions to .c files add full compatibility with binaries + that have been built against a RHEL/CentOS-patched liblzma. Builds + for OSes other than GNU/Linux won't get the vaccine as they should + be immune to the problem (I really hope that no build script uses + the RHEL/CentOS 7 patch outside GNU/Linux). + + The RHEL/CentOS compatibility symbols XZ_5.1.2alpha and XZ_5.2.2 + are intentionally put *after* XZ_5.2 in liblzma_linux.map. This way + if one forgets to #define HAVE_SYMBOL_VERSIONS_LINUX when building, + the resulting liblzma.so.5 will have lzma_stream_encoder_mt@@XZ_5.2 + since XZ_5.2 {...} is the first one that lists that function. + Without HAVE_SYMBOL_VERSIONS_LINUX @XZ_5.1.2alpha and @XZ_5.2.2 + will be missing but that's still a minor problem compared to + only having lzma_stream_encoder_mt@@XZ_5.1.2alpha! + + The "local: *;" line was moved to XZ_5.0 so that it doesn't need + to be moved around. It doesn't matter where it is put. + + Having two similar liblzma_*.map files is a bit silly as it is, + at least for now, easily possible to generate the generic one + from the Linux-specific file. But that adds extra steps and + increases the risk of mistakes when supporting more than one + build system. So I rather maintain two files in parallel and let + validate_map.sh check that they are in sync when "make mydist" + is run. + + This adds .symver lines for lzma_stream_encoder_mt@XZ_5.2.2 and + lzma_stream_encoder_mt_memusage@XZ_5.2.2 even though these + weren't exported by RHEL/CentOS 7 (only @@XZ_5.1.2alpha was + for these two). I added these anyway because someone might + misunderstand the RHEL/CentOS 7 patch and think that @XZ_5.2.2 + (@@XZ_5.2.2) versions were exported too. + + At glance one could suggest using __typeof__ to copy the function + prototypes when making aliases. However, this doesn't work trivially + because __typeof__ won't copy attributes (lzma_nothrow, lzma_pure) + and it won't change symbol visibility from hidden to default (done + by LZMA_API()). Attributes could be copied with __copy__ attribute + but that needs GCC 9 and a fallback method would be needed anyway. + + This uses __symver__ attribute with GCC >= 10 and + __asm__(".symver ...") with everything else. The attribute method + is required for LTO (-flto) support with GCC. Using -flto with + GCC older than 10 is now broken on GNU/Linux and will not be fixed + (can silently result in a broken liblzma build that has dangerously + incorrect symbol versions). LTO builds with Clang seem to work + with the traditional __asm__(".symver ...") method. + + Thanks to Boud Roukema for reporting the problem and discussing + the details and testing the fix. + + configure.ac | 23 +++- + src/liblzma/Makefile.am | 10 +- + src/liblzma/common/block_buffer_encoder.c | 18 ++++ + src/liblzma/common/common.c | 14 +++ + src/liblzma/common/common.h | 28 +++++ + src/liblzma/common/hardware_cputhreads.c | 12 +++ + src/liblzma/common/stream_encoder_mt.c | 42 ++++++++ + src/liblzma/{liblzma.map => liblzma_generic.map} | 6 +- + src/liblzma/liblzma_linux.map | 131 +++++++++++++++++++++++ + src/liblzma/validate_map.sh | 113 +++++++++++++++++-- + 10 files changed, 382 insertions(+), 15 deletions(-) + +commit 80a1a8bb838842a2be343bd88ad1462c21c5e2c9 +Author: Lasse Collin +Date: 2022-08-31 16:42:04 +0300 + + CMake: Add xz symlinks. + + These are a minor thing especially since the xz build has + some real problems still like lack of large file support + on 32-bit systems but I'll commit this since the code exists. + + Thanks to Jia Tan. + + CMakeLists.txt | 38 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 37 insertions(+), 1 deletion(-) + +commit a4193bb6d85d7765b1b87faeab3e50106d3ab2e9 +Author: Lasse Collin +Date: 2022-08-31 16:29:38 +0300 + + CMake: Put xz man page install under if(UNIX) like is for xzdec. + + Thanks to Jia Tan. + + CMakeLists.txt | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit c1555b1a221a1427d4d650647531016d754bc4da +Author: Lasse Collin +Date: 2022-08-22 18:16:40 +0300 + + Bump version number for 5.3.3alpha. + + src/liblzma/api/lzma/version.h | 2 +- + src/liblzma/liblzma.map | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 44fedddc11c3f6ec2f7fe35a3e38f15ca93f90eb +Author: Lasse Collin +Date: 2022-08-22 18:13:56 +0300 + + Add NEWS for 5.3.3alpha. + + NEWS | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 119 insertions(+) + +commit a93e235d7ca764cc19f8f9f9063b40ff361c3cfa +Author: Lasse Collin +Date: 2022-07-12 17:59:41 +0300 + + Translations: Add Portuguese translation. + + Jia Tan made white-space changes and also changed "Language: pt_BR\n" + to pt. The translator wasn't reached so I'm hoping these changes + are OK and will commit it without translator's approval. + + Thanks to Pedro Albuquerque and Jia Tan. + + po/LINGUAS | 1 + + po/pt.po | 1001 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1002 insertions(+) + +commit e7cf5a946f25e40d77f45e41f0dee7d42a04e9ae +Author: Lasse Collin +Date: 2022-07-10 21:16:40 +0300 + + Translations: Add Serbian translation. + + Quite a few white-space changes were made by Jia Tan to make + this look good. Contacting the translator didn't succeed so + I'm committing this without getting translator's approval. + + Thanks to Мирослав Николић (Miroslav Nikolic) and Jia Tan. + + po/LINGUAS | 1 + + po/sr.po | 987 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 988 insertions(+) + +commit cc8617ab53b1f2a4da212fa76c92fe538269c5de +Author: Lasse Collin +Date: 2022-07-04 23:51:36 +0300 + + Translations: Add Swedish translation. + + Thanks to Sebastian Rasmussen and Jia Tan. + + po/LINGUAS | 1 + + po/sv.po | 983 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 984 insertions(+) + +commit c613598c358b640682d0ca2aed38fa7df763e8c7 +Author: Lasse Collin +Date: 2022-07-04 23:40:27 +0300 + + Translations: Add Esperanto translation. + + Thanks to Keith Bowes and Jia Tan. + + po/LINGUAS | 1 + + po/eo.po | 984 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 985 insertions(+) + +commit 659a587d678f21e98e91d2751c31d4ce050c081a +Author: Lasse Collin +Date: 2022-07-01 00:22:33 +0300 + + Translations: Add Catalan translation. + + Thanks to Jordi Mas and Jia Tan. + + po/LINGUAS | 1 + + po/ca.po | 1076 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1077 insertions(+) + +commit 739fd8c9bdf1d85f57d56642aad87148d4779530 +Author: Lasse Collin +Date: 2022-06-30 17:47:08 +0300 + + Translations: Add Ukrainian translation. + + Thanks to Yuri Chornoivan and Jia Tan. + + po/LINGUAS | 1 + + po/uk.po | 996 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 997 insertions(+) + +commit 73280550b111930c62a667e56add8fd574f80bc8 +Author: Lasse Collin +Date: 2022-06-30 17:45:26 +0300 + + Translators: Add Romanian translation. + + Thanks to Remus-Gabriel Chelu and Jia Tan. + + po/LINGUAS | 1 + + po/ro.po | 1016 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1017 insertions(+) + +commit 2465f5b825152714b2c357d96c2422c31109d320 +Author: Lasse Collin +Date: 2022-06-29 18:33:32 +0300 + + Translations: Update Brazilian Portuguese translation. + + One msgstr was changed. The diff is long due to changes + in the source code line numbers in the comments. + + Thanks to Rafael Fontenelle. + + po/pt_BR.po | 186 ++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 92 insertions(+), 94 deletions(-) + +commit 434e1ffd3e62719d509da10b646216f5ef53fe4d +Author: Lasse Collin +Date: 2022-06-29 18:04:44 +0300 + + Translations: Add Croatian translation. + + Thanks to Božidar Putanec and Jia Tan. + + po/LINGUAS | 1 + + po/hr.po | 987 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 988 insertions(+) + +commit 0732d0f7065c9bd48bfe4f5983144ae970c4a499 +Author: Lasse Collin +Date: 2022-06-29 17:58:48 +0300 + + Translations: Add Spanish translation. + + Thanks to Cristian Othón Martínez Vera and Jia Tan. + + po/LINGUAS | 1 + + po/es.po | 984 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 985 insertions(+) + +commit 9899b0f82bc130998d1f1f618a6ab805b73f2696 +Author: Lasse Collin +Date: 2022-06-29 17:49:43 +0300 + + Translations: Add Korean translation. + + Thanks to Seong-ho Cho and Jia Tan. + + po/LINGUAS | 1 + + po/ko.po | 972 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 973 insertions(+) + +commit 65217eaf6bd195f3ef027d4ac55d57b7d133d69f +Author: Lasse Collin +Date: 2020-03-16 21:57:21 +0200 + + Translations: Rebuild cs.po to avoid incorrect fuzzy strings. + + "make dist" updates the .po files and the fuzzy strings would + result in multiple very wrong translations. + + po/cs.po | 592 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 322 insertions(+), 270 deletions(-) + +commit e56ff423ee7af9e648e16b132f0d835d2cb4db26 +Author: Lasse Collin +Date: 2020-03-16 17:30:39 +0200 + + Translations: Add partial Danish translation. + + I made a few minor white space changes without getting them + approved by the Danish translation team. + + po/LINGUAS | 1 + + po/da.po | 896 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 897 insertions(+) + +commit 43e09c62e77cb8807d932c81de4decbdb956e184 +Author: Lasse Collin +Date: 2020-03-11 22:37:54 +0200 + + Translations: Add hu, zh_CN, and zh_TW. + + I made a few white space changes to these without getting them + approved by the translation teams. (I tried to contact the hu and + zh_TW teams but didn't succeed. I didn't contact the zh_CN team.) + + po/LINGUAS | 3 + + po/hu.po | 985 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po/zh_CN.po | 963 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po/zh_TW.po | 956 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 2907 insertions(+) + +commit 982b6b198ae1ffe6093236dd8a3d03d1415b912b +Author: Lasse Collin +Date: 2020-03-11 14:33:30 +0200 + + Translations: Update vi.po to match the file from the TP. + + The translated strings haven't been updated but word wrapping + is different. + + po/vi.po | 407 ++++++++++++++++++++++++++++----------------------------------- + 1 file changed, 179 insertions(+), 228 deletions(-) + +commit 801f39691fc4abc6dd33d7653d498781b593f3eb +Author: Lasse Collin +Date: 2020-03-11 14:18:03 +0200 + + Translations: Add fi and pt_BR, and update de, fr, it, and pl. + + The German translation isn't identical to the file in + the Translation Project but the changes (white space changes + only) were approved by the translator Mario Blättermann. + + po/LINGUAS | 2 + + po/de.po | 476 ++++++++++++++-------------- + po/fi.po | 974 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po/fr.po | 272 ++++++++-------- + po/it.po | 479 ++++++++++++---------------- + po/pl.po | 239 +++++++------- + po/pt_BR.po | 1001 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 7 files changed, 2697 insertions(+), 746 deletions(-) + +commit 311e4f85ede5d2f0bb71f3ad70b5b7db1b5adf33 +Author: Lasse Collin +Date: 2022-08-22 17:27:19 +0300 + + xz: Try to clarify --memlimit-mt-decompress vs. --memlimit-compress. + + src/xz/xz.1 | 31 +++++++++++++++++++------------ + 1 file changed, 19 insertions(+), 12 deletions(-) + +commit df23c31000283c00e5ef1ca32a0bc3bb757bd707 +Author: Lasse Collin +Date: 2022-08-22 16:46:18 +0300 + + CMake: Add liblzma tests. + + Thanks to Jia Tan for the patch. + + CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 52 insertions(+), 1 deletion(-) + +commit 02a777f9c422d3b5ec895078530bb1a2b6f7bdf5 +Author: Lasse Collin +Date: 2022-08-19 23:32:22 +0300 + + xz: Revise --info-memory output. + + The strings could be more descriptive but it's good + to have some version of this committed now. + + --robot mode wasn't changed yet. + + src/xz/hardware.c | 32 ++++++++++++++++++++++++++------ + src/xz/xz.1 | 1 + + 2 files changed, 27 insertions(+), 6 deletions(-) + +commit f864f6d42eab57ea8ed82cc2dd19a03b51377442 +Author: Lasse Collin +Date: 2022-08-19 23:12:02 +0300 + + xz: Update the man page for threaded decompression and memlimits. + + This documents the changes made in commits + 6c6da57ae2aa962aabde6892442227063d87e88c, + cad299008cf73ec566f0662a9cf2b94f86a99659, and + 898faa97287a756231c663a3ed5165672b417207. + + The --info-memory bit hasn't been finished yet + even though it's already mentioned in this commit + under --memlimit-mt-decompress and --threads. + + src/xz/xz.1 | 148 +++++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 121 insertions(+), 27 deletions(-) + +commit d13bfcc0056617dd648f655a01653932fad7067f +Author: Lasse Collin +Date: 2022-08-18 17:49:16 +0300 + + Build: Include the CMake files in the distribution. + + This was supposed to be done in 2020 with 5.2.5 release + already but it was noticed only today. 5.2.5 and 5.2.6 + even mention experiemental CMake support in the NEWS entries. + + Thanks to Olivier B. for reporting the problem. + + Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +commit e66787bcfefdb93f19c974f895f65969a77937b0 +Author: Lasse Collin +Date: 2022-08-18 17:38:05 +0300 + + Windows: Fix broken liblzma.dll build with Visual Studio project files. + + The bug was introduced in 352ba2d69af2136bc814aa1df1a132559d445616 + "Windows: Fix building of resource files when config.h isn't used." + + That commit fixed liblzma.dll build with CMake while keeping it + working with Autotools on Windows but the VS project files were + forgotten. + + I haven't tested these changes. + + Thanks to Olivier B. for reporting the bug and for the initial patch. + + windows/vs2013/liblzma_dll.vcxproj | 6 ++++++ + windows/vs2017/liblzma_dll.vcxproj | 6 ++++++ + windows/vs2019/liblzma_dll.vcxproj | 6 ++++++ + 3 files changed, 18 insertions(+) + +commit c4e8e5fb311225b8b48d34157891a640b2535e0c +Author: Lasse Collin +Date: 2022-08-18 17:16:49 +0300 + + liblzma: Threaded decoder: Improve LZMA_FAIL_FAST when LZMA_FINISH is used. + + It will now return LZMA_DATA_ERROR (not LZMA_OK or LZMA_BUF_ERROR) + if LZMA_FINISH is used and there isn't enough input to finish + decoding the Block Header or the Block. The use of LZMA_DATA_ERROR + is simpler and the less risky than LZMA_BUF_ERROR but this might + be changed before 5.4.0. + + src/liblzma/api/lzma/container.h | 6 +++++ + src/liblzma/common/stream_decoder_mt.c | 42 ++++++++++++++++++++++++++++++++++ + 2 files changed, 48 insertions(+) + +commit 6dcf606e7efa2b259f0262f9e2f61e00116842d3 +Author: Lasse Collin +Date: 2022-08-12 18:31:47 +0300 + + Add NEWS for 5.2.6. + + NEWS | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 121 insertions(+) + +commit 413b86fcf8934fae5a004f378a9483d37d8fcaab +Author: Lasse Collin +Date: 2022-08-12 14:28:41 +0300 + + Add Jia Tan to AUTHORS. + + AUTHORS | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 352672732c346c546ff3c26d0605bc0ed1c8b7c7 +Author: Lasse Collin +Date: 2022-07-25 19:28:26 +0300 + + Build: Start the generated ChangeLog from around 5.2.0 instead of 5.0.0. + + This makes ChangeLog smaller. + + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6f6d11225d6016be2bbb55d845b66f6b04d048df +Author: Lasse Collin +Date: 2022-07-25 19:11:05 +0300 + + Translations: Change the copyright comment string to use with po4a. + + This affects the second line in po4a/xz-man.pot. The man pages of + xzdiff, xzgrep, and xzmore are from GNU gzip and under GNU GPLv2+ + while the rest of the man pages are in the public domain. + + po4a/update-po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 61f8ec804abdb4c5dac01e8ae9b90c7be58a5c24 +Author: Jia Tan +Date: 2022-07-25 18:30:05 +0300 + + liblzma: Refactor lzma_mf_is_supported() to use a switch-statement. + + src/liblzma/lz/lz_encoder.c | 32 ++++++++++++++------------------ + 1 file changed, 14 insertions(+), 18 deletions(-) + +commit 4d80b463a1251aa22eabc87d2732fec13b1adda6 +Author: Jia Tan +Date: 2022-07-25 18:20:01 +0300 + + Build: Don't allow empty LIST in --enable-match-finders=LIST. + + It's enforced only when a match finder is needed, that is, + when LZMA1 or LZMA2 encoder is enabled. + + configure.ac | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 9cc721af5436908f2d5a828aebbc4050a32a3487 +Author: Lasse Collin +Date: 2022-07-24 13:27:48 +0300 + + xz: Update the man page that change to --keep will be in 5.2.6. + + src/xz/xz.1 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b81bf0c7d1873e52a4086a9abb494471d652cb55 +Author: Lasse Collin +Date: 2022-07-19 23:23:54 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 340cf1ec3927767046b8293a49da3db4e393f426 +Author: Nicholas Jackson +Date: 2022-07-17 17:39:23 -0700 + + CMake: Add missing source file to liblzma build + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit d796b6d7fdb8b7238b277056cf9146cce25db604 +Author: Lasse Collin +Date: 2022-07-19 23:19:49 +0300 + + xzgrep man page: Document exit statuses. + + src/scripts/xzgrep.1 | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +commit 923bf96b55e5216a6c8df9d8331934f54784390e +Author: Lasse Collin +Date: 2022-07-19 23:13:24 +0300 + + xzgrep: Improve error handling, especially signals. + + xzgrep wouldn't exit on SIGPIPE or SIGQUIT when it clearly + should have. It's quite possible that it's not perfect still + but at least it's much better. + + If multiple exit statuses compete, now it tries to pick + the largest of value. + + Some comments were added. + + The exit status handling of signals is still broken if the shell + uses values larger than 255 in $? to indicate that a process + died due to a signal ***and*** their "exit" command doesn't take + this into account. This seems to work well with the ksh and yash + versions I tried. However, there is a report in gzip/zgrep that + OpenSolaris 5.11 (not 5.10) has a problem with "exit" truncating + the argument to 8 bits: + + https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22900#25 + + Such a bug would break xzgrep but I didn't add a workaround + at least for now. 5.11 is old and I don't know if the problem + exists in modern descendants, or if the problem exists in other + ksh implementations in use. + + src/scripts/xzgrep.in | 72 +++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 53 insertions(+), 19 deletions(-) + +commit a648978b20495b7aa4a8b029c5a810b5ad9d08ff +Author: Lasse Collin +Date: 2022-07-19 00:10:55 +0300 + + xzgrep: Make the fix for ZDI-CAN-16587 more robust. + + I don't know if this can make a difference in the real world + but it looked kind of suspicious (what happens with sed + implementations that cannot process very long lines?). + At least this commit shouldn't make it worse. + + src/scripts/xzgrep.in | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit bd7b290f3fe4faeceb7d3497ed9bf2e6ed5e7dc5 +Author: Lasse Collin +Date: 2022-07-18 21:52:31 +0300 + + xzgrep: Use grep -H --label when available (GNU, *BSDs). + + It avoids the use of sed for prefixing filenames to output lines. + Using sed for that is slower and prone to security bugs so now + the sed method is only used as a fallback. + + This also fixes an actual bug: When grepping a binary file, + GNU grep nowadays prints its diagnostics to stderr instead of + stdout and thus the sed-method for prefixing the filename doesn't + work. So with this commit grepping binary files gives reasonable + output with GNU grep now. + + This was inspired by zgrep but the implementation is different. + + src/scripts/xzgrep.in | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit b56729af9f1a596e57aeefd7570d8d7dce5c9f52 +Author: Lasse Collin +Date: 2022-07-18 21:10:25 +0300 + + xzgrep: Use -e to specify the pattern to grep. + + Now we don't need the separate test for adding the -q option + as it can be added directly in the two places where it's needed. + + src/scripts/xzgrep.in | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +commit bad61b5997e6647911974022bfb72f3d4818a594 +Author: Lasse Collin +Date: 2022-07-18 19:18:48 +0300 + + Scripts: Use printf instead of echo in a few places. + + It's a good habbit as echo has some portability corner cases + when the string contents can be anything. + + src/scripts/xzdiff.in | 6 +++--- + src/scripts/xzgrep.in | 4 ++-- + src/scripts/xzless.in | 4 ++-- + src/scripts/xzmore.in | 8 ++++---- + 4 files changed, 11 insertions(+), 11 deletions(-) + +commit 6a4a4a7d2667837dc824c26fcb19ed6ca5aff645 +Author: Lasse Collin +Date: 2022-07-17 21:36:25 +0300 + + xzgrep: Add more LC_ALL=C to avoid bugs with multibyte characters. + + Also replace one use of expr with printf. + + The rationale for LC_ALL=C was already mentioned in + 69d1b3fc29677af8ade8dc15dba83f0589cb63d6 that fixed a security + issue. However, unrelated uses weren't changed in that commit yet. + + POSIX says that with sed and such tools one should use LC_ALL=C + to ensure predictable behavior when strings contain byte sequences + that aren't valid multibyte characters in the current locale. See + under "Application usage" in here: + + https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html + + With GNU sed invalid multibyte strings would work without this; + it's documented in its Texinfo manual. Some other implementations + aren't so forgiving. + + src/scripts/xzgrep.in | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit b48f9d615f2c2e8d2f6e253d0e48ee66d0652b68 +Author: Lasse Collin +Date: 2022-07-17 20:55:16 +0300 + + xzgrep: Fix parsing of certain options. + + Fix handling of "xzgrep -25 foo" (in GNU grep "grep -25 foo" is + an alias for "grep -C25 foo"). xzgrep would treat "foo" as filename + instead of as a pattern. This bug was fixed in zgrep in gzip in 2012. + + Add -E, -F, -G, and -P to the "no argument required" list. + + Add -X to "argument required" list. It is an + intentionally-undocumented GNU grep option so this isn't + an important option for xzgrep but it seems that other grep + implementations (well, those that I checked) don't support -X + so I hope this change is an improvement still. + + grep -d (grep --directories=ACTION) requires an argument. In + contrast to zgrep, I kept -d in the "no argument required" list + because it's not supported in xzgrep (or zgrep). This way + "xzgrep -d" gives an error about option being unsupported instead + of telling that it requires an argument. Both zgrep and xzgrep + tell that it's unsupported if an argument is specified. + + Add comments. + + src/scripts/xzgrep.in | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +commit 2d2201bc6315deda4d43625aa510972467bd51d4 +Author: Lasse Collin +Date: 2022-07-14 20:33:05 +0300 + + Tests: Add the .lzma files to test_files.sh. + + tests/test_files.sh | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit ce5549a591bf126300618879f5b24023351baff6 +Author: Lasse Collin +Date: 2022-07-14 19:37:42 +0300 + + Tests: Add .lzma test files. + + tests/files/README | 63 ++++++++++++++++----- + tests/files/bad-too_big_size-with_eopm.lzma | Bin 0 -> 37 bytes + tests/files/bad-too_small_size-without_eopm-1.lzma | Bin 0 -> 31 bytes + tests/files/bad-too_small_size-without_eopm-2.lzma | Bin 0 -> 31 bytes + tests/files/bad-too_small_size-without_eopm-3.lzma | Bin 0 -> 36 bytes + tests/files/bad-unknown_size-without_eopm.lzma | Bin 0 -> 31 bytes + tests/files/good-known_size-with_eopm.lzma | Bin 0 -> 37 bytes + tests/files/good-known_size-without_eopm.lzma | Bin 0 -> 31 bytes + tests/files/good-unknown_size-with_eopm.lzma | Bin 0 -> 37 bytes + 9 files changed, 50 insertions(+), 13 deletions(-) + +commit 107c93ee5cad51a6ea0cee471209bfe8d76deaa3 +Author: Lasse Collin +Date: 2022-07-14 18:12:38 +0300 + + liblzma: Rename a variable and improve a comment. + + src/liblzma/lzma/lzma_decoder.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 511feb5eadb988d641b025d597f4fac7502003b8 +Author: Lasse Collin +Date: 2022-07-13 22:24:41 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 9595a3119b9faf0ce01375329cad8bbf85c35ea2 +Author: Lasse Collin +Date: 2022-07-13 22:24:07 +0300 + + liblzma: Add optional autodetection of LZMA end marker. + + Turns out that this is needed for .lzma files as the spec in + LZMA SDK says that end marker may be present even if the size + is stored in the header. Such files are rare but exist in the + real world. The code in liblzma is so old that the spec didn't + exist in LZMA SDK back then and I had understood that such + files weren't possible (the lzma tool in LZMA SDK didn't + create such files). + + This modifies the internal API so that LZMA decoder can be told + if EOPM is allowed even when the uncompressed size is known. + It's allowed with .lzma and not with other uses. + + Thanks to Karl Beldan for reporting the problem. + + doc/lzma-file-format.txt | 11 +++- + src/liblzma/common/alone_decoder.c | 2 +- + src/liblzma/common/microlzma_decoder.c | 2 +- + src/liblzma/lz/lz_decoder.c | 10 +++- + src/liblzma/lz/lz_decoder.h | 8 +-- + src/liblzma/lzma/lzma2_decoder.c | 2 +- + src/liblzma/lzma/lzma_decoder.c | 99 ++++++++++++++++++++++++---------- + 7 files changed, 95 insertions(+), 39 deletions(-) + +commit 0c0f8e9761eb6eaf199082cf144db7ac5f9d8cb2 +Author: Lasse Collin +Date: 2022-07-12 18:53:04 +0300 + + xz: Document the special memlimit case of 2000 MiB on MIPS32. + + See commit fc3d3a7296ef58bb799a73943636b8bfd95339f7. + + src/xz/xz.1 | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit d1bfa3dc703325ecd974167e864a8712fdfe936e +Author: Jia Tan +Date: 2022-07-01 21:19:26 +0800 + + Created script to generate code coverage reports. + + The script uses lcov and genhtml after running the tests + to show the code coverage statistics. The script will create + a coverage directory where it is run. It can be run both in + and out of the source directory. + + .gitignore | 4 +++ + tests/code_coverage.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 83 insertions(+) + +commit 86a30b0255d8064169fabfd213d907016d2f9f2a +Author: Jia Tan +Date: 2022-06-16 17:32:19 +0300 + + Tests: Add more tests into test_check. + + tests/test_check.c | 279 +++++++++++++++++++++++++++++++++++++++++++++++++++-- + tests/tests.h | 23 +++++ + 2 files changed, 295 insertions(+), 7 deletions(-) + +commit 82e30fed66a89706388a8c15dc954d84e63f38fa +Author: Lasse Collin +Date: 2022-06-16 15:02:57 +0300 + + Tests: Use char[][24] array for enum_strings_lzma_ret. + + Array of pointers to short strings is a bit pointless here + and now it's fully const. + + tests/tests.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5ba9459e6c4a29f6870ca78ce8ac6e519d59c41e +Author: Lasse Collin +Date: 2022-06-16 14:12:14 +0300 + + Tests: tuktest.h: Add tuktest_error_impl to help with error conditions. + + tests/tuktest.h | 72 +++++++++++++++++++++++++-------------------------------- + 1 file changed, 32 insertions(+), 40 deletions(-) + +commit b339892668da20aea22a93668c82b87a38e4a97f +Author: Lasse Collin +Date: 2022-06-16 13:29:59 +0300 + + Tests: tuktest.h: Rename file_from_* and use tuktest_malloc there. + + tests/test_bcj_exact_size.c | 4 +--- + tests/tuktest.h | 52 +++++++++++++++++++++------------------------ + 2 files changed, 25 insertions(+), 31 deletions(-) + +commit d8b63a0ad68d1c461eb373466679ebc41fbc207d +Author: Lasse Collin +Date: 2022-06-16 13:08:19 +0300 + + Tests: tuktest.h: Add malloc wrapper with automatic freeing. + + tests/tuktest.h | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 124 insertions(+) + +commit 1d51536a4b19a8fae768f8eb462fc2238cb36d53 +Author: Lasse Collin +Date: 2022-06-16 11:47:37 +0300 + + Tests: tuktest.h: Move a function. + + tests/tuktest.h | 44 ++++++++++++++++++++++---------------------- + 1 file changed, 22 insertions(+), 22 deletions(-) + +commit 70c7555f6403553ee35539e869de0025592d8564 +Author: Lasse Collin +Date: 2022-06-14 22:21:15 +0300 + + Tests: test_vli: Remove an invalid test-assertion. + + lzma_vli is unsigned so trying a signed value results in + a compiler warning from -Wsign-conversion. (lzma_vli)-1 + equals to LZMA_VLI_UNKNOWN anyway which is the next assertion. + + tests/test_vli.c | 2 -- + 1 file changed, 2 deletions(-) + +commit 154b73c5a1092c3f785e01666b564ad7ff1be555 +Author: Lasse Collin +Date: 2022-06-14 22:10:10 +0300 + + Tests: test_vli: Add const where appropriate. + + tests/test_vli.c | 53 ++++++++++++++++++++++++++++------------------------- + 1 file changed, 28 insertions(+), 25 deletions(-) + +commit 0354d6cce3ff98ea6f927107baf216253f6ce2bb +Author: Jia Tan +Date: 2022-06-13 20:27:03 +0800 + + Added vli tests to .gitignore + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit a08f5ccf6bdc20ef70e41f6f3321618ef146f96e +Author: Jia Tan +Date: 2022-06-12 11:31:40 +0800 + + Created tests for all functions exported in vli.h + + Achieved 100% code coverage vli_encoder.c, vli_decoder.c, and vli_size.c + + tests/Makefile.am | 4 +- + tests/test_vli.c | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 311 insertions(+), 1 deletion(-) + +commit 1e3eb61815a91c0a1bfbb802e2d95593f523491f +Author: jiat75 +Date: 2022-06-03 21:24:54 +0800 + + Added parallel test artifacts to .gitignore + + .gitignore | 2 ++ + 1 file changed, 2 insertions(+) + +commit 00e3613f1212eaa84e721585fdb4de6967cf2476 +Author: Lasse Collin +Date: 2022-06-14 21:29:21 +0300 + + Tests: Use good-1-empty-bcj-lzma2.xz in test_bcj_exact_size. + + It's much nicer this way so that the test data isn't a hardcoded + table inside the C file. + + tests/test_bcj_exact_size.c | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +commit 86bab755be252bfd3e0a9aee8e7b83a9bbb23ed0 +Author: Lasse Collin +Date: 2022-06-14 21:26:13 +0300 + + Tests: Add file reading helpers to tuktest.h. + + tests/tuktest.h | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 176 insertions(+), 7 deletions(-) + +commit 83d2337b72dbf391c6f3b41889eea99e51679105 +Author: Lasse Collin +Date: 2022-06-14 18:21:57 +0300 + + Tests: tuktest.h: Move a printf from a macro to a helper function. + + tests/tuktest.h | 26 ++++++++++++++++++-------- + 1 file changed, 18 insertions(+), 8 deletions(-) + +commit f9e8176ea7d520797a2db2d49a5a632c285674a8 +Author: Lasse Collin +Date: 2022-06-14 17:20:49 +0300 + + Tests: Add test file good-1-empty-bcj-lzma2.xz. + + This is from test_bcj_exact_size.c. + It's good to have it as a standalone file. + + tests/files/README | 5 +++++ + tests/files/good-1-empty-bcj-lzma2.xz | Bin 0 -> 52 bytes + 2 files changed, 5 insertions(+) + +commit aa75c5563a760aea3aa23d997d519e702e82726b +Author: Jia Tan +Date: 2022-06-10 21:35:18 +0800 + + Tests: Created tests for hardware functions. + + Created tests for all API functions exported in + src/liblzma/api/lzma/hardware.h. The tests are fairly trivial + but are helpful because they will inform users if their machines + cannot support these functions. They also improve the code + coverage metrics. + + .gitignore | 1 + + tests/Makefile.am | 2 ++ + tests/test_hardware.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 48 insertions(+) + +commit 5c8ffdca20813939818843476fb212dfae8838a3 +Author: Lasse Collin +Date: 2022-06-02 21:01:45 +0300 + + Tests: Convert test_check to tuktest. + + Thanks to Jia Tan for help with all the tests. + + tests/test_check.c | 67 +++++++++++++++++++++++++++--------------------------- + 1 file changed, 33 insertions(+), 34 deletions(-) + +commit faf5ff8899d539b4dcd2a7e5280cb820a4746c86 +Author: Lasse Collin +Date: 2022-06-02 20:31:03 +0300 + + Tests: Convert test_block_header to tuktest. + + tests/test_block_header.c | 89 +++++++++++++++++++++++++++-------------------- + 1 file changed, 52 insertions(+), 37 deletions(-) + +commit 754d39fbebee3782258d42f154a223d3c5770ec7 +Author: Lasse Collin +Date: 2022-06-02 20:28:23 +0300 + + Tests: Convert test_bcj_exact_size to tuktest. + + The compress() and decompress() functions were merged because + the later depends on the former so they need to be a single + test case. + + tests/test_bcj_exact_size.c | 75 +++++++++++++++++++++++++-------------------- + 1 file changed, 41 insertions(+), 34 deletions(-) + +commit 96da21470f9570cd08286906a050a7c22631775b +Author: Lasse Collin +Date: 2022-06-02 20:27:00 +0300 + + Tests: Include tuktest.h in tests.h. + + This breaks -Werror because none of the tests so far use + tuktest.h and thus there are warnings about unused variables + and functions. + + tests/tests.h | 47 +++++++++++++++++++++++------------------------ + 1 file changed, 23 insertions(+), 24 deletions(-) + +commit df71ba1c991f60c3269aaadd398247e632714626 +Author: Lasse Collin +Date: 2022-06-02 20:25:21 +0300 + + Tests: Add tuktest.h mini-test-framework. + + tests/Makefile.am | 1 + + tests/tuktest.h | 752 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 753 insertions(+) + +commit 4773608554d1b684a05ff9c1d879cf5c42266d33 +Author: Lasse Collin +Date: 2022-05-23 21:31:36 +0300 + + Build: Enable Automake's parallel test harness. + + It has been the default for quite some time already and + the old serial harness isn't discouraged. The downside is + that with parallel tests one cannot print progress info or + other diagnostics to the terminal; all output from the tests + will be in the log files only. But now that the compression + tests are separated the parallel tests will speed things up. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9a6dd6d46f7f256a5573e5d874c1052033ed7b05 +Author: Lasse Collin +Date: 2022-05-23 21:17:47 +0300 + + Tests: Split test_compress.sh into separate test unit for each file. + + test_compress.sh now takes one command line argument: + a filename to be tested. If it begins with "compress_generated_" + the file will be created with create_compress_files. + + This will allow parallel execution of the slow tests. + + tests/Makefile.am | 11 +++- + tests/test_compress.sh | 91 +++++++++++++++++++--------------- + tests/test_compress_generated_abc | 3 ++ + tests/test_compress_generated_random | 3 ++ + tests/test_compress_generated_text | 3 ++ + tests/test_compress_prepared_bcj_sparc | 3 ++ + tests/test_compress_prepared_bcj_x86 | 3 ++ + 7 files changed, 77 insertions(+), 40 deletions(-) + +commit c7758ac9c734707514dd34f254173ebac5eea7f8 +Author: Lasse Collin +Date: 2022-05-23 20:32:49 +0300 + + Test: Make create_compress_files.c a little more flexible. + + If a command line argument is given, then only the test file + of that type is created. It's quite dumb in sense that unknown + names don't give an error but it's good enough here. + + Also use EXIT_FAILURE instead of 1 as exit status for errors. + + tests/create_compress_files.c | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +commit 4a8e4a7b0ad4b03c0ac6862716c3457452cdaf8c +Author: Lasse Collin +Date: 2022-05-23 20:17:42 +0300 + + Tests: Remove unneeded commented lines from test_compress.sh. + + tests/test_compress.sh | 13 ------------- + 1 file changed, 13 deletions(-) + +commit 2ee50d150ee009f36135540b459e6ff328549725 +Author: Lasse Collin +Date: 2022-05-23 20:16:00 +0300 + + Tests: Remove progress indicator from test_compress.sh. + + It will be useless with Automake's parallel tests. + + tests/test_compress.sh | 9 --------- + 1 file changed, 9 deletions(-) + +commit 2ce4f36f179a81d0c6e182a409f363df759d1ad0 +Author: Lasse Collin +Date: 2022-05-23 19:37:18 +0300 + + liblzma: Silence a warning. + + The actual initialization is done via mythread_sync and seems + that GCC doesn't necessarily see that it gets initialized there. + + src/liblzma/common/stream_decoder_mt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5d8f3764ef43c35910e6d7003c0900a961ef6544 +Author: Lasse Collin +Date: 2022-04-14 20:53:16 +0300 + + xz: Fix build with --disable-threads. + + src/xz/hardware.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 1d592897278b172d8549aa29c3a1f3a4f432a9b9 +Author: Lasse Collin +Date: 2022-04-14 14:50:17 +0300 + + xz: Change the cap of the default -T0 memlimit for 32-bit xz. + + The SIZE_MAX / 3 was 1365 MiB. 1400 MiB gives little more room + and it looks like a round (artificial) number in --info-memory + once --info-memory is made to display it. + + Also, using #if avoids useless code on 64-bit builds. + + src/xz/hardware.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit c77fe55ddb7752ed0fec46967c5ec9a72632ea0c +Author: Lasse Collin +Date: 2022-04-14 14:20:46 +0300 + + xz: Add a default soft memory usage limit for --threads=0. + + This is a soft limit in sense that it only affects the number of + threads. It never makes xz fail and it never makes xz change + settings that would affect the compressed output. + + The idea is to make -T0 have more reasonable behavior when + the system has very many cores or when a memory-hungry + compression options are used. This also helps with 32-bit xz, + preventing it from running out of address space. + + The downside of this commit is that now the number of threads + might become too low compared to what the user expected. I + hope this to be an acceptable compromise as the old behavior + has been a source of well-argued complaints for a long time. + + src/xz/coder.c | 28 ++++++++++++++++++++++++++-- + src/xz/hardware.c | 38 +++++++++++++++++++++++++++++--------- + src/xz/hardware.h | 27 +++++++++++++++++++++++++++ + 3 files changed, 82 insertions(+), 11 deletions(-) + +commit 0adc13bfe32c14f3e4c6ce9f2d4fdf4112ab53f4 +Author: Lasse Collin +Date: 2022-04-14 12:59:09 +0300 + + xz: Make -T0 use multithreaded mode on single-core systems. + + The main problem withi the old behavior is that the compressed + output is different on single-core systems vs. multicore systems. + This commit fixes it by making -T0 one thread in multithreaded mode + on single-core systems. + + The downside of this is that it uses more memory. However, if + --memlimit-compress is used, xz can (thanks to the previous commit) + drop to the single-threaded mode still. + + src/xz/coder.c | 18 +++++++++--------- + src/xz/hardware.c | 14 ++++++++++++++ + src/xz/hardware.h | 4 ++++ + 3 files changed, 27 insertions(+), 9 deletions(-) + +commit 898faa97287a756231c663a3ed5165672b417207 +Author: Lasse Collin +Date: 2022-04-14 12:38:00 +0300 + + xz: Changes to --memlimit-compress and --no-adjust. + + In single-threaded mode, --memlimit-compress can make xz scale down + the LZMA2 dictionary size to meet the memory usage limit. This + obviously affects the compressed output. However, if xz was in + threaded mode, --memlimit-compress could make xz reduce the number + of threads but it wouldn't make xz switch from multithreaded mode + to single-threaded mode or scale down the LZMA2 dictionary size. + This seemed illogical and there was even a "FIXME?" about it. + + Now --memlimit-compress can make xz switch to single-threaded + mode if one thread in multithreaded mode uses too much memory. + If memory usage is still too high, then the LZMA2 dictionary + size can be scaled down too. + + The option --no-adjust was also changed so that it no longer + prevents xz from scaling down the number of threads as that + doesn't affect compressed output (only performance). After + this commit --no-adjust only prevents adjustments that affect + compressed output, that is, with --no-adjust xz won't switch + from multithreaded mode to single-threaded mode and won't + scale down the LZMA2 dictionary size. + + The man page wasn't updated yet. + + src/xz/coder.c | 63 +++++++++++++++++++++++++++++++++++++++------------------- + 1 file changed, 43 insertions(+), 20 deletions(-) + +commit cad299008cf73ec566f0662a9cf2b94f86a99659 +Author: Lasse Collin +Date: 2022-04-11 22:20:49 +0300 + + xz: Add --memlimit-mt-decompress along with a default limit value. + + --memlimit-mt-decompress allows specifying the limit for + multithreaded decompression. This matches memlimit_threading in + liblzma. This limit can only affect the number of threads being + used; it will never prevent xz from decompressing a file. The + old --memlimit-decompress option is still used at the same time. + + If the value of --memlimit-decompress (the default value or + one specified by the user) is less than the value of + --memlimit-mt-decompress , then --memlimit-mt-decompress is + reduced to match --memlimit-decompress. + + Man page wasn't updated yet. + + src/xz/args.c | 24 +++++++++++++++------- + src/xz/coder.c | 34 ++++++++++--------------------- + src/xz/hardware.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++----- + src/xz/hardware.h | 17 ++++++++++------ + src/xz/message.c | 4 +++- + 5 files changed, 97 insertions(+), 42 deletions(-) + +commit fe87b4cd5364f5bbb6a75a0299f1500c852d7c9a +Author: Lasse Collin +Date: 2022-04-06 23:11:59 +0300 + + liblzma: Threaded decoder: Improve setting of pending_error. + + It doesn't need to be done conditionally. The comments try + to explain it. + + src/liblzma/common/stream_decoder_mt.c | 51 +++++++++++++++++++++++----------- + 1 file changed, 35 insertions(+), 16 deletions(-) + +commit 90621da7f6e1bfd6d91d60415eae04b2bca274c2 +Author: Lasse Collin +Date: 2022-04-06 12:39:49 +0300 + + liblzma: Add a new flag LZMA_FAIL_FAST for threaded decoder. + + In most cases if the input file is corrupt the application won't + care about the uncompressed content at all. With this new flag + the threaded decoder will return an error as soon as any thread + has detected an error; it won't wait to copy out the data before + the location of the error. + + I don't plan to use this in xz to keep the behavior consistent + between single-threaded and multi-threaded modes. + + src/liblzma/api/lzma/container.h | 25 ++++++++++++++++- + src/liblzma/common/common.h | 7 +++-- + src/liblzma/common/stream_decoder_mt.c | 50 +++++++++++++++++++--------------- + 3 files changed, 56 insertions(+), 26 deletions(-) + +commit 64b6d496dc815a176d8307f418f6834a26783484 +Author: Lasse Collin +Date: 2022-04-05 12:24:57 +0300 + + liblzma: Threaded decoder: Always wait for output if LZMA_FINISH is used. + + This makes the behavior consistent with the single-threaded + decoder when handling truncated .xz files. + + Thanks to Jia Tan for finding this issue. + + src/liblzma/common/stream_decoder_mt.c | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +commit e671bc8828b9c0c5406c3a22c541301d0eb54518 +Author: Lasse Collin +Date: 2022-04-02 21:49:59 +0300 + + liblzma: Threaded decoder: Support zpipe.c-style decoding loop. + + This makes it possible to call lzma_code() in a loop that only + reads new input when lzma_code() didn't fill the output buffer + completely. That isn't the calling style suggested by the + liblzma example program 02_decompress.c so perhaps the usefulness + of this feature is limited. + + Also, it is possible to write such a loop so that it works + with the single-threaded decoder but not with the threaded + decoder even after this commit, or so that it works only if + lzma_mt.timeout = 0. + + The zlib tutorial is a well-known + example of a loop where more input is read only when output isn't + full. Porting this as is to liblzma would work with the + single-threaded decoder (if LZMA_CONCATENATED isn't used) but it + wouldn't work with threaded decoder even after this commit because + the loop assumes that no more output is possible when it cannot + read more input ("if (strm.avail_in == 0) break;"). This cannot + be fixed at liblzma side; the loop has to be modified at least + a little. + + I'm adding this in any case because the actual code is simple + and short and should have no harmful side-effects in other + situations. + + src/liblzma/common/stream_decoder_mt.c | 77 +++++++++++++++++++++++++++++----- + 1 file changed, 67 insertions(+), 10 deletions(-) + +commit 2ba8173e27be4793edb46497e499ac2ae753a316 +Author: Lasse Collin +Date: 2022-03-31 00:05:07 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 69d1b3fc29677af8ade8dc15dba83f0589cb63d6 +Author: Lasse Collin +Date: 2022-03-29 19:19:12 +0300 + + xzgrep: Fix escaping of malicious filenames (ZDI-CAN-16587). + + Malicious filenames can make xzgrep to write to arbitrary files + or (with a GNU sed extension) lead to arbitrary code execution. + + xzgrep from XZ Utils versions up to and including 5.2.5 are + affected. 5.3.1alpha and 5.3.2alpha are affected as well. + This patch works for all of them. + + This bug was inherited from gzip's zgrep. gzip 1.12 includes + a fix for zgrep. + + The issue with the old sed script is that with multiple newlines, + the N-command will read the second line of input, then the + s-commands will be skipped because it's not the end of the + file yet, then a new sed cycle starts and the pattern space + is printed and emptied. So only the last line or two get escaped. + + One way to fix this would be to read all lines into the pattern + space first. However, the included fix is even simpler: All lines + except the last line get a backslash appended at the end. To ensure + that shell command substitution doesn't eat a possible trailing + newline, a colon is appended to the filename before escaping. + The colon is later used to separate the filename from the grep + output so it is fine to add it here instead of a few lines later. + + The old code also wasn't POSIX compliant as it used \n in the + replacement section of the s-command. Using \ is the + POSIX compatible method. + + LC_ALL=C was added to the two critical sed commands. POSIX sed + manual recommends it when using sed to manipulate pathnames + because in other locales invalid multibyte sequences might + cause issues with some sed implementations. In case of GNU sed, + these particular sed scripts wouldn't have such problems but some + other scripts could have, see: + + info '(sed)Locale Considerations' + + This vulnerability was discovered by: + cleemy desu wayo working with Trend Micro Zero Day Initiative + + Thanks to Jim Meyering and Paul Eggert discussing the different + ways to fix this and for coordinating the patch release schedule + with gzip. + + src/scripts/xzgrep.in | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +commit bd93b776c1bd15e90661033c918cdeb354dbcc38 +Author: Lasse Collin +Date: 2022-03-26 01:02:44 +0200 + + liblzma: Fix a deadlock in threaded decoder. + + If a worker thread has consumed all input so far and it's + waiting on thr->cond and then the main thread enables + partial update for that thread, the code used to deadlock. + This commit allows one dummy decoding pass to occur in this + situation which then also does the partial update. + + As part of the fix, this moves thr->progress_* updates to + avoid the second thr->mutex locking. + + Thanks to Jia Tan for finding, debugging, and reporting the bug. + + src/liblzma/common/stream_decoder_mt.c | 71 +++++++++++++++++++++++++--------- + 1 file changed, 52 insertions(+), 19 deletions(-) + +commit e0394e94230f208682ac1e1f4c41f22f9ad79916 +Author: Lasse Collin +Date: 2022-03-23 16:34:00 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 487c77d48760564b1949c5067630b675b87be4de +Author: Lasse Collin +Date: 2022-03-23 16:28:55 +0200 + + liblzma: Threaded decoder: Don't stop threads on LZMA_TIMED_OUT. + + LZMA_TIMED_OUT is not an error and thus stopping threads on + LZMA_TIMED_OUT breaks the decoder badly. + + Thanks to Jia Tan for finding the bug and for the patch. + + src/liblzma/common/stream_decoder_mt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6c6da57ae2aa962aabde6892442227063d87e88c +Author: Lasse Collin +Date: 2022-03-07 00:36:16 +0200 + + xz: Add initial support for threaded decompression. + + If threading support is enabled at build time, this will + use lzma_stream_decoder_mt() even for single-threaded mode. + With memlimit_threading=0 the behavior should be identical. + + This needs some work like adding --memlimit-threading=LIMIT. + + The original patch from Sebastian Andrzej Siewior included + a method to get currently available RAM on Linux. It might + be one way to go but as it is Linux-only, the available-RAM + approach needs work for portability or using a fallback method + on other OSes. + + The man page wasn't updated yet. + + src/xz/coder.c | 36 +++++++++++++++++++++++++++++++++++- + 1 file changed, 35 insertions(+), 1 deletion(-) + +commit 4cce3e27f529af33e0e7749a8cbcec59954946b5 +Author: Lasse Collin +Date: 2022-03-06 23:36:20 +0200 + + liblzma: Add threaded .xz decompressor. + + I realize that this is about a decade late. + + Big thanks to Sebastian Andrzej Siewior for the original patch. + I made a bunch of smaller changes but after a while quite a few + things got rewritten. So any bugs in the commit were created by me. + + src/liblzma/api/lzma/container.h | 90 +- + src/liblzma/common/Makefile.inc | 5 + + src/liblzma/common/common.h | 4 + + src/liblzma/common/stream_decoder_mt.c | 1814 ++++++++++++++++++++++++++++++++ + src/liblzma/liblzma.map | 1 + + 5 files changed, 1907 insertions(+), 7 deletions(-) + +commit 717631b9788dc9c100ee0c87d3c14a2782638ff4 +Author: Lasse Collin +Date: 2022-03-06 16:54:23 +0200 + + liblzma: Fix docs: lzma_block_decoder() cannot return LZMA_UNSUPPORTED_CHECK. + + If Check is unsupported, it will be silently ignored. + It's the caller's job to handle it. + + src/liblzma/api/lzma/block.h | 3 --- + 1 file changed, 3 deletions(-) + +commit 1a4bb97a00936535e30ac61945aeee38882b5d1a +Author: Lasse Collin +Date: 2022-03-06 16:41:19 +0200 + + liblzma: Add new output queue (lzma_outq) features. + + Add lzma_outq_clear_cache2() which may leave one buffer allocated + in the cache. + + Add lzma_outq_outbuf_memusage() to get the memory needed for + a single lzma_outbuf. This is now used internally in outqueue.c too. + + Track both the total amount of memory allocated and the amount of + memory that is in active use (not in cache). + + In lzma_outbuf, allow storing the current input position that + matches the current output position. This way the main thread + can notice when no more output is possible without first providing + more input. + + Allow specifying return code for lzma_outq_read() in a finished + lzma_outbuf. + + src/liblzma/common/outqueue.c | 43 +++++++++++++++++++++++++++++++++++------- + src/liblzma/common/outqueue.h | 44 ++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 79 insertions(+), 8 deletions(-) + +commit ddbc6f58c2de388eed24cd7ea91b523d397da5f4 +Author: Lasse Collin +Date: 2022-03-06 15:18:58 +0200 + + liblzma: Index hash: Change return value type of hash_append() to void. + + src/liblzma/common/index_hash.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +commit 20e7a33e2d59c6a814447d3991f21e2702174b20 +Author: Lasse Collin +Date: 2022-02-22 03:42:57 +0200 + + liblzma: Minor addition to lzma_vli_size() API doc. + + Thanks to Jia Tan. + + src/liblzma/api/lzma/vli.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 4f78f5fcf63592f2d77e921cfe0d5de300867374 +Author: Lasse Collin +Date: 2022-02-22 02:04:18 +0200 + + liblzma: Check the return value of lzma_index_append() in threaded encoder. + + If lzma_index_append() failed (most likely memory allocation failure) + it could have gone unnoticed and the resulting .xz file would have + an incorrect Index. Decompressing such a file would produce the + correct uncompressed data but then an error would occur when + verifying the Index field. + + src/liblzma/common/stream_encoder_mt.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 5313ad66b40aab822ddca3e9905254cb99a4080d +Author: Lasse Collin +Date: 2022-02-22 01:37:39 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 865e0a3689a25a7ee8eecae1a34c1775e3aa676e +Author: Ed Maste +Date: 2022-02-11 15:25:46 +0000 + + liblzma: Use non-executable stack on FreeBSD as on Linux + + src/liblzma/check/crc32_x86.S | 4 ++-- + src/liblzma/check/crc64_x86.S | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 1c9a5786d206b4abc8e427326651c8174baea753 +Author: Lasse Collin +Date: 2022-02-20 20:36:27 +0200 + + liblzma: Make Block decoder catch certain types of errors better. + + Now it limits the input and output buffer sizes that are + passed to a raw decoder. This way there's no need to check + if the sizes can grow too big or overflow when updating + Compressed Size and Uncompressed Size counts. This also means + that a corrupt file cannot cause the raw decoder to process + useless extra input or output that would exceed the size info + in Block Header (and thus cause LZMA_DATA_ERROR anyway). + + More importantly, now the size information is verified more + carefully in case raw decoder returns LZMA_OK. This doesn't + really matter with the current single-threaded .xz decoder + as the errors would be detected slightly later anyway. But + this helps avoiding corner cases in the upcoming threaded + decompressor, and it might help other Block decoder uses + outside liblzma too. + + The test files bad-1-lzma2-{9,10,11}.xz test these conditions. + With the single-threaded .xz decoder the only difference is + that LZMA_DATA_ERROR is detected in a difference place now. + + src/liblzma/common/block_decoder.c | 79 ++++++++++++++++++++++++++------------ + 1 file changed, 54 insertions(+), 25 deletions(-) + +commit 555de11873eb00c9b94a8be70645db502e5a9dbd +Author: Lasse Collin +Date: 2022-02-20 19:38:55 +0200 + + Tests: Add bad-1-lzma2-11.xz. + + tests/files/README | 5 +++++ + tests/files/bad-1-lzma2-11.xz | Bin 0 -> 64 bytes + 2 files changed, 5 insertions(+) + +commit f0da507f22e7f4e3edb75b45b74d344244ca03fb +Author: Lasse Collin +Date: 2022-02-18 18:51:10 +0200 + + Translations: Fix po4a failure with the French man page translations. + + Thanks to Mario Blättermann for the patch. + + po4a/fr_FR.po | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit f7711d228c3c32395460c82498c60a9f730d0239 +Author: Lasse Collin +Date: 2022-02-07 01:14:37 +0200 + + Translations: Add French translation of man pages. + + This matches xz-utils 5.2.5-2 in Debian. + + The translation was done by "bubu", proofread by the debian-l10n-french + mailing list contributors, and submitted to me on the xz-devel mailing + list by Jean-Pierre Giraud. Thanks to everyone! + + po4a/fr_FR.po | 3541 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po4a/po4a.conf | 2 +- + 2 files changed, 3542 insertions(+), 1 deletion(-) + +commit 6468f7e41a8e9c611e4ba8d34e2175c5dacdbeb4 +Author: jiat75 +Date: 2022-01-28 20:47:55 +0800 + + liblzma: Add NULL checks to LZMA and LZMA2 properties encoders. + + Previously lzma_lzma_props_encode() and lzma_lzma2_props_encode() + assumed that the options pointers must be non-NULL because the + with these filters the API says it must never be NULL. It is + good to do these checks anyway. + + src/liblzma/lzma/lzma2_encoder.c | 3 +++ + src/liblzma/lzma/lzma_encoder.c | 3 +++ + 2 files changed, 6 insertions(+) + +commit 2523c30705f49eabd27b854aa656ae87cc224808 +Author: Lasse Collin +Date: 2022-02-06 23:19:32 +0200 + + liblzma: Fix uint64_t vs. size_t confusion. + + This broke 32-bit builds due to a pointer type mismatch. + + This bug was introduced with the output-size-limited encoding + in 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c. + + Thanks to huangqinjin for the bug report. + + src/liblzma/rangecoder/range_encoder.h | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 2bd36c91d03e03b31a4f12fd0afc100ae32d66e2 +Author: huangqinjin +Date: 2021-12-13 20:49:21 +0800 + + CMake: Keep compatible with Windows 95 for 32-bit build. + + CMakeLists.txt | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit 2024fbf2794885277d05378d40b2b8015a7c3b40 +Author: Lasse Collin +Date: 2021-11-13 21:04:05 +0200 + + xzgrep: Update man page timestamp. + + src/scripts/xzgrep.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 400e7a239a53282cedaad927a41f3463d7f542e5 +Author: Lasse Collin +Date: 2021-11-13 18:23:24 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 3a512c7787b2642ca946f4adc6e9a0a5d9b0d5a0 +Author: Ville Skyttä +Date: 2021-11-13 10:11:57 +0200 + + xzgrep: use `grep -E/-F` instead of `egrep` and `fgrep` + + `egrep` and `fgrep` have been deprecated in GNU grep since 2007, and in + current post 3.7 Git they have been made to emit obsolescence warnings: + https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1 + + src/scripts/xzgrep.1 | 8 ++++---- + src/scripts/xzgrep.in | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit edf525e2b1840dcaf377df472c67d8f11f8ace1b +Author: Lasse Collin +Date: 2021-10-28 23:02:11 +0300 + + Bump the version number for 5.3.2alpha. + + src/liblzma/api/lzma/version.h | 2 +- + src/liblzma/liblzma.map | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit ea8c948655a86290524efe59cff067e06a886709 +Author: Lasse Collin +Date: 2021-10-28 22:59:52 +0300 + + Add NEWS for 5.3.2alpha. + + NEWS | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit 52435f302f4724157ec50b4210cbe42b285c3cbc +Author: Lasse Collin +Date: 2021-10-27 23:27:48 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit f2aea1d5a504b2021bf47a238390e4f12bdd518d +Author: Lasse Collin +Date: 2021-10-27 23:23:11 +0300 + + xz: Change the coding style of the previous commit. + + It isn't any better now but it's consistent with + the rest of the code base. + + src/xz/file_io.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 892b16cc282f5b4e1c49871b326f4db25c5b4d81 +Author: Alexander Bluhm +Date: 2021-10-05 23:33:16 +0200 + + xz: Avoid fchown(2) failure. + + OpenBSD does not allow to change the group of a file if the user + does not belong to this group. In contrast to Linux, OpenBSD also + fails if the new group is the same as the old one. Do not call + fchown(2) in this case, it would change nothing anyway. + + This fixes an issue with Perl Alien::Build module. + https://github.com/PerlAlien/Alien-Build/issues/62 + + src/xz/file_io.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 2b509c868cae3988bf21cd693fbf9021cdc85628 +Author: Lasse Collin +Date: 2021-09-17 17:31:11 +0300 + + liblzma: Fix liblzma.map for the lzma_microlzma_* symbols. + + This should have been part of d267d109c370a40b502e73f8664b154b15e4f253. + + Thanks to Gao Xiang. + + src/liblzma/liblzma.map | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit cacb06a954b58255dfc084a0bc9708f43a0fd6d6 +Author: Lasse Collin +Date: 2021-09-09 22:21:07 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 6928aac9da6ba612780b9f72ba1d6ecbe1e8b54e +Author: Lasse Collin +Date: 2021-09-09 21:41:51 +0300 + + liblzma: Use _MSVC_LANG to detect when "noexcept" can be used with MSVC. + + By default, MSVC always sets __cplusplus to 199711L. The real + C++ standard version is available in _MSVC_LANG (or one could + use /Zc:__cplusplus to set __cplusplus correctly). + + Fixes . + + Thanks to Dan Weiss. + + src/liblzma/api/lzma.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit d267d109c370a40b502e73f8664b154b15e4f253 +Author: Lasse Collin +Date: 2021-09-05 20:38:12 +0300 + + liblzma: Rename EROFS LZMA to MicroLZMA. + + It still exists primarily for EROFS but MicroLZMA is + a more generic name (that hopefully doesn't clash with + something that already exists). + + src/liblzma/api/lzma/container.h | 33 +++++++++++++--------- + src/liblzma/common/Makefile.inc | 4 +-- + .../{erofs_decoder.c => microlzma_decoder.c} | 32 ++++++++++----------- + .../{erofs_encoder.c => microlzma_encoder.c} | 30 ++++++++++---------- + 4 files changed, 52 insertions(+), 47 deletions(-) + +commit 3247e95115acb95bc27f41e8cf4501db5b0b4309 +Author: Lasse Collin +Date: 2021-06-04 19:02:38 +0300 + + xzdiff: Update the man page about the exit status. + + This was forgotten from 194029ffaf74282a81f0c299c07f73caca3232ca. + + src/scripts/xzdiff.1 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 96f5a28a46fc93ac4e296808ac0f8631d05498bc +Author: Lasse Collin +Date: 2021-06-04 18:52:48 +0300 + + xzless: Fix less(1) version detection when it contains a dot. + + Sometimes the version number from "less -V" contains a dot, + sometimes not. xzless failed detect the version number when + it does contain a dot. This fixes it. + + Thanks to nick87720z for reporting this. Apparently it had been + reported here in 2013. + + src/scripts/xzless.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5fb5212d816addbc523d0798cb482fdd0484f8fa +Author: Lasse Collin +Date: 2021-04-11 19:58:10 +0300 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit fc3d3a7296ef58bb799a73943636b8bfd95339f7 +Author: Ivan A. Melnikov +Date: 2021-04-09 11:45:10 +0300 + + Reduce maximum possible memory limit on MIPS32 + + Due to architectural limitations, address space available to a single + userspace process on MIPS32 is limited to 2 GiB, not 4, even on systems + that have more physical RAM -- e.g. 64-bit systems with 32-bit + userspace, or systems that use XPA (an extension similar to x86's PAE). + + So, for MIPS32, we have to impose stronger memory limits. I've chosen + 2000MiB to give the process some headroom. + + src/xz/hardware.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit e7da44d5151e21f153925781ad29334ae0786101 +Author: Lasse Collin +Date: 2021-02-13 23:31:27 +0200 + + CMake: Use interface library for better FindLibLZMA compatibility. + + https://www.mail-archive.com/xz-devel@tukaani.org/msg00446.html + + Thanks to Markus Rickert. + + CMakeLists.txt | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit a61dd82ada39030f41b4ffca9ea551714908bedc +Author: Lasse Collin +Date: 2021-01-30 18:36:04 +0200 + + CMake: Try to improve compatibility with the FindLibLZMA module. + + The naming conflict with FindLibLZMA module gets worse. + Not avoiding it in the first place was stupid. + + Normally find_package(LibLZMA) will use the module and + find_package(liblzma 5.2.5 REQUIRED CONFIG) will use the config + file even with a case insensitive file system. However, if + CMAKE_FIND_PACKAGE_PREFER_CONFIG is TRUE and the file system + is case insensitive, find_package(LibLZMA) will find our liblzma + config file instead of using FindLibLZMA module. + + One big problem with this is that FindLibLZMA uses + LibLZMA::LibLZMA and we use liblzma::liblzma as the target + name. With target names CMake happens to be case sensitive. + To workaround this, this commit adds + + add_library(LibLZMA::LibLZMA ALIAS liblzma::liblzma) + + to the config file. Then both spellings work. + + To make the behavior consistent between case sensitive and + insensitive file systems, the config and related files are + renamed from liblzmaConfig.cmake to liblzma-config.cmake style. + With this style CMake looks for lowercase version of the package + name so find_package(LiBLzmA 5.2.5 REQUIRED CONFIG) will work + to find our config file. + + There are other differences between our config file and + FindLibLZMA so it's still possible that things break for + reasons other than the spelling of the target name. Hopefully + those situations aren't too common. + + When the config file is available, it should always give as good or + better results as FindLibLZMA so this commit doesn't affect the + recommendation to use find_package(liblzma 5.2.5 REQUIRED CONFIG) + which explicitly avoids FindLibLZMA. + + Thanks to Markus Rickert. + + CMakeLists.txt | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +commit 5b7bc1b8ae766a76710ca1b99f909cf52c697f05 +Author: Lasse Collin +Date: 2021-01-29 21:19:43 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 6c6f0db340dcb8bb424411cedba713405d55f6b8 +Author: Lasse Collin +Date: 2021-01-29 21:19:08 +0200 + + liblzma: Fix unitialized variable. + + This was introduced two weeks ago in the commit + 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c. + + Thanks to Nathan Moinvaziri. + + src/liblzma/lzma/lzma_encoder.c | 1 + + 1 file changed, 1 insertion(+) + +commit bb1d5c1fdd30550d4221ecd336e0be1206132a5c +Author: Lasse Collin +Date: 2021-01-24 22:32:41 +0200 + + Tests: Add bad-1-lzma2-10.xz and also modify -9.xz. + + tests/files/README | 11 +++++++++-- + tests/files/bad-1-lzma2-10.xz | Bin 0 -> 60 bytes + tests/files/bad-1-lzma2-9.xz | Bin 72 -> 72 bytes + 3 files changed, 9 insertions(+), 2 deletions(-) + +commit 6b8abc84a5469792e0355d0bfc0784d41cfdfef7 +Author: Lasse Collin +Date: 2021-01-24 19:22:35 +0200 + + liblzma: Fix a wrong comment in stream_encoder_mt.c. + + src/liblzma/common/stream_encoder_mt.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 939fc5ed654aac25fe0c8684b2df8dbeadb2de1e +Author: Lasse Collin +Date: 2021-01-24 18:51:51 +0200 + + Tests: Add bad-1-lzma2-9.xz. + + tests/files/README | 4 ++++ + tests/files/bad-1-lzma2-9.xz | Bin 0 -> 72 bytes + 2 files changed, 4 insertions(+) + +commit fdd30032f8531ac89519b48c21d810ecf06825f6 +Author: Lasse Collin +Date: 2021-01-24 17:02:00 +0200 + + Tests: Add bad-1-check-crc32-2.xz. + + tests/files/README | 7 +++++++ + tests/files/bad-1-check-crc32-2.xz | Bin 0 -> 72 bytes + 2 files changed, 7 insertions(+) + +commit db465419ae26ec7fb9b9472183911ff521620c77 +Author: Lasse Collin +Date: 2021-01-17 19:20:50 +0200 + + liblzma: In EROFS LZMA decoder, verify that comp_size matches at the end. + + When the uncompressed size is known to be exact, after decompressing + the stream exactly comp_size bytes of input must have been consumed. + This is a minor improvement to error detection. + + src/liblzma/common/erofs_decoder.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 774cc0118ba2496581cb2621505a04bb6598cc75 +Author: Lasse Collin +Date: 2021-01-17 18:53:34 +0200 + + liblzma: Make EROFS LZMA decoder work when exact uncomp_size isn't known. + + The caller must still not specify an uncompressed size bigger + than the actual uncompressed size. + + As a downside, this now needs the exact compressed size. + + src/liblzma/api/lzma/container.h | 23 ++++++++--- + src/liblzma/common/erofs_decoder.c | 80 ++++++++++++++++++++++++++++++++++---- + 2 files changed, 91 insertions(+), 12 deletions(-) + +commit 421b0aa352da244075db10205cf33712f91b9835 +Author: Lasse Collin +Date: 2021-01-14 20:57:11 +0200 + + liblzma: Fix missing normalization in rc_encode_dummy(). + + Without this fix it could attempt to create too much output. + + src/liblzma/rangecoder/range_encoder.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 601ec0311e769fc704daaaa7dac0ca840aff080e +Author: Lasse Collin +Date: 2021-01-14 20:07:01 +0200 + + liblzma: Add EROFS LZMA encoder and decoder. + + Right now this is just a planned extra-compact format for use + in the EROFS file system in Linux. At this point it's possible + that the format will either change or be abandoned and removed + completely. + + The special thing about the encoder is that it uses the + output-size-limited encoding added in the previous commit. + EROFS uses fixed-sized blocks (e.g. 4 KiB) to hold compressed + data so the compressors must be able to create valid streams + that fill the given block size. + + src/liblzma/api/lzma/container.h | 76 +++++++++++++++++++ + src/liblzma/common/Makefile.inc | 2 + + src/liblzma/common/erofs_decoder.c | 148 +++++++++++++++++++++++++++++++++++++ + src/liblzma/common/erofs_encoder.c | 139 ++++++++++++++++++++++++++++++++++ + src/liblzma/liblzma.map | 2 + + 5 files changed, 367 insertions(+) + +commit 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c +Author: Lasse Collin +Date: 2021-01-13 19:16:32 +0200 + + liblzma: Add rough support for output-size-limited encoding in LZMA1. + + With this it is possible to encode LZMA1 data without EOPM so that + the encoder will encode as much input as it can without exceeding + the specified output size limit. The resulting LZMA1 stream will + be a normal LZMA1 stream without EOPM. The actual uncompressed size + will be available to the caller via the uncomp_size pointer. + + One missing thing is that the LZMA layer doesn't inform the LZ layer + when the encoding is finished and thus the LZ may read more input + when it won't be used. However, this doesn't matter if encoding is + done with a single call (which is the planned use case for now). + For proper multi-call encoding this should be improved. + + This commit only adds the functionality for internal use. + Nothing uses it yet. + + src/liblzma/common/common.h | 11 +++ + src/liblzma/lz/lz_encoder.c | 16 ++++ + src/liblzma/lz/lz_encoder.h | 4 + + src/liblzma/lzma/lzma_encoder.c | 127 +++++++++++++++++++++++--------- + src/liblzma/lzma/lzma_encoder_private.h | 12 +++ + src/liblzma/rangecoder/range_encoder.h | 111 ++++++++++++++++++++++++++++ + 6 files changed, 246 insertions(+), 35 deletions(-) + +commit 9cdabbeea891e8f1e7741b076f7db6ac05ae392a +Author: Lasse Collin +Date: 2021-01-11 23:57:11 +0200 + + Scripts: Add zstd support to xzdiff. + + src/scripts/xzdiff.1 | 6 ++++-- + src/scripts/xzdiff.in | 16 +++++++++++----- + 2 files changed, 15 insertions(+), 7 deletions(-) + +commit d9ec3add97cf4c999a7f594c6529680227b6c274 +Author: Lasse Collin +Date: 2021-01-11 23:41:30 +0200 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit 074259f4f3966aeac6edb205fecbc1a8d2b58bb2 +Author: Lasse Collin +Date: 2021-01-11 23:41:16 +0200 + + xz: Make --keep accept symlinks, hardlinks, and setuid/setgid/sticky. + + Previously this required using --force but that has other + effects too which might be undesirable. Changing the behavior + of --keep has a small risk of breaking existing scripts but + since this is a fairly special corner case I expect the + likehood of breakage to be low enough. + + I think the new behavior is more logical. The only reason for + the old behavior was to be consistent with gzip and bzip2. + + Thanks to Vincent Lefevre and Sebastian Andrzej Siewior. + + src/xz/file_io.c | 9 +++++---- + src/xz/xz.1 | 16 +++++++++++++++- + 2 files changed, 20 insertions(+), 5 deletions(-) + +commit 73c555b3077c19dda29b6f4592ced2af876f8333 +Author: Lasse Collin +Date: 2021-01-11 23:28:52 +0200 + + Scripts: Fix exit status of xzgrep. + + Omit the -q option from xz, gzip, and bzip2. With xz this shouldn't + matter. With gzip it's important because -q makes gzip replace SIGPIPE + with exit status 2. With bzip2 it's important because with -q bzip2 + is completely silent if input is corrupt while other decompressors + still give an error message. + + Avoiding exit status 2 from gzip is important because bzip2 uses + exit status 2 to indicate corrupt input. Before this commit xzgrep + didn't recognize corrupt .bz2 files because xzgrep was treating + exit status 2 as SIGPIPE for gzip compatibility. + + zstd still needs -q because otherwise it is noisy in normal + operation. + + The code to detect real SIGPIPE didn't check if the exit status + was due to a signal (>= 128) and so could ignore some other exit + status too. + + src/scripts/xzgrep.in | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +commit 194029ffaf74282a81f0c299c07f73caca3232ca +Author: Lasse Collin +Date: 2021-01-11 22:01:51 +0200 + + Scripts: Fix exit status of xzdiff/xzcmp. + + This is a minor fix since this affects only the situation when + the files differ and the exit status is something else than 0. + In such case there could be SIGPIPE from a decompression tool + and that would result in exit status of 2 from xzdiff/xzcmp + while the correct behavior would be to return 1 or whatever + else diff or cmp may have returned. + + This commit omits the -q option from xz/gzip/bzip2/lzop arguments. + I'm not sure why the -q was used in the first place, perhaps it + hides warnings in some situation that I cannot see at the moment. + Hopefully the removal won't introduce a new bug. + + With gzip the -q option was harmful because it made gzip return 2 + instead of >= 128 with SIGPIPE. Ignoring exit status 2 (warning + from gzip) isn't practical because bzip2 uses exit status 2 to + indicate corrupt input file. It's better if SIGPIPE results in + exit status >= 128. + + With bzip2 the removal of -q seems to be good because with -q + it prints nothing if input is corrupt. The other tools aren't + silent in this situation even with -q. On the other hand, if + zstd support is added, it will need -q since otherwise it's + noisy in normal situations. + + Thanks to Étienne Mollier and Sebastian Andrzej Siewior. + + src/scripts/xzdiff.in | 35 +++++++++++++++++++++-------------- + 1 file changed, 21 insertions(+), 14 deletions(-) + +commit f7fa309e1f7178d04c7bedc03b73077639371e97 +Author: Lasse Collin +Date: 2021-01-09 21:14:36 +0200 + + liblzma: Make lzma_outq usable for threaded decompression too. + + Before this commit all output queue buffers were allocated as + a single big allocation. Now each buffer is allocated separately + when needed. Used buffers are cached to avoid reallocation + overhead but the cache will keep only one buffer size at a time. + This should make things work OK in the decompression where most + of the time the buffer sizes will be the same but with some less + common files the buffer sizes may vary. + + While this should work fine, it's still a bit preliminary + and may even get reverted if it turns out to be useless for + decompression. + + src/liblzma/common/outqueue.c | 268 +++++++++++++++++++++------------ + src/liblzma/common/outqueue.h | 138 ++++++++++++----- + src/liblzma/common/stream_encoder_mt.c | 52 ++++--- + 3 files changed, 301 insertions(+), 157 deletions(-) + +commit a35a69d693ce37d4ba7c1855bda7d9cfa13d1778 +Author: Lasse Collin +Date: 2020-12-23 17:15:49 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4fd79b90c52396d70e0b1206ceb1a873a0ad2589 +Author: H.J. Lu +Date: 2020-12-23 06:49:04 -0800 + + liblzma: Enable Intel CET in x86 CRC assembly codes + + When Intel CET is enabled, we need to include in assembly codes + to mark Intel CET support and add _CET_ENDBR to indirect jump targets. + + Tested on Intel Tiger Lake under CET enabled Linux. + + src/liblzma/check/crc32_x86.S | 9 +++++++++ + src/liblzma/check/crc64_x86.S | 9 +++++++++ + 2 files changed, 18 insertions(+) + +commit bb3b8c6a23e25db79f862b1de325c56052e0354b +Author: Lasse Collin +Date: 2020-12-16 18:33:29 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 21588ca34af98738954fc12ded1b89d7294ef646 +Author: Lasse Collin +Date: 2020-12-16 18:30:14 +0200 + + Build: Don't build bundles on Apple OSes. + + Thanks to Daniel Packard. + + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +commit d05b0c42dd8b38d8c6b8193c8af50e9bd3d16f28 +Author: Lasse Collin +Date: 2020-12-05 22:44:03 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 1890351f3423627ba5c4c495402f32d7e9ed90b7 +Author: Adam Borowski +Date: 2020-09-25 03:35:18 +0200 + + Scripts: Add zstd support to xzgrep. + + Thanks to Adam Borowski. + + src/scripts/xzgrep.1 | 9 ++++++--- + src/scripts/xzgrep.in | 1 + + 2 files changed, 7 insertions(+), 3 deletions(-) + +commit 2f108abb3d82e4e2313b438dae9c0c7c7a6366f2 +Author: Lasse Collin +Date: 2020-11-17 20:51:48 +0200 + + CMake: Fix compatibility with CMake 3.13. + + The syntax "if(DEFINED CACHE{FOO})" requires CMake 3.14. + In some other places the code treats the cache variables + like normal variables already (${FOO} or if(FOO) is used, + not ${CACHE{FOO}). + + Thanks to ygrek for reporting the bug on IRC. + + CMakeLists.txt | 2 +- + cmake/tuklib_cpucores.cmake | 4 ++-- + cmake/tuklib_physmem.cmake | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 5af726a79273fafa5de5745b117e567f21c90e49 +Author: Lasse Collin +Date: 2020-11-01 22:56:43 +0200 + + Update THANKS. + + THANKS | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 4575d9d365c756ec189899f9f743e0b3515ce72d +Author: Lasse Collin +Date: 2020-11-01 22:34:25 +0200 + + xz: Avoid unneeded \f escapes on the man page. + + I don't want to use \c in macro arguments but groff_man(7) + suggests that \f has better portability. \f would be needed + for the .TP strings for portability reasons anyway. + + Thanks to Bjarni Ingi Gislason. + + src/xz/xz.1 | 31 ++++++++++++++++++++++--------- + 1 file changed, 22 insertions(+), 9 deletions(-) + +commit 620b32f5339f86710cb4435e01ecdac972ccac73 +Author: Lasse Collin +Date: 2020-11-01 19:09:53 +0200 + + xz: Use non-breaking spaces when intentionally using more than one space. + + This silences some style checker warnings. Seems that spaces + in the beginning of a line don't need this treatment. + + Thanks to Bjarni Ingi Gislason. + + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cb1f34988c8a4130485091b2f8b641303d8f701b +Author: Lasse Collin +Date: 2020-11-01 18:49:37 +0200 + + xz: Protect the ellipsis (...) on the man page with \&. + + This does it only when ... appears outside macro calls. + + Thanks to Bjarni Ingi Gislason. + + src/xz/xz.1 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 5d224da3da87400f2fab313abbd7c710e7169ef9 +Author: Lasse Collin +Date: 2020-11-01 18:41:21 +0200 + + xz: Avoid the abbreviation "e.g." on the man page. + + A few are simply omitted, most are converted to "for example" + and surrounded with commas. Sounds like that this is better + style, for example, man-pages(7) recommends avoiding such + abbreviations except in parenthesis. + + Thanks to Bjarni Ingi Gislason. + + src/xz/xz.1 | 66 ++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 33 insertions(+), 33 deletions(-) + +commit 90457dbe3e5717660f5b81f8c604860fc5137c0c +Author: Lasse Collin +Date: 2020-07-12 23:10:03 +0300 + + xz man page: Change \- (minus) to \(en (en-dash) for a numeric range. + + Docs of ancient troff/nroff mention \(em (em-dash) but not \(en + and \- was used for both minus and en-dash. I don't know how + portable \(en is nowadays but it can be changed back if someone + complains. At least GNU groff and OpenBSD's mandoc support it. + + Thanks to Bjarni Ingi Gislason for the patch. + + src/xz/xz.1 | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 352ba2d69af2136bc814aa1df1a132559d445616 +Author: Lasse Collin +Date: 2020-07-12 20:46:24 +0300 + + Windows: Fix building of resource files when config.h isn't used. + + Now CMake + Visual Studio works for building liblzma.dll. + + Thanks to Markus Rickert. + + src/common/common_w32res.rc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a9e2a87f1d61dcf684d809bf08c8ebea93f8a480 +Author: Lasse Collin +Date: 2020-04-06 19:31:50 +0300 + + src/scripts/xzgrep.1: Filenames to xzgrep are optional. + + xzgrep --help was correct already. + + src/scripts/xzgrep.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a7ba275d9b855d186abb29eb7a4f4cb6d9ca6fe0 +Author: Bjarni Ingi Gislason +Date: 2020-03-26 22:17:31 +0000 + + src/script/xzgrep.1: Remove superfluous '.RB' + + Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z + + [ "test-groff" is a developmental version of "groff" ] + + Input file is ./src/scripts/xzgrep.1 + + :20 (macro RB): only 1 argument, but more are expected + :23 (macro RB): only 1 argument, but more are expected + :26 (macro RB): only 1 argument, but more are expected + :29 (macro RB): only 1 argument, but more are expected + :32 (macro RB): only 1 argument, but more are expected + + "abc..." does not mean the same as "abc ...". + + The output from nroff and troff is unchanged except for the space + between "file" and "...". + + Signed-off-by: Bjarni Ingi Gislason + + src/scripts/xzgrep.1 | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 133d498db0f4b14f066d192d64dbcade45deae6b +Author: Bjarni Ingi Gislason +Date: 2020-03-30 21:56:36 +0000 + + xzgrep.1: Delete superfluous '.PP' + + Summary: + + mandoc -T lint xzgrep.1 : + mandoc: xzgrep.1:79:2: WARNING: skipping paragraph macro: PP empty + + There is no change in the output of "nroff" and "troff". + + Signed-off-by: Bjarni Ingi Gislason + + src/scripts/xzgrep.1 | 1 - + 1 file changed, 1 deletion(-) + +commit 057839ca982f886387b66746bffe749cb14fd8cd +Author: Bjarni Ingi Gislason +Date: 2020-03-26 21:16:18 +0000 + + src/xz/xz.1: Correct misused two-fonts macros + + Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z + + [ "test-groff" is a developmental version of "groff" ] + + Input file is ./src/xz/xz.1 + + :408 (macro BR): only 1 argument, but more are expected + :1009 (macro BR): only 1 argument, but more are expected + :1743 (macro BR): only 1 argument, but more are expected + :1920 (macro BR): only 1 argument, but more are expected + :2213 (macro BR): only 1 argument, but more are expected + + Output from nroff and troff is unchanged, except for a font change of a + full stop (.). + + Signed-off-by: Bjarni Ingi Gislason + + src/xz/xz.1 | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit b8e12f5ab4c9fd3cb09a4330b2861f6b979ababd +Author: Lasse Collin +Date: 2020-03-23 18:07:50 +0200 + + Typo fixes from fossies.org. + + https://fossies.org/linux/misc/xz-5.2.5.tar.xz/codespell.html + + Makefile.am | 2 +- + doc/examples/01_compress_easy.c | 2 +- + src/liblzma/api/lzma/base.h | 2 +- + src/liblzma/check/crc32_x86.S | 2 +- + src/liblzma/common/index.c | 2 +- + src/xz/xz.1 | 4 ++-- + 6 files changed, 7 insertions(+), 7 deletions(-) + +commit 869b9d1b4edd6df07f819d360d306251f8147353 +Author: Lasse Collin +Date: 2020-03-17 16:24:28 +0200 + + Update NEWS for 5.2.5. + + NEWS | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 105 insertions(+) + +commit a048e3a92d238c65f050a765174d9c75417231d4 +Author: Lasse Collin +Date: 2020-03-16 20:01:37 +0200 + + README: Update outdated sections. + + README | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +commit 29aed815ad4f98f3e4d355faa76a244ecd8ce716 +Author: Lasse Collin +Date: 2020-03-16 19:39:45 +0200 + + README: Mention that man pages can be translated. + + README | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 7fa7653940cc9dcfcbce2fbc5166ea343ad4e3c1 +Author: Lasse Collin +Date: 2020-03-16 16:43:29 +0200 + + Update INSTALL.generic from Automake 1.16.1. + + INSTALL.generic | 321 ++++++++++++++++++++++++++++---------------------------- + 1 file changed, 162 insertions(+), 159 deletions(-) + +commit 9bd317ef03ab9b3e6a927c27c2e9c4ac041182f0 +Author: Lasse Collin +Date: 2020-03-15 15:27:22 +0200 + + Update INSTALL for Windows and DOS and add preliminary info for z/OS. + + INSTALL | 51 +++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 41 insertions(+), 10 deletions(-) + +commit a3148c0446dc7fa96363752df414d22539c9007b +Author: Lasse Collin +Date: 2020-03-15 15:26:20 +0200 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive (again). + + m4/ax_pthread.m4 | 219 +++++++++++++++++++++++++++++-------------------------- + 1 file changed, 117 insertions(+), 102 deletions(-) + +commit 7812002dd3ed319e42a14662a8531802cca8ca67 +Author: Lasse Collin +Date: 2020-03-11 21:15:35 +0200 + + xz: Never use thousand separators in DJGPP builds. + + DJGPP 2.05 added support for thousands separators but it's + broken at least under WinXP with Finnish locale that uses + a non-breaking space as the thousands separator. Workaround + by disabling thousands separators for DJGPP builds. + + src/xz/util.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +commit 7c8f688bf7fccd65d396e0130cbf4ea5dff5c56f +Author: Lasse Collin +Date: 2020-03-11 19:38:08 +0200 + + DOS: Update dos/Makefile for DJGPP 2.05. + + It doesn't need -fgnu89-inline like 2.04beta did. + + dos/Makefile | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 319ca928d73de87940c54e30bffe69f9fa65efdf +Author: Lasse Collin +Date: 2020-03-11 19:36:07 +0200 + + DOS: Update instructions in dos/INSTALL.txt. + + dos/INSTALL.txt | 59 ++++++++++++++++++++++++++++----------------------------- + 1 file changed, 29 insertions(+), 30 deletions(-) + +commit cb6b227ce39932824812ccd8a0647bd968de27d2 +Author: Lasse Collin +Date: 2020-03-11 17:58:51 +0200 + + DOS: Update config.h. + + The added defines assume GCC >= 4.8. + + dos/config.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 4572d53e16e87eee375bc5624de2fd59bb0ae9cd +Author: Lasse Collin +Date: 2020-03-02 13:54:33 +0200 + + liblzma: Fix a comment and RC_SYMBOLS_MAX. + + The comment didn't match the value of RC_SYMBOLS_MAX and the value + itself was slightly larger than actually needed. The only harm + about this was that memory usage was a few bytes larger. + + src/liblzma/rangecoder/range_encoder.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 265daa873c0d871f5f23f9b56e133a6f20045a0a +Author: Lasse Collin +Date: 2020-02-27 20:58:52 +0200 + + Build: Make CMake build fail if tuklib_cpucores or tuklib_physmem fails. + + CMakeLists.txt | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 7c8b904527cdbe61248c80edcc2e20d840c4fef9 +Author: Lasse Collin +Date: 2020-02-27 20:24:27 +0200 + + Build: Add support for --no-po4a option to autogen.sh. + + Normally, if po4a isn't available, autogen.sh will return + with non-zero exit status. The option --no-po4a can be useful + when one knows that po4a isn't available but wants autogen.sh + to still return with zero exit status. + + autogen.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 292a5c0f9c9b3a66f5a5c652dc46381836d4537f +Author: Lasse Collin +Date: 2020-02-25 21:35:14 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 474320e9908786ba2021035f9013191e16cde08a +Author: Lasse Collin +Date: 2020-02-25 20:42:31 +0200 + + Build: Fix bugs in the CMake files. + + Seems that the phrase "add more quotes" from sh/bash scripting + applies to CMake as well. E.g. passing an unquoted list ${FOO} + to a function that expects one argument results in only the + first element of the list being passed as an argument and + the rest get ignored. Adding quotes helps ("${FOO}"). + + list(INSERT ...) is weird. Inserting an empty string to an empty + variable results in empty list, but inserting it to a non-empty + variable does insert an empty element to the list. + + Since INSERT requires at least one element, + "${CMAKE_THREAD_LIBS_INIT}" needs to be quoted in CMakeLists.txt. + It might result in an empty element in the list. It seems to not + matter as empty elements consistently get ignored in that variable. + In fact, calling cmake_check_push_state() and cmake_check_pop_state() + will strip the empty elements from CMAKE_REQUIRED_LIBRARIES! + + In addition to quoting fixes, this fixes checks for the cache + variables in tuklib_cpucores.cmake and tuklib_physmem.cmake. + + Thanks to Martin Matuška for testing and reporting the problems. + These fixes aren't tested yet but hopefully they soon will be. + + CMakeLists.txt | 52 ++++++++++++++++++++++----------------------- + cmake/tuklib_common.cmake | 8 ++++--- + cmake/tuklib_cpucores.cmake | 30 ++++++++++++++------------ + cmake/tuklib_integer.cmake | 34 +++++++++++++++-------------- + cmake/tuklib_mbstr.cmake | 6 +++--- + cmake/tuklib_physmem.cmake | 29 +++++++++++++------------ + cmake/tuklib_progname.cmake | 4 ++-- + 7 files changed, 85 insertions(+), 78 deletions(-) + +commit 7e3493d40eac0c3fa3d5124097745a70e15c41f6 +Author: Lasse Collin +Date: 2020-02-24 23:38:16 +0200 + + Build: Add very limited experimental CMake support. + + This does *NOT* replace the Autotools-based build system in + the foreseeable future. See the comment in the beginning + of CMakeLists.txt. + + So far this has been tested only on GNU/Linux but I commit + it anyway to make it easier for others to test. Since I + haven't played much with CMake before, it's likely that + there are things that have been done in a silly or wrong + way and need to be fixed. + + CMakeLists.txt | 643 ++++++++++++++++++++++++++++++++++++++++++++ + cmake/tuklib_common.cmake | 47 ++++ + cmake/tuklib_cpucores.cmake | 173 ++++++++++++ + cmake/tuklib_integer.cmake | 100 +++++++ + cmake/tuklib_mbstr.cmake | 20 ++ + cmake/tuklib_physmem.cmake | 149 ++++++++++ + cmake/tuklib_progname.cmake | 19 ++ + 7 files changed, 1151 insertions(+) + +commit 21bd4701fca3e9002ce78bc135debca369ed8545 +Author: Lasse Collin +Date: 2020-02-24 23:37:07 +0200 + + Update m4/.gitignore. + + m4/.gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit e094d1d0f196a91ec703e8d0055948feef349ae8 +Author: Lasse Collin +Date: 2020-02-24 23:29:35 +0200 + + tuklib: Omit an unneeded from a tests. + + tuklib_cpucores.c and tuklib_physmem.c don't include + even via other files in this package, so clearly that header isn't + needed in the tests either (no one has reported build problems due + to a missing header in a .c file). + + m4/tuklib_cpucores.m4 | 1 - + m4/tuklib_physmem.m4 | 1 - + 2 files changed, 2 deletions(-) + +commit b3ed19a55fe99a45bd77614e149d39d18498075c +Author: Lasse Collin +Date: 2020-02-24 23:01:00 +0200 + + liblzma: Remove unneeded from fastpos_tablegen.c. + + This file only generates fastpos_table.c. + It isn't built as a part of liblzma. + + src/liblzma/lzma/fastpos_tablegen.c | 1 - + 1 file changed, 1 deletion(-) + +commit 7b8982b29179b3c586e0456dc9ecbd4f58dcea59 +Author: Lasse Collin +Date: 2020-02-22 14:15:07 +0200 + + Use defined(__GNUC__) before __GNUC__ in preprocessor lines. + + This should silence the equivalent of -Wundef in compilers that + don't define __GNUC__. + + src/common/sysdefs.h | 3 ++- + src/liblzma/api/lzma.h | 5 +++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +commit 43dfe04e6209c691cf4fbe3072d4ee91271748f1 +Author: Lasse Collin +Date: 2020-02-21 17:40:02 +0200 + + liblzma: Add more uses of lzma_memcmplen() to the normal mode of LZMA. + + This gives a tiny encoder speed improvement. This could have been done + in 2014 after the commit 544aaa3d13554e8640f9caf7db717a96360ec0f6 but + it was forgotten. + + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 59e6eb4840b9f52fa3a61544974017279b448216 +Author: Lasse Collin +Date: 2020-02-21 17:01:15 +0200 + + Build: Add visibility.m4 from gnulib. + + Appears that this file used to get included as a side effect of + gettext. After the change to gettext version requirements this file + no longer got copied to the package and so the build was broken. + + m4/.gitignore | 1 - + m4/visibility.m4 | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 77 insertions(+), 1 deletion(-) + +commit 7fe3ef2eaa53d439cec043727ea1998f4ff0e22a +Author: Lasse Collin +Date: 2020-02-21 16:10:44 +0200 + + xz: Silence a warning when sig_atomic_t is long int. + + It can be true at least on z/OS. + + src/xz/signals.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b0a2a77d10940c42b449d47a005bfc2e50ab5db8 +Author: Lasse Collin +Date: 2020-02-21 15:59:26 +0200 + + xz: Avoid unneeded access of a volatile variable. + + src/xz/signals.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 524c2f12c762032b819757aeda8af7c47c4cabce +Author: Lasse Collin +Date: 2020-02-21 01:24:18 +0200 + + tuklib_integer.m4: Optimize the check order. + + The __builtin byteswapping is the preferred one so check for it first. + + m4/tuklib_integer.m4 | 56 +++++++++++++++++++++++++++------------------------- + 1 file changed, 29 insertions(+), 27 deletions(-) + +commit 57360bb4fd79b358b36d2877db26ac828d1fdfcb +Author: Lasse Collin +Date: 2020-02-20 18:54:04 +0200 + + tuklib_exit: Add missing header. + + strerror() needs which happened to be included via + tuklib_common.h -> tuklib_config.h -> sysdefs.h if HAVE_CONFIG_H + was defined. This wasn't tested without config.h before so it + had worked fine. + + src/common/tuklib_exit.c | 1 + + 1 file changed, 1 insertion(+) + +commit fddd31175e74a538997a939d930462fde17d2dd4 +Author: Lasse Collin +Date: 2020-02-18 19:12:35 +0200 + + Revert the previous commit and add a comment. + + The previous commit broke crc32_tablegen.c. + + If the whole package is built without config.h (with defines + set on the compiler command line) this should still work fine + as long as these headers conform to C99 well enough. + + src/common/tuklib_config.h | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +commit 4e4e9fbb7e66d45319525ac224bff48fbdd0cf6e +Author: Lasse Collin +Date: 2020-02-17 23:37:20 +0200 + + Do not check for HAVE_CONFIG_H in tuklib_config.h. + + In XZ Utils sysdefs.h takes care of it and the required headers. + + src/common/tuklib_config.h | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +commit 2d4cef954feba82073951358466a1d614141cf33 +Author: Lasse Collin +Date: 2020-02-16 11:18:28 +0200 + + sysdefs.h: Omit the conditionals around string.h and limits.h. + + string.h is used unconditionally elsewhere in the project and + configure has always stopped if limits.h is missing, so these + headers must have been always available even on the weirdest + systems. + + src/common/sysdefs.h | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit feb9c1969bc3eb33d4ecb72cfa897f92dae84939 +Author: Lasse Collin +Date: 2020-02-15 15:07:11 +0200 + + Build: Bump Autoconf and Libtool version requirements. + + There is no specific reason for this other than blocking + the most ancient versions. These are still old: + + Autoconf 2.69 (2012) + Automake 1.12 (2012) + gettext 0.19.6 (2015) + Libtool 2.4 (2010) + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3d576cf92158d62790017ad7f2dd6dc1dd6b42bb +Author: Lasse Collin +Date: 2020-02-15 03:08:32 +0200 + + Build: Use AM_GNU_GETTEXT_REQUIRE_VERSION and require 0.19.6. + + This bumps the version requirement from 0.19 (from 2014) to + 0.19.6 (2015). + + Using only the old AM_GNU_GETTEXT_VERSION results in old + gettext infrastructure being placed in the package. By using + both macros we get the latest gettext files while the other + programs in the Autotools family can still see the old macro. + + configure.ac | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit fa792b8befaf7cb3960b655e0a9410da866d756f +Author: Lasse Collin +Date: 2020-02-14 20:42:06 +0200 + + Translations: Add German translation of the man pages. + + Thanks to Mario Blättermann. + + po4a/de.po | 5532 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po4a/po4a.conf | 2 +- + 2 files changed, 5533 insertions(+), 1 deletion(-) + +commit 6f7211b6bb47a895b47f533282dba9ee9a1b0c8b +Author: Lasse Collin +Date: 2020-02-07 15:32:21 +0200 + + Build: Add support for translated man pages using po4a. + + The dependency on po4a is optional. It's never required to install + the translated man pages when xz is built from a release tarball. + If po4a is missing when building from xz.git, the translated man + pages won't be generated but otherwise the build will work normally. + + The translations are only updated automatically by autogen.sh and + by "make mydist". This makes it easy to keep po4a as an optional + dependency and ensures that I won't forget to put updated + translations to a release tarball. + + The translated man pages aren't installed if --disable-nls is used. + + The installation of translated man pages abuses Automake internals + by calling "install-man" with redefined dist_man_MANS and man_MANS. + This makes the hairy script code slightly less hairy. If it breaks + some day, this code needs to be fixed; don't blame Automake developers. + + Also, this adds more quotes to the existing shell script code in + the Makefile.am "-hook"s. + + Makefile.am | 4 ++++ + autogen.sh | 8 ++++--- + po4a/.gitignore | 2 ++ + po4a/po4a.conf | 14 +++++++++++ + po4a/update-po | 45 ++++++++++++++++++++++++++++++++++ + src/scripts/Makefile.am | 64 +++++++++++++++++++++++++++++++++++++------------ + src/xz/Makefile.am | 50 +++++++++++++++++++++++++++----------- + src/xzdec/Makefile.am | 55 ++++++++++++++++++++++++++++++++---------- + 8 files changed, 197 insertions(+), 45 deletions(-) + +commit 426f9e5819ff7710a5ff573a96c02940be65d52f +Author: Lasse Collin +Date: 2020-02-06 17:31:38 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit e3a4481d020e4de89efa037f335cf50f3ca55592 +Author: Lasse Collin +Date: 2020-02-05 22:35:06 +0200 + + Update tests/.gitignore. + + .gitignore | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 07208de92f2d5bca764f6d0ebe9d9866051dc4ef +Author: Lasse Collin +Date: 2020-02-05 22:28:51 +0200 + + Update m4/.gitignore. + + m4/.gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit c91fbf223db46c3b3cb9df769863a1a60cd9c908 +Author: Lasse Collin +Date: 2020-02-05 20:47:38 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 15a133b6d1a3eab4faf6eb52a71fdc56bd65846f +Author: Lasse Collin +Date: 2020-02-05 20:40:14 +0200 + + xz: Make it a fatal error if enabling the sandbox fails. + + Perhaps it's too drastic but on the other hand it will let me + learn about possible problems if people report the errors. + This won't be backported to the v5.2 branch. + + src/xz/file_io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit af0fb386ef55db66654ae39e2deec6e04190c4ff +Author: Lasse Collin +Date: 2020-02-05 20:33:50 +0200 + + xz: Comment out annoying sandboxing messages. + + src/xz/file_io.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 986d8c9b52b824474088e5bb3b6940651660f0e2 +Author: Lasse Collin +Date: 2020-02-05 19:33:37 +0200 + + Build: Workaround a POSIX shell detection problem on Solaris. + + I don't know if the problem is in gnulib's gl_POSIX_SHELL macro + or if xzgrep does something that isn't in POSIX. The workaround + adds a special case for Solaris: if /usr/xpg4/bin/sh exists and + gl_cv_posix_shell wasn't overriden on the configure command line, + use that shell for xzgrep and other scripts. That shell is known + to work and exists on most Solaris systems. + + configure.ac | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad +Author: Lasse Collin +Date: 2020-02-03 22:03:50 +0200 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive. + + m4/ax_pthread.m4 | 398 ++++++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 279 insertions(+), 119 deletions(-) + +commit 353970510895f6a80adfe60cf71b70a95adfa8bc +Author: Lasse Collin +Date: 2020-02-01 19:56:18 +0200 + + xz: Limit --memlimit-compress to at most 4020 MiB for 32-bit xz. + + See the code comment for reasoning. It's far from perfect but + hopefully good enough for certain cases while hopefully doing + nothing bad in other situations. + + At presets -5 ... -9, 4020 MiB vs. 4096 MiB makes no difference + on how xz scales down the number of threads. + + The limit has to be a few MiB below 4096 MiB because otherwise + things like "xz --lzma2=dict=500MiB" won't scale down the dict + size enough and xz cannot allocate enough memory. With + "ulimit -v $((4096 * 1024))" on x86-64, the limit in xz had + to be no more than 4085 MiB. Some safety margin is good though. + + This is hack but it should be useful when running 32-bit xz on + a 64-bit kernel that gives full 4 GiB address space to xz. + Hopefully this is enough to solve this: + + https://bugzilla.redhat.com/show_bug.cgi?id=1196786 + + FreeBSD has a patch that limits the result in tuklib_physmem() + to SIZE_MAX on 32-bit systems. While I think it's not the way + to do it, the results on --memlimit-compress have been good. This + commit should achieve practically identical results for compression + while leaving decompression and tuklib_physmem() and thus + lzma_physmem() unaffected. + + src/xz/hardware.c | 32 +++++++++++++++++++++++++++++++- + src/xz/xz.1 | 21 ++++++++++++++++++++- + 2 files changed, 51 insertions(+), 2 deletions(-) + +commit ba76d67585f88677af9f48b48e7bdc3bb7687def +Author: Lasse Collin +Date: 2020-01-26 20:53:25 +0200 + + xz: Set the --flush-timeout deadline when the first input byte arrives. + + xz --flush-timeout=2000, old version: + + 1. xz is started. The next flush will happen after two seconds. + 2. No input for one second. + 3. A burst of a few kilobytes of input. + 4. No input for one second. + 5. Two seconds have passed and flushing starts. + + The first second counted towards the flush-timeout even though + there was no pending data. This can cause flushing to occur more + often than needed. + + xz --flush-timeout=2000, after this commit: + + 1. xz is started. + 2. No input for one second. + 3. A burst of a few kilobytes of input. The next flush will + happen after two seconds counted from the time when the + first bytes of the burst were read. + 4. No input for one second. + 5. No input for another second. + 6. Two seconds have passed and flushing starts. + + src/xz/coder.c | 6 +----- + src/xz/file_io.c | 6 +++++- + src/xz/mytime.c | 1 - + 3 files changed, 6 insertions(+), 7 deletions(-) + +commit fd47fd62bbb1bfd13ab63869137971d8b390025f +Author: Lasse Collin +Date: 2020-01-26 20:19:19 +0200 + + xz: Move flush_needed from mytime.h to file_pair struct in file_io.h. + + src/xz/coder.c | 3 ++- + src/xz/file_io.c | 3 ++- + src/xz/file_io.h | 3 +++ + src/xz/mytime.c | 3 --- + src/xz/mytime.h | 4 ---- + 5 files changed, 7 insertions(+), 9 deletions(-) + +commit 815035681063d5774d3640fc20b8ede783dd574e +Author: Lasse Collin +Date: 2020-01-26 14:49:22 +0200 + + xz: coder.c: Make writing output a separate function. + + The same code sequence repeats so it's nicer as a separate function. + Note that in one case there was no test for opt_mode != MODE_TEST, + but that was only because that condition would always be true, so + this commit doesn't change the behavior there. + + src/xz/coder.c | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +commit 5a49e081a098455bcdbd95cefb90e9b18780fe58 +Author: Lasse Collin +Date: 2020-01-26 14:13:42 +0200 + + xz: Fix semi-busy-waiting in xz --flush-timeout. + + When input blocked, xz --flush-timeout=1 would wake up every + millisecond and initiate flushing which would have nothing to + flush and thus would just waste CPU time. The fix disables the + timeout when no input has been seen since the previous flush. + + src/xz/coder.c | 4 ++++ + src/xz/file_io.c | 15 +++++++++++---- + src/xz/file_io.h | 4 ++++ + 3 files changed, 19 insertions(+), 4 deletions(-) + +commit dcca70fe9fa3c4bec56cf9c79e966166c9a9cf6a +Author: Lasse Collin +Date: 2020-01-26 13:47:31 +0200 + + xz: Refactor io_read() a bit. + + src/xz/file_io.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +commit 4ae9ab70cd3214395756435d13d8d000368ca2cb +Author: Lasse Collin +Date: 2020-01-26 13:37:08 +0200 + + xz: Update a comment in file_io.h. + + src/xz/file_io.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 3333ba4a6795a55cf0375329ba08152bd7fcbd46 +Author: Lasse Collin +Date: 2020-01-26 13:27:51 +0200 + + xz: Move the setting of flush_needed in file_io.c to a nicer location. + + src/xz/file_io.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit cf2df0f05ac98c1158c6e48145900b773223605d +Author: Lasse Collin +Date: 2020-01-19 21:54:33 +0200 + + Use $(LIB_FUZZING_ENGINE) in tests/ossfuzz/Makefile. + + https://github.com/google/oss-fuzz/pull/3219#issuecomment-573751048 + + Thanks to Bhargava Shastry for sending the patch. + + tests/ossfuzz/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7136f1735c60ac6967c4b8e277fcde53d485234f +Author: Lasse Collin +Date: 2019-12-31 00:41:28 +0200 + + Rename unaligned_read32ne to read32ne, and similarly for the others. + + src/common/tuklib_integer.h | 64 +++++++++++++++---------------- + src/liblzma/common/alone_encoder.c | 2 +- + src/liblzma/common/block_header_decoder.c | 2 +- + src/liblzma/common/block_header_encoder.c | 2 +- + src/liblzma/common/memcmplen.h | 9 ++--- + src/liblzma/common/stream_flags_decoder.c | 6 +-- + src/liblzma/common/stream_flags_encoder.c | 8 ++-- + src/liblzma/lz/lz_encoder_hash.h | 2 +- + src/liblzma/lzma/lzma_decoder.c | 2 +- + src/liblzma/lzma/lzma_encoder.c | 2 +- + src/liblzma/lzma/lzma_encoder_private.h | 3 +- + src/liblzma/simple/simple_decoder.c | 2 +- + src/liblzma/simple/simple_encoder.c | 2 +- + tests/test_block_header.c | 4 +- + tests/test_stream_flags.c | 6 +-- + 15 files changed, 54 insertions(+), 62 deletions(-) + +commit 5e78fcbf2eb21936022c9c5c3625d4da76f4b241 +Author: Lasse Collin +Date: 2019-12-31 00:29:48 +0200 + + Rename read32ne to aligned_read32ne, and similarly for the others. + + Using the aligned methods requires more care to ensure that + the address really is aligned, so it's nicer if the aligned + methods are prefixed. The next commit will remove the unaligned_ + prefix from the unaligned methods which in liblzma are used in + more places than the aligned ones. + + src/common/tuklib_integer.h | 56 +++++++++++++++++++++--------------------- + src/liblzma/check/crc32_fast.c | 4 +-- + src/liblzma/check/crc64_fast.c | 4 +-- + 3 files changed, 32 insertions(+), 32 deletions(-) + +commit 77bc5bc6dd67056cfd5888520ac930cfc57b4516 +Author: Lasse Collin +Date: 2019-12-31 00:18:24 +0200 + + Revise tuklib_integer.h and .m4. + + Add a configure option --enable-unsafe-type-punning to get the + old non-conforming memory access methods. It can be useful with + old compilers or in some other less typical situations but + shouldn't normally be used. + + Omit the packed struct trick for unaligned access. While it's + best in some cases, this is simpler. If the memcpy trick doesn't + work, one can request unsafe type punning from configure. + + Because CRC32/CRC64 code needs fast aligned reads, if no very + safe way to do it is found, type punning is used as a fallback. + This sucks but since it currently works in practice, it seems to + be the least bad option. It's never needed with GCC >= 4.7 or + Clang >= 3.6 since these support __builtin_assume_aligned and + thus fast aligned access can be done with the memcpy trick. + + Other things: + - Support GCC/Clang __builtin_bswapXX + - Cleaner bswap fallback macros + - Minor cleanups + + m4/tuklib_integer.m4 | 46 ++++- + src/common/tuklib_integer.h | 488 ++++++++++++++++++++++++-------------------- + 2 files changed, 316 insertions(+), 218 deletions(-) + +commit 8b72950a6b2e2a36c2d8fdc8857564b57191b088 +Author: Lasse Collin +Date: 2019-12-29 22:51:58 +0200 + + Tests: Hopefully fix test_check.c to work on EBCDIC systems. + + Thanks to Daniel Richard G. + + tests/test_check.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 43ce4ea7c762238d3df9717b34126d3e0d7cd51c +Author: Lasse Collin +Date: 2019-09-24 23:02:40 +0300 + + Scripts: Put /usr/xpg4/bin to the beginning of PATH on Solaris. + + This adds a configure option --enable-path-for-scripts=PREFIX + which defaults to empty except on Solaris it is /usr/xpg4/bin + to make POSIX grep and others available. The Solaris case had + been documented in INSTALL with a manual fix but it's better + to do this automatically since it is needed on most Solaris + systems anyway. + + Thanks to Daniel Richard G. + + INSTALL | 43 +++++++++++++++++++++++++++++++++++-------- + configure.ac | 26 ++++++++++++++++++++++++++ + src/scripts/xzdiff.in | 1 + + src/scripts/xzgrep.in | 1 + + src/scripts/xzless.in | 1 + + src/scripts/xzmore.in | 1 + + 6 files changed, 65 insertions(+), 8 deletions(-) + +commit 6a89e656ebedd53a10cd1a063a32a9e4ade0da1f +Author: Lasse Collin +Date: 2019-07-12 18:57:43 +0300 + + Fix comment typos in tuklib_mbstr* files. + + src/common/tuklib_mbstr.h | 2 +- + src/common/tuklib_mbstr_fw.c | 2 +- + src/common/tuklib_mbstr_width.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit ac0b4212656a48ef0c187c0c941d40ac9489ae36 +Author: Lasse Collin +Date: 2019-07-12 18:30:46 +0300 + + Add missing include to tuklib_mbstr_width.c. + + It didn't matter in XZ Utils because sysdefs.h + includes string.h anyway. + + src/common/tuklib_mbstr_width.c | 1 + + 1 file changed, 1 insertion(+) + +commit 72a443281fb0b91aebf8cdff2ab1f7c07b081240 +Author: Lasse Collin +Date: 2019-07-12 18:10:57 +0300 + + Update tuklib base headers to include stdbool.h. + + src/common/tuklib_common.h | 2 +- + src/common/tuklib_config.h | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit de1f47b2b40e960b7bc3acba754f66dd19705921 +Author: Lasse Collin +Date: 2019-06-28 00:54:31 +0300 + + xz: Automatically align the strings in --info-memory. + + This makes it easier to translate the strings. + + Also, the string for amount of RAM was shortened. + + src/xz/hardware.c | 45 ++++++++++++++++++++++++++++++++++----------- + 1 file changed, 34 insertions(+), 11 deletions(-) + +commit 8ce679125dbd0e2058d8f886e738d7f19a45cab5 +Author: Lasse Collin +Date: 2019-06-25 23:15:21 +0300 + + liblzma: Fix a buggy comment. + + src/liblzma/lz/lz_encoder_mf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fc77929e92e869f6869bf88931066103fd75f376 +Author: Lasse Collin +Date: 2019-06-25 00:16:06 +0300 + + configure.ac: Fix a typo in a comment. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e873902641794210ad7db59743f98e3e1cd6139f +Author: Lasse Collin +Date: 2019-06-25 00:08:13 +0300 + + Tests: Silence warnings from clang -Wassign-enum. + + Also changed 999 to 99 so it fits even if lzma_check happened + to be 8 bits wide. + + tests/test_block_header.c | 3 ++- + tests/test_stream_flags.c | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit d499e467d99efeaae688564eedc4548837c1416a +Author: Lasse Collin +Date: 2019-06-24 23:52:17 +0300 + + liblzma: Add a comment. + + src/liblzma/common/stream_encoder_mt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a12b13c5f0d54c684fa8446f93fdac08ab2a716b +Author: Lasse Collin +Date: 2019-06-24 23:45:21 +0300 + + liblzma: Silence clang -Wmissing-variable-declarations. + + src/liblzma/check/crc32_table.c | 3 +++ + src/liblzma/check/crc64_table.c | 3 +++ + 2 files changed, 6 insertions(+) + +commit 1b4675cebf7471f7cc9b7072c950e3de97147063 +Author: Lasse Collin +Date: 2019-06-24 23:25:41 +0300 + + Add LZMA_RET_INTERNAL1..8 to lzma_ret and use one for LZMA_TIMED_OUT. + + LZMA_TIMED_OUT is *internally* used as a value for lzma_ret + enumeration. Previously it was #defined to 32 and cast to lzma_ret. + That way it wasn't visible in the public API, but this was hackish. + + Now the public API has eight LZMA_RET_INTERNALx members and + LZMA_TIMED_OUT is #defined to LZMA_RET_INTERNAL1. This way + the code is cleaner overall although the public API has a few + extra mysterious enum members. + + src/liblzma/api/lzma/base.h | 15 ++++++++++++++- + src/liblzma/common/common.c | 4 +--- + src/liblzma/common/common.h | 5 ++--- + src/xz/message.c | 8 ++++++++ + 4 files changed, 25 insertions(+), 7 deletions(-) + +commit 159c43875eb25deea626ed651274464bae3e32ef +Author: Lasse Collin +Date: 2019-06-24 22:57:43 +0300 + + xz: Silence a warning from clang -Wsign-conversion in main.c. + + src/xz/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 466cfcd3e52f6750ce28a635997f3dd84fb18515 +Author: Lasse Collin +Date: 2019-06-24 22:52:20 +0300 + + xz: Make "headings" static in list.c. + + Caught by clang -Wmissing-variable-declarations. + + src/xz/list.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 608517b9b76c41fac6613dbda1193d6f41338e19 +Author: Lasse Collin +Date: 2019-06-24 22:47:39 +0300 + + liblzma: Remove incorrect uses of lzma_attribute((__unused__)). + + Caught by clang -Wused-but-marked-unused. + + src/liblzma/common/alone_decoder.c | 3 +-- + src/liblzma/common/alone_encoder.c | 3 +-- + src/liblzma/lz/lz_decoder.c | 3 +-- + 3 files changed, 3 insertions(+), 6 deletions(-) + +commit c2d2ab6a9d41a2b55d047c5b710aacf80d219255 +Author: Lasse Collin +Date: 2019-06-24 20:53:55 +0300 + + Tests: Silence a warning from -Wsign-conversion. + + tests/create_compress_files.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 2402f7873dcae719d0ebddd23bb579074519ac52 +Author: Lasse Collin +Date: 2019-06-24 20:45:49 +0300 + + xz: Fix an integer overflow with 32-bit off_t. + + Or any off_t which isn't very big (like signed 64 bit integer + that most system have). A small off_t could overflow if the + file being decompressed had long enough run of zero bytes, + which would result in corrupt output. + + src/xz/file_io.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit 4fd3a8dd0b60f029e1c66a0ee634f9e9fda3caa9 +Author: Lasse Collin +Date: 2019-06-24 01:24:17 +0300 + + xz: Cleanup io_seek_src() a bit. + + lseek() returns -1 on error and checking for -1 is nicer. + + src/xz/file_io.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit dfda7cf6afa486e10df035327d68753896dfb48a +Author: Lasse Collin +Date: 2019-06-24 00:57:23 +0300 + + Tests: Remove a duplicate branch from tests/tests.h. + + The duplication was introduced about eleven years ago and + should have been cleaned up back then already. + + This was caught by -Wduplicated-branches. + + tests/tests.h | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +commit 1d4a904d8fb634bd5a04f7fbdd17d3739f3d8866 +Author: Lasse Collin +Date: 2019-06-24 00:40:45 +0300 + + xz: Change io_seek_src and io_pread arguments from off_t to uint64_t. + + This helps fixing warnings from -Wsign-conversion and makes the + code look better too. + + src/xz/file_io.c | 16 ++++++++++++---- + src/xz/file_io.h | 4 ++-- + src/xz/list.c | 9 ++++----- + 3 files changed, 18 insertions(+), 11 deletions(-) + +commit 50120deb0159fcb53ee1a6caffb2bb81a1ecd990 +Author: Lasse Collin +Date: 2019-06-24 00:12:38 +0300 + + xz: list.c: Fix some warnings from -Wsign-conversion. + + src/xz/list.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit d0a78751eb54fb1572002746c533936a118e4e42 +Author: Lasse Collin +Date: 2019-06-23 23:22:45 +0300 + + tuklib_mbstr_width: Fix a warning from -Wsign-conversion. + + src/common/tuklib_mbstr_width.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7883d73530b4b2a701ddd7d50c35676cbc158039 +Author: Lasse Collin +Date: 2019-06-23 23:19:34 +0300 + + xz: Fix some of the warnings from -Wsign-conversion. + + src/xz/args.c | 4 ++-- + src/xz/coder.c | 4 ++-- + src/xz/file_io.c | 5 +++-- + src/xz/message.c | 4 ++-- + src/xz/mytime.c | 4 ++-- + src/xz/options.c | 2 +- + src/xz/util.c | 4 ++-- + 7 files changed, 14 insertions(+), 13 deletions(-) + +commit c2b994fe3d35e9e575c28869a2f7f534f2495d05 +Author: Lasse Collin +Date: 2019-06-23 22:27:45 +0300 + + tuklib_cpucores: Silence warnings from -Wsign-conversion. + + src/common/tuklib_cpucores.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 07c4fa9e1a195e0543f271380c8de22a3ab145ff +Author: Lasse Collin +Date: 2019-06-23 21:40:47 +0300 + + xzdec: Fix warnings from -Wsign-conversion. + + src/xzdec/xzdec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dfac2c9a1d7d4a2b8a5d7c9c6d567dee48318bcf +Author: Lasse Collin +Date: 2019-06-23 21:38:56 +0300 + + liblzma: Fix warnings from -Wsign-conversion. + + Also, more parentheses were added to the literal_subcoder + macro in lzma_comon.h (better style but no functional change + in the current usage). + + src/liblzma/common/block_header_decoder.c | 2 +- + src/liblzma/delta/delta_decoder.c | 2 +- + src/liblzma/lzma/fastpos.h | 2 +- + src/liblzma/lzma/lzma2_decoder.c | 8 ++++---- + src/liblzma/lzma/lzma_common.h | 3 ++- + src/liblzma/lzma/lzma_decoder.c | 16 ++++++++-------- + src/liblzma/simple/arm.c | 6 +++--- + src/liblzma/simple/armthumb.c | 8 ++++---- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 9 +++++---- + src/liblzma/simple/x86.c | 2 +- + 11 files changed, 31 insertions(+), 29 deletions(-) + +commit 41838dcc26375f6aa393a63e4d81e2f4d223de07 +Author: Lasse Collin +Date: 2019-06-23 19:33:55 +0300 + + tuklib_integer: Silence warnings from -Wsign-conversion. + + src/common/tuklib_integer.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 3ce05d235f736d392347a05086b8033416874b87 +Author: Lasse Collin +Date: 2019-06-20 19:40:30 +0300 + + tuklib_integer: Fix usage of conv macros. + + Use a temporary variable instead of e.g. + conv32le(unaligned_read32ne(buf)) because the macro can + evaluate its argument multiple times. + + src/common/tuklib_integer.h | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit b525b0c0ef40cd89b69294c9b8d57f4a8db58e1f +Author: Lasse Collin +Date: 2019-06-03 20:44:19 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 039a168e8cf201d5104a25ec41f0cf25eda6cc53 +Author: Lasse Collin +Date: 2019-06-03 20:41:54 +0300 + + liblzma: Fix comments. + + Thanks to Bruce Stark. + + src/liblzma/common/alone_encoder.c | 4 ++-- + src/liblzma/common/block_util.c | 2 +- + src/liblzma/common/common.c | 2 +- + src/liblzma/common/filter_common.h | 2 +- + src/liblzma/common/filter_decoder.h | 2 +- + src/liblzma/common/filter_flags_encoder.c | 2 +- + 6 files changed, 7 insertions(+), 7 deletions(-) + +commit c460f6defebc5a81bbca90adc2476154ca244f69 +Author: Lasse Collin +Date: 2019-06-02 00:50:59 +0300 + + liblzma: Fix one more unaligned read to use unaligned_read16ne(). + + src/liblzma/lz/lz_encoder_hash.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c81d77c537f0b8c8672868e1dc6cf7290ce4a25b +Author: Lasse Collin +Date: 2019-06-01 21:41:55 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 386394fc9fcde2615391f804eaa466749f96f4ef +Author: Lasse Collin +Date: 2019-06-01 21:36:13 +0300 + + liblzma: memcmplen: Use ctz32() from tuklib_integer.h. + + The same compiler-specific #ifdefs are already in tuklib_integer.h + + src/liblzma/common/memcmplen.h | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +commit 264ab971ce2994baac41b1579c9c35aba7743fc8 +Author: Lasse Collin +Date: 2019-06-01 21:30:03 +0300 + + tuklib_integer: Cleanup MSVC-specific code. + + src/common/tuklib_integer.h | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +commit 33773c6f2a8711d4aa6656795db52c59a28580ec +Author: Lasse Collin +Date: 2019-06-01 19:01:21 +0300 + + liblzma: Use unaligned_readXXne functions instead of type punning. + + Now gcc -fsanitize=undefined should be clean. + + Thanks to Jeffrey Walton. + + src/liblzma/common/memcmplen.h | 12 ++++++------ + src/liblzma/lzma/lzma_encoder_private.h | 2 +- + 2 files changed, 7 insertions(+), 7 deletions(-) + +commit e5f13a66567b1987e0aae42c6fdcd277bb5810ba +Author: Lasse Collin +Date: 2019-06-01 18:46:54 +0300 + + tuklib_integer: Autodetect support for unaligned access on ARM. + + The result is used as the default for --enable-unaligned-access. + The test should work with GCC and Clang. + + m4/tuklib_integer.m4 | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 3bc112c2d38d5f348bce7bc2422286b1692c7490 +Author: Lasse Collin +Date: 2019-06-01 18:41:16 +0300 + + tuklib_integer: Improve unaligned memory access. + + Now memcpy() or GNU C packed structs for unaligned access instead + of type punning. See the comment in this commit for details. + + Avoiding type punning with unaligned access is needed to + silence gcc -fsanitize=undefined. + + New functions: unaliged_readXXne and unaligned_writeXXne where + XX is 16, 32, or 64. + + src/common/tuklib_integer.h | 180 +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 168 insertions(+), 12 deletions(-) + +commit 2a22de439ec63da1927b640eda309296a1e8dce5 +Author: Lasse Collin +Date: 2019-05-13 20:05:17 +0300 + + liblzma: Avoid memcpy(NULL, foo, 0) because it is undefined behavior. + + I should have always known this but I didn't. Here is an example + as a reminder to myself: + + int mycopy(void *dest, void *src, size_t n) + { + memcpy(dest, src, n); + return dest == NULL; + } + + In the example, a compiler may assume that dest != NULL because + passing NULL to memcpy() would be undefined behavior. Testing + with GCC 8.2.1, mycopy(NULL, NULL, 0) returns 1 with -O0 and -O1. + With -O2 the return value is 0 because the compiler infers that + dest cannot be NULL because it was already used with memcpy() + and thus the test for NULL gets optimized out. + + In liblzma, if a null-pointer was passed to memcpy(), there were + no checks for NULL *after* the memcpy() call, so I cautiously + suspect that it shouldn't have caused bad behavior in practice, + but it's hard to be sure, and the problematic cases had to be + fixed anyway. + + Thanks to Jeffrey Walton. + + src/liblzma/common/common.c | 6 +++++- + src/liblzma/lz/lz_decoder.c | 12 +++++++++--- + src/liblzma/simple/simple_coder.c | 10 +++++++++- + 3 files changed, 23 insertions(+), 5 deletions(-) + +commit d3fc850cfedc058247d9e334ce59bbc8f2286d8a +Author: Lasse Collin +Date: 2019-05-11 20:56:08 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4adb8288ab61d5f14e212007b8742df0710baf73 +Author: Lasse Collin +Date: 2019-05-11 20:54:12 +0300 + + xz: Update xz man page date. + + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2fb0ddaa557ce86e38fe06439930fa8665f092fd +Author: Antoine Cœur +Date: 2019-05-08 13:30:57 +0800 + + spelling + + Doxyfile.in | 2 +- + NEWS | 2 +- + doc/examples/11_file_info.c | 2 +- + src/liblzma/api/lzma/block.h | 2 +- + src/liblzma/api/lzma/hardware.h | 2 +- + src/liblzma/api/lzma/lzma12.h | 2 +- + src/liblzma/api/lzma/vli.h | 2 +- + src/liblzma/common/file_info.c | 4 ++-- + src/liblzma/common/hardware_physmem.c | 2 +- + src/liblzma/common/index.c | 4 ++-- + src/liblzma/common/stream_encoder_mt.c | 2 +- + src/liblzma/common/vli_decoder.c | 2 +- + src/liblzma/lz/lz_decoder.c | 2 +- + src/scripts/xzgrep.in | 2 +- + src/xz/args.c | 2 +- + src/xz/coder.c | 4 ++-- + src/xz/list.c | 4 ++-- + src/xz/main.c | 2 +- + src/xz/mytime.h | 2 +- + src/xz/private.h | 2 +- + src/xz/xz.1 | 2 +- + windows/build.bash | 2 +- + 22 files changed, 26 insertions(+), 26 deletions(-) + +commit 4ed339606156bd313ed99237485cb8ed0362d64f +Author: Lasse Collin +Date: 2019-05-01 18:43:10 +0300 + + xz: In xz -lvv look at the widths of the check names too. + + Now the widths of the check names is used to adjust the width + of the Check column. This way there no longer is a need to restrict + the widths of the check names to be at most ten terminal-columns. + + src/xz/list.c | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + +commit 2f4281a1001dcf7fdf1418c0c0d246c16561fb65 +Author: Lasse Collin +Date: 2019-05-01 18:33:25 +0300 + + xz: Fix xz -lvv column alignment to look at the translated strings. + + src/xz/list.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 01d01b7c7c0b8eaf7f780a5584ec52c22d10fa4a +Author: Lasse Collin +Date: 2019-05-01 16:52:36 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 64030c6b17f7743df03a9948a0ccfcdf40c6b97c +Author: Lasse Collin +Date: 2019-05-01 16:43:16 +0300 + + Windows: Update VS version in windows/vs2019/config.h. + + windows/vs2019/config.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2dc9117f5fbfab31444a3ca1e55795ccfa8a9f51 +Author: Julien Marrec +Date: 2019-04-25 17:44:06 +0200 + + Windows: Upgrade solution itself + + windows/vs2019/xz_win.sln | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit ac31413916fa9b11bab17f0f0aa63e2869360f6f +Author: Julien Marrec +Date: 2019-04-25 17:40:24 +0200 + + Windows: Upgrade solution with VS2019 + + windows/vs2019/liblzma.vcxproj | 15 ++++++++------- + windows/vs2019/liblzma_dll.vcxproj | 15 ++++++++------- + 2 files changed, 16 insertions(+), 14 deletions(-) + +commit be25a0c37ba92a20c390b4d17fe502457fe96b71 +Author: Julien Marrec +Date: 2019-04-25 17:39:32 +0200 + + Windows: Duplicate windows/vs2017 before upgrading + + windows/vs2019/config.h | 148 ++++++++++++++ + windows/vs2019/liblzma.vcxproj | 356 ++++++++++++++++++++++++++++++++++ + windows/vs2019/liblzma_dll.vcxproj | 385 +++++++++++++++++++++++++++++++++++++ + windows/vs2019/xz_win.sln | 48 +++++ + 4 files changed, 937 insertions(+) + +commit d0e58b3a51e8e616f3dc26ec7b7e4aa0fa6991ad +Author: Lasse Collin +Date: 2019-03-04 22:49:04 +0200 + + README: Update translation instructions. + + XZ Utils is now part of the Translation Project + . + + README | 32 +++++++++++++------------------- + 1 file changed, 13 insertions(+), 19 deletions(-) + +commit a750c35a7d45a16c11c1d40fecee8443c32a9996 +Author: Lasse Collin +Date: 2019-03-04 21:20:39 +0200 + + xz: Automatically align column headings in xz -lvv. + + src/xz/list.c | 263 ++++++++++++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 212 insertions(+), 51 deletions(-) + +commit 6cb42e8aa1dc37bf403a9f5acbd07e86036b7e77 +Author: Lasse Collin +Date: 2019-03-04 01:07:59 +0200 + + xz: Automatically align strings ending in a colon in --list output. + + This should avoid alignment errors in translations with these + strings. + + src/xz/list.c | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 102 insertions(+), 12 deletions(-) + +commit 1e3f29b62f2c03e50fc9ebea7b83c1497dd35484 +Author: Lasse Collin +Date: 2019-01-13 17:29:23 +0200 + + Windows/VS2017: Omit WindowsTargetPlatformVersion from project files. + + I understood that if a WTPV is specified, it's often wrong + because different VS installations have different SDK version + installed. Omitting the WTPV tag makes VS2017 default to + Windows SDK 8.1 which often is also missing, so in any case + people may need to specify the WTPV before building. But some + day in the future a missing WTPV tag will start to default to + the latest installed SDK which sounds reasonable: + + https://developercommunity.visualstudio.com/content/problem/140294/windowstargetplatformversion-makes-it-impossible-t.html + + Thanks to "dom". + + windows/INSTALL-MSVC.txt | 4 ++++ + windows/vs2017/liblzma.vcxproj | 1 - + windows/vs2017/liblzma_dll.vcxproj | 1 - + 3 files changed, 4 insertions(+), 2 deletions(-) + +commit 4d86076332aece6314063d3712a5f364172bbb0f +Author: Lasse Collin +Date: 2018-12-20 20:42:29 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit b55d79461d1f6aeaac03c7dae84481e5eb8bea4c +Author: Lasse Collin +Date: 2018-12-14 20:34:30 +0200 + + xz: Fix a crash in progress indicator when in passthru mode. + + "xz -dcfv not_an_xz_file" crashed (all four options are + required to trigger it). It caused xz to call + lzma_get_progress(&strm, ...) when no coder was initialized + in strm. In this situation strm.internal is NULL which leads + to a crash in lzma_get_progress(). + + The bug was introduced when xz started using lzma_get_progress() + to get progress info for multi-threaded compression, so the + bug is present in versions 5.1.3alpha and higher. + + Thanks to Filip Palian for + the bug report. + + src/xz/coder.c | 11 +++++++---- + src/xz/message.c | 18 ++++++++++++++++-- + src/xz/message.h | 3 ++- + 3 files changed, 25 insertions(+), 7 deletions(-) + +commit 4ae5526de013efd1021686fa80bdd10cf1cb9c56 +Author: Lasse Collin +Date: 2018-11-22 17:20:31 +0200 + + xz: Update man page timestamp. + + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6a36d0d5f49e0080ff64dd9ef250abd489bea2ad +Author: Pavel Raiskup +Date: 2018-11-22 15:14:34 +0100 + + 'have have' typos + + src/xz/signals.c | 2 +- + src/xz/xz.1 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 9eca51ef805ed8002a851df1b4995d71826c8b6e +Author: Lasse Collin +Date: 2018-11-02 20:40:48 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 106d1a663d4ba42b63231caa289f531548df81c1 +Author: Lasse Collin +Date: 2018-11-02 20:18:45 +0200 + + Tests: Add a fuzz test program and a config file for OSS-Fuzz. + + Thanks to Bhargava Shastry and Github user pdknsk. + + tests/Makefile.am | 1 + + tests/ossfuzz/Makefile | 7 ++++ + tests/ossfuzz/config/fuzz.dict | 2 + + tests/ossfuzz/config/fuzz.options | 2 + + tests/ossfuzz/fuzz.c | 82 +++++++++++++++++++++++++++++++++++++++ + 5 files changed, 94 insertions(+) + +commit a18ae42a79a19b1394b41eb3e238139fd28012ec +Author: Lasse Collin +Date: 2018-10-26 22:49:10 +0300 + + liblzma: Don't verify header CRC32s if building for fuzz testing. + + FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is #defined when liblzma + is being built for fuzz testing. + + Most fuzzed inputs would normally get rejected because of incorrect + CRC32 and the actual header decoding code wouldn't get fuzzed. + Disabling CRC32 checks avoids this problem. The fuzzer program + must still use LZMA_IGNORE_CHECK flag to disable verification of + integrity checks of uncompressed data. + + src/liblzma/common/block_header_decoder.c | 5 ++++- + src/liblzma/common/index_decoder.c | 5 ++++- + src/liblzma/common/index_hash.c | 5 ++++- + src/liblzma/common/stream_flags_decoder.c | 10 ++++++++-- + 4 files changed, 20 insertions(+), 5 deletions(-) + +commit f76f7516d6a1c832f61810c82e92d151cc80966c +Author: Lasse Collin +Date: 2018-07-27 18:10:44 +0300 + + xzless: Rename unused variables to silence static analysers. + + In this particular case I don't see this affecting readability + of the code. + + Thanks to Pavel Raiskup. + + src/scripts/xzless.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3cbcaeb07eb7543735befd6f507fdb5fa4363cff +Author: Lasse Collin +Date: 2018-07-27 16:02:58 +0300 + + liblzma: Remove an always-true condition from lzma_index_cat(). + + This should help static analysis tools to see that newg + isn't leaked. + + Thanks to Pavel Raiskup. + + src/liblzma/common/index.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 76762ae6098ec55c326f4b4b4a42e8c1918ee81f +Author: Lasse Collin +Date: 2018-05-19 21:23:25 +0300 + + liblzma: Improve lzma_properties_decode() API documentation. + + src/liblzma/api/lzma/filter.h | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 2267f5b0d20a5d24e93fcd9f72ea7eeb0d89708c +Author: Lasse Collin +Date: 2018-04-29 18:58:19 +0300 + + Bump the version number to 5.3.1alpha. + + src/liblzma/api/lzma/version.h | 2 +- + src/liblzma/liblzma.map | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit cee3021d30704858e4bdd22240e7d28e570d7451 +Author: Lasse Collin +Date: 2018-04-29 18:48:00 +0300 + + extra/scanlzma: Fix compiler warnings. + + extra/scanlzma/scanlzma.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit c5c7ceb08a011b97d261798033e2c39613a69eb7 +Author: Lasse Collin +Date: 2018-04-29 18:44:47 +0300 + + DOS: Add file_info.c to the list of files to build. + + dos/Makefile | 1 + + 1 file changed, 1 insertion(+) + +commit 114cab97af766b21e0fc8620479202fb1e7a5e41 +Author: Lasse Collin +Date: 2018-04-29 18:33:10 +0300 + + Update NEWS for 5.3.1alpha. + + NEWS | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit b8139e11c512bbf32bf58ab0689f9bb6c52819da +Author: Lasse Collin +Date: 2018-04-29 18:15:37 +0300 + + Add NEWS for 5.2.4. + + NEWS | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 47b59d47cfd904a420fbd45629d168ca1973721d +Author: Lasse Collin +Date: 2018-02-06 19:36:30 +0200 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit bc197991690ede24ab143665b5b0f0f9cb35cc46 +Author: Ben Boeckel +Date: 2018-01-29 13:58:18 -0500 + + nothrow: use noexcept for C++11 and newer + + In C++11, the `throw()` specifier is deprecated and `noexcept` is + preffered instead. + + src/liblzma/api/lzma.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit fb6d4f83cb6e144734f2a4216bb117bd56dc3cb5 +Author: Lasse Collin +Date: 2018-02-06 18:02:48 +0200 + + liblzma: Remove incorrect #ifdef from range_common.h. + + In most cases it was harmless but it could affect some + custom build systems. + + Thanks to Pippijn van Steenhoven. + + src/liblzma/rangecoder/range_common.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit bc577d35c2d0ed17f554d2d8107b2a2a9abbac76 +Author: Lasse Collin +Date: 2018-01-10 22:10:39 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 713bbc1a80f26d34c96ed3dbb9887362204de3a1 +Author: Lasse Collin +Date: 2018-01-10 21:54:27 +0200 + + tuklib_integer: New Intel C compiler needs immintrin.h. + + Thanks to Melanie Blower (Intel) for the patch. + + src/common/tuklib_integer.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit a0ee1afbd99da138b559cb27fa2022e7f1ab44f3 +Author: Lasse Collin +Date: 2017-09-24 20:04:24 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit a1e2c568de29c0b57d873eab40a2879b749da429 +Author: Lasse Collin +Date: 2017-09-16 20:36:20 +0300 + + Windows: Fix paths in VS project files. + + Some paths use slashes instead of backslashes as directory + separators... now it should work (I tested VS2013 version). + + windows/vs2013/liblzma.vcxproj | 12 ++++++------ + windows/vs2013/liblzma_dll.vcxproj | 24 ++++++++++++------------ + windows/vs2017/liblzma.vcxproj | 12 ++++++------ + windows/vs2017/liblzma_dll.vcxproj | 24 ++++++++++++------------ + 4 files changed, 36 insertions(+), 36 deletions(-) + +commit cea5cf8d26c9d1dc30a808614d79c0b25640e15e +Author: Lasse Collin +Date: 2017-09-16 12:56:20 +0300 + + Windows: Update VS2017 project files to include file info decoder. + + windows/vs2017/liblzma.vcxproj | 2 ++ + windows/vs2017/liblzma_dll.vcxproj | 2 ++ + 2 files changed, 4 insertions(+) + +commit 95d563db3ee497b223e522b699c4d4c29943eef0 +Author: Lasse Collin +Date: 2017-09-16 12:54:23 +0300 + + Windows: Add project files for VS2017. + + These files match the v5.2 branch (no file info decoder). + + windows/vs2017/config.h | 148 ++++++++++++++ + windows/vs2017/liblzma.vcxproj | 355 ++++++++++++++++++++++++++++++++++ + windows/vs2017/liblzma_dll.vcxproj | 384 +++++++++++++++++++++++++++++++++++++ + windows/vs2017/xz_win.sln | 48 +++++ + 4 files changed, 935 insertions(+) + +commit ab72416d62ea8f50ad31d5b8545fcb6a2bf96b73 +Author: Lasse Collin +Date: 2017-09-16 12:45:50 +0300 + + Windows: Update VS2013 project files to include file info decoder. + + windows/vs2013/liblzma.vcxproj | 2 ++ + windows/vs2013/liblzma_dll.vcxproj | 2 ++ + 2 files changed, 4 insertions(+) + +commit 82388980187b0e3794d187762054200bbdcc9a53 +Author: Lasse Collin +Date: 2017-09-16 12:39:43 +0300 + + Windows: Move VS2013 files into windows/vs2013 directory. + + windows/{ => vs2013}/config.h | 0 + windows/{ => vs2013}/liblzma.vcxproj | 278 +++++++++++++++--------------- + windows/{ => vs2013}/liblzma_dll.vcxproj | 280 +++++++++++++++---------------- + windows/{ => vs2013}/xz_win.sln | 0 + 4 files changed, 279 insertions(+), 279 deletions(-) + +commit 94e3f986aa4e14b4ff01ac24857f499630d6d180 +Author: Lasse Collin +Date: 2017-08-14 20:08:33 +0300 + + Fix or hide warnings from GCC 7's -Wimplicit-fallthrough. + + src/liblzma/lzma/lzma_decoder.c | 6 ++++++ + src/xz/list.c | 2 ++ + 2 files changed, 8 insertions(+) + +commit 0b0e1e6803456aac641a59332200f8e95e2b7ea8 +Author: Alexey Tourbin +Date: 2017-05-16 23:56:35 +0300 + + Docs: Fix a typo in a comment in doc/examples/02_decompress.c. + + doc/examples/02_decompress.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a015cd1f90116e655be4eaf4aad42c4c911c2807 +Author: Lasse Collin +Date: 2017-05-23 18:34:43 +0300 + + xz: Fix "xz --list --robot missing_or_bad_file.xz". + + It ended up printing an uninitialized char-array when trying to + print the check names (column 7) on the "totals" line. + + This also changes the column 12 (minimum xz version) to + 50000002 (xz 5.0.0) instead of 0 when there are no valid + input files. + + Thanks to kidmin for the bug report. + + src/xz/list.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit c2e29f06a7d1e3ba242ac2fafc69f5d6e92f62cd +Author: Lasse Collin +Date: 2017-04-24 20:20:11 +0300 + + Docs: Add doc/examples/11_file_info.c. + + doc/examples/11_file_info.c | 206 ++++++++++++++++++++++++++++++++++++++++++++ + doc/examples/Makefile | 3 +- + 2 files changed, 208 insertions(+), 1 deletion(-) + +commit 1520f6ec808896375ac7bf778c449e0f7dea5f46 +Author: Lasse Collin +Date: 2017-04-24 19:48:47 +0300 + + Build: Omit pre-5.0.0 entries from the generated ChangeLog. + + It makes ChangeLog significantly smaller. + + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 8269782283806c90a8509c2ac2a308344f70e171 +Author: Lasse Collin +Date: 2017-04-24 19:48:23 +0300 + + xz: Use lzma_file_info_decoder() for --list. + + src/xz/list.c | 254 ++++++++++------------------------------------------------ + 1 file changed, 44 insertions(+), 210 deletions(-) + +commit e353d0b1cc0d3997ae5048faa8e6786414953e06 +Author: Lasse Collin +Date: 2017-04-24 19:35:50 +0300 + + liblzma: Add lzma_file_info_decoder(). + + src/liblzma/api/lzma/index.h | 66 ++++ + src/liblzma/common/Makefile.inc | 1 + + src/liblzma/common/file_info.c | 855 ++++++++++++++++++++++++++++++++++++++++ + src/liblzma/liblzma.map | 7 +- + 4 files changed, 928 insertions(+), 1 deletion(-) + +commit 144ef9e19e9496c995b21505dd1e111c442968d1 +Author: Lasse Collin +Date: 2017-04-24 19:30:22 +0300 + + Update the Git repository URL to HTTPS in ChangeLog. + + ChangeLog | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8c9842c265993d7dd4039f732d3546267fb5ecc4 +Author: Lasse Collin +Date: 2017-04-21 15:05:16 +0300 + + liblzma: Rename LZMA_SEEK to LZMA_SEEK_NEEDED and seek_in to seek_pos. + + src/liblzma/api/lzma/base.h | 18 +++++++++--------- + src/liblzma/common/common.c | 2 +- + src/xz/message.c | 2 +- + 3 files changed, 11 insertions(+), 11 deletions(-) + +commit 662b27c417cab248cb365dd7682121bdec4d5ae7 +Author: Lasse Collin +Date: 2017-04-19 22:17:35 +0300 + + Update the home page URLs to HTTPS. + + COPYING | 2 +- + README | 2 +- + configure.ac | 2 +- + doc/faq.txt | 4 ++-- + dos/config.h | 2 +- + src/common/common_w32res.rc | 2 +- + src/xz/xz.1 | 6 +++--- + src/xzdec/xzdec.1 | 4 ++-- + windows/README-Windows.txt | 2 +- + windows/config.h | 2 +- + 10 files changed, 14 insertions(+), 14 deletions(-) + +commit c28f0b3d00af87b92dda229831548d8eb0067d1d +Author: Lasse Collin +Date: 2017-04-05 18:47:22 +0300 + + xz: Add io_seek_src(). + + src/xz/file_io.c | 20 +++++++++++++++++--- + src/xz/file_io.h | 13 +++++++++++++ + 2 files changed, 30 insertions(+), 3 deletions(-) + +commit bba477257d7319c8764890f3669175b866d24944 +Author: Lasse Collin +Date: 2017-03-30 22:01:54 +0300 + + xz: Use POSIX_FADV_RANDOM for in "xz --list" mode. + + xz --list is random access so POSIX_FADV_SEQUENTIAL was clearly + wrong. + + src/xz/file_io.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit 310d19816d1652b0c8bb1b82574d46345d924752 +Author: Lasse Collin +Date: 2017-03-30 20:03:05 +0300 + + liblzma: Make lzma_index_decoder_init() visible to other liblzma funcs. + + This is to allow other functions to use it without going + via the public API (lzma_index_decoder()). + + src/liblzma/common/Makefile.inc | 1 + + src/liblzma/common/index_decoder.c | 10 +++++----- + src/liblzma/common/index_decoder.h | 24 ++++++++++++++++++++++++ + 3 files changed, 30 insertions(+), 5 deletions(-) + +commit a27920002dbc469f778a134fc665b7c3ea73701b +Author: Lasse Collin +Date: 2017-03-30 20:00:09 +0300 + + liblzma: Add generic support for input seeking (LZMA_SEEK). + + Also mention LZMA_SEEK in xz/message.c to silence a warning. + + src/liblzma/api/lzma/base.h | 31 ++++++++++++++++++++++++++++++- + src/liblzma/common/common.c | 12 +++++++++++- + src/xz/message.c | 1 + + 3 files changed, 42 insertions(+), 2 deletions(-) + +commit a0b1dda409bc3e6e2957a2651663fc411d2caf2d +Author: Lasse Collin +Date: 2017-03-30 19:47:45 +0300 + + liblzma: Fix lzma_memlimit_set(strm, 0). + + The 0 got treated specially in a buggy way and as a result + the function did nothing. The API doc said that 0 was supposed + to return LZMA_PROG_ERROR but it didn't. + + Now 0 is treated as if 1 had been specified. This is done because + 0 is already used to indicate an error from lzma_memlimit_get() + and lzma_memusage(). + + In addition, lzma_memlimit_set() no longer checks that the new + limit is at least LZMA_MEMUSAGE_BASE. It's counter-productive + for the Index decoder and was actually needed only by the + auto decoder. Auto decoder has now been modified to check for + LZMA_MEMUSAGE_BASE. + + src/liblzma/api/lzma/base.h | 7 ++++++- + src/liblzma/common/auto_decoder.c | 3 +++ + src/liblzma/common/common.c | 6 ++++-- + 3 files changed, 13 insertions(+), 3 deletions(-) + +commit 84462afaada61379f5878e46f8f00e25a1cdcf29 +Author: Lasse Collin +Date: 2017-03-30 19:16:55 +0300 + + liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder. + + src/liblzma/api/lzma/container.h | 21 +++++++++++++++++---- + src/liblzma/common/alone_decoder.c | 5 +---- + src/liblzma/common/auto_decoder.c | 5 +---- + src/liblzma/common/stream_decoder.c | 5 +---- + 4 files changed, 20 insertions(+), 16 deletions(-) + +commit cbc74017939690d13441b8926bb743fb03211b83 +Author: Lasse Collin +Date: 2017-03-30 18:58:18 +0300 + + liblzma: Fix handling of memlimit == 0 in lzma_index_decoder(). + + It returned LZMA_PROG_ERROR, which was done to avoid zero as + the limit (because it's a special value elsewhere), but using + LZMA_PROG_ERROR is simply inconvenient and can cause bugs. + + The fix/workaround is to treat 0 as if it were 1 byte. It's + effectively the same thing. The only weird consequence is + that then lzma_memlimit_get() will return 1 even when 0 was + specified as the limit. + + This fixes a very rare corner case in xz --list where a specific + memory usage limit and a multi-stream file could print the + error message "Internal error (bug)" instead of saying that + the memory usage limit is too low. + + src/liblzma/api/lzma/index.h | 18 +++++++++++------- + src/liblzma/common/index_decoder.c | 4 ++-- + 2 files changed, 13 insertions(+), 9 deletions(-) + +commit 78ae13bced912b1b92ae927992c99cbcc463cae7 +Author: Lasse Collin +Date: 2016-12-30 13:25:10 +0200 + + Update NEWS for 5.2.3. + + NEWS | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 0297863fdb453aed1a25eb025f3ba7bacbbb1357 +Author: Lasse Collin +Date: 2016-12-26 20:55:52 +0200 + + Document --enable-sandbox configure option in INSTALL. + + INSTALL | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +commit d4a0462abe5478193521c14625e1c81fead87f9f +Author: Lasse Collin +Date: 2016-11-21 20:24:50 +0200 + + liblzma: Avoid multiple definitions of lzma_coder structures. + + Only one definition was visible in a translation unit. + It avoided a few casts and temp variables but seems that + this hack doesn't work with link-time optimizations in compilers + as it's not C99/C11 compliant. + + Fixes: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html + + src/liblzma/common/alone_decoder.c | 44 +++++---- + src/liblzma/common/alone_encoder.c | 34 ++++--- + src/liblzma/common/auto_decoder.c | 35 ++++--- + src/liblzma/common/block_decoder.c | 41 ++++---- + src/liblzma/common/block_encoder.c | 40 ++++---- + src/liblzma/common/common.h | 18 ++-- + src/liblzma/common/index_decoder.c | 33 ++++--- + src/liblzma/common/index_encoder.c | 16 ++-- + src/liblzma/common/stream_decoder.c | 50 +++++----- + src/liblzma/common/stream_encoder.c | 56 ++++++----- + src/liblzma/common/stream_encoder_mt.c | 124 ++++++++++++++----------- + src/liblzma/delta/delta_common.c | 25 ++--- + src/liblzma/delta/delta_decoder.c | 6 +- + src/liblzma/delta/delta_encoder.c | 12 ++- + src/liblzma/delta/delta_private.h | 4 +- + src/liblzma/lz/lz_decoder.c | 60 ++++++------ + src/liblzma/lz/lz_decoder.h | 13 ++- + src/liblzma/lz/lz_encoder.c | 57 +++++++----- + src/liblzma/lz/lz_encoder.h | 9 +- + src/liblzma/lzma/lzma2_decoder.c | 32 ++++--- + src/liblzma/lzma/lzma2_encoder.c | 51 +++++----- + src/liblzma/lzma/lzma_decoder.c | 27 +++--- + src/liblzma/lzma/lzma_encoder.c | 29 +++--- + src/liblzma/lzma/lzma_encoder.h | 9 +- + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 3 +- + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 23 ++--- + src/liblzma/lzma/lzma_encoder_private.h | 6 +- + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 61 ++++++------ + src/liblzma/simple/simple_private.h | 12 +-- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 15 +-- + 35 files changed, 532 insertions(+), 423 deletions(-) + +commit a01794c52add98263b49119842c3e7141d1b9ced +Author: Lasse Collin +Date: 2016-10-24 18:53:25 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit df8f446e3ad47e5148b8c8d8b6e519d3ce29cb9d +Author: Lasse Collin +Date: 2016-10-24 18:51:36 +0300 + + tuklib_cpucores: Add support for sched_getaffinity(). + + It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better + than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity() + gives the number of cores available to the process instead of + the total number of cores online. + + As a side effect, this commit fixes a bug on GNU/kFreeBSD where + configure would detect the FreeBSD-specific cpuset_getaffinity() + but it wouldn't actually work because on GNU/kFreeBSD it requires + using -lfreebsd-glue when linking. Now the glibc-specific function + will be used instead. + + Thanks to Sebastian Andrzej Siewior for the original patch + and testing. + + m4/tuklib_cpucores.m4 | 30 +++++++++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 9 +++++++++ + 2 files changed, 38 insertions(+), 1 deletion(-) + +commit 446e4318fa79788e09299d5953b5dd428953d14b +Author: Lasse Collin +Date: 2016-06-30 20:27:36 +0300 + + xz: Fix copying of timestamps on Windows. + + xz used to call utime() on Windows, but its result gets lost + on close(). Using _futime() seems to work. + + Thanks to Martok for reporting the bug: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00261.html + + configure.ac | 2 +- + src/xz/file_io.c | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+), 1 deletion(-) + +commit 1b0ac0c53c761263e91e34195cb21dfdcfeac0bd +Author: Lasse Collin +Date: 2016-06-16 22:46:02 +0300 + + xz: Silence warnings from -Wlogical-op. + + Thanks to Evan Nemerson. + + src/xz/file_io.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit c83b7a03342c3325ff10400b22ee21edfcd1e026 +Author: Lasse Collin +Date: 2016-04-10 20:55:49 +0300 + + Build: Fix = to += for xz_SOURCES in src/xz/Makefile.am. + + Thanks to Christian Kujau. + + src/xz/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ade31a2bfb95c94d05fbfc0ecbba5d6377f2506e +Author: Lasse Collin +Date: 2016-04-10 20:54:17 +0300 + + Build: Bump GNU Gettext version requirement to 0.19. + + It silences a few warnings and most people probably have + 0.19 even on stable distributions. + + Thanks to Christian Kujau. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ac398c3bafa6e4c80e20571373a96947db863b3d +Author: Lasse Collin +Date: 2016-03-13 20:21:49 +0200 + + liblzma: Disable external SHA-256 by default. + + This is the sane thing to do. The conflict with OpenSSL + on some OSes and especially that the OS-provided versions + can be significantly slower makes it clear that it was + a mistake to have the external SHA-256 support enabled by + default. + + Those who want it can now pass --enable-external-sha256 to + configure. INSTALL was updated with notes about OSes where + this can be a bad idea. + + The SHA-256 detection code in configure.ac had some bugs that + could lead to a build failure in some situations. These were + fixed, although it doesn't matter that much now that the + external SHA-256 is disabled by default. + + MINIX >= 3.2.0 uses NetBSD's libc and thus has SHA256_Init + in libc instead of libutil. Support for the libutil version + was removed. + + INSTALL | 36 ++++++++++++++++++++++ + configure.ac | 76 +++++++++++++++++++++++------------------------ + src/liblzma/check/check.h | 16 ++++------ + 3 files changed, 79 insertions(+), 49 deletions(-) + +commit 6fd5ecb589a9fdd7a576ea48c4850d496bab9ce5 +Author: Lasse Collin +Date: 2016-03-10 20:27:05 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 473ef0dc69a30e64d5fa0d34aca02f7309faa3e9 +Author: Lasse Collin +Date: 2016-03-10 20:26:49 +0200 + + Build: Avoid SHA256_Init on FreeBSD and MINIX 3. + + On FreeBSD 10 and older, SHA256_Init from libmd conflicts + with libcrypto from OpenSSL. The OpenSSL version has + different sizeof(SHA256_CTX) and it can cause weird + problems if wrong SHA256_Init gets used. + + Looking at the source, MINIX 3 seems to have a similar issue but + I'm not sure. To be safe, I disabled SHA256_Init on MINIX 3 too. + + NetBSD has SHA256_Init in libc and they had a similar problem, + but they already fixed it in 2009. + + Thanks to Jim Wilcoxson for the bug report that helped + in finding the problem. + + configure.ac | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +commit faf302137e54d605b44ecf0373cb51a6403a2de1 +Author: Lasse Collin +Date: 2015-11-08 20:16:10 +0200 + + tuklib_physmem: Hopefully silence a warning on Windows. + + src/common/tuklib_physmem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e52e9151cf8613022d1de4712ff39dbcb666e991 +Author: Lasse Collin +Date: 2015-11-04 23:17:43 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 14115f84a38161d55eaa2d070f08739bde37e966 +Author: Lasse Collin +Date: 2015-11-04 23:14:00 +0200 + + liblzma: Make Valgrind happier with optimized (gcc -O2) liblzma. + + When optimizing, GCC can reorder code so that an uninitialized + value gets used in a comparison, which makes Valgrind unhappy. + It doesn't happen when compiled with -O0, which I tend to use + when running Valgrind. + + Thanks to Rich Prohaska. I remember this being mentioned long + ago by someone else but nothing was done back then. + + src/liblzma/lz/lz_encoder.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit f4c95ba94beb71a608eb6eadbf82b44f53a0260e +Author: Lasse Collin +Date: 2015-11-03 20:55:45 +0200 + + liblzma: Rename lzma_presets.c back to lzma_encoder_presets.c. + + It would be too annoying to update other build systems + just because of this. + + src/liblzma/lzma/Makefile.inc | 2 +- + src/liblzma/lzma/{lzma_presets.c => lzma_encoder_presets.c} | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit c7bc20a6f3e71920871d48db31a79ab58b5a0a4b +Author: Lasse Collin +Date: 2015-11-03 20:47:07 +0200 + + Build: Disable xzdec, lzmadec, and lzmainfo when they cannot be built. + + They all need decoder support and if that isn't available, + there's no point trying to build them. + + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +commit 5cbca1205deeb6fb7afe7a864fa68a57466d928a +Author: Lasse Collin +Date: 2015-11-03 20:35:19 +0200 + + Build: Simplify $enable_{encoders,decoders} usage a bit. + + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit af13781886c8e7a0aabebb5141ea282dc364f5c6 +Author: Lasse Collin +Date: 2015-11-03 20:31:31 +0200 + + Windows/MSVC: Update config.h. + + windows/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 9fa5949330f162c5a2f6653f83025327837e8f39 +Author: Lasse Collin +Date: 2015-11-03 20:29:58 +0200 + + DOS: Update config.h. + + dos/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit cb3111e3ed84152912b5138d690c8d9f00c6ef02 +Author: Lasse Collin +Date: 2015-11-03 20:29:33 +0200 + + xz: Make xz buildable even when encoders or decoders are disabled. + + The patch is quite long but it's mostly about adding new #ifdefs + to omit code when encoders or decoders have been disabled. + + This adds two new #defines to config.h: HAVE_ENCODERS and + HAVE_DECODERS. + + configure.ac | 4 ++++ + src/xz/Makefile.am | 8 ++++++-- + src/xz/args.c | 16 ++++++++++++++++ + src/xz/coder.c | 33 +++++++++++++++++++++++++-------- + src/xz/main.c | 9 +++++++-- + src/xz/private.h | 5 ++++- + 6 files changed, 62 insertions(+), 13 deletions(-) + +commit 4cc584985c0b7a13901da1b7a64ef9f7cc36e8ab +Author: Lasse Collin +Date: 2015-11-03 18:06:40 +0200 + + Build: Build LZMA1/2 presets also when only decoder is wanted. + + People shouldn't rely on the presets when decoding raw streams, + but xz uses the presets as the starting point for raw decoder + options anyway. + + lzma_encocder_presets.c was renamed to lzma_presets.c to + make it clear it's not used solely by the encoder code. + + src/liblzma/lzma/Makefile.inc | 6 +++++- + src/liblzma/lzma/{lzma_encoder_presets.c => lzma_presets.c} | 3 ++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +commit 23ed1d41489f632155bbc9660f323d57e09da180 +Author: Lasse Collin +Date: 2015-11-03 17:54:48 +0200 + + Build: Fix configure to handle LZMA1 dependency with LZMA2. + + Now it gives an error if LZMA1 encoder/decoder is missing + when LZMA2 encoder/decoder was requested. Even better would + be LZMA2 implicitly enabling LZMA1 but it would need more code. + + configure.ac | 5 ----- + 1 file changed, 5 deletions(-) + +commit b0bc3e03852af13419ea2960881824258d451117 +Author: Lasse Collin +Date: 2015-11-03 17:41:54 +0200 + + Build: Don't omit lzma_cputhreads() unless using --disable-threads. + + Previously it was omitted if encoders were disabled + with --disable-encoders. It didn't make sense and + it also broke the build. + + src/liblzma/common/Makefile.inc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit c6bf438ab39e0fb4a47d3c81725c227919502726 +Author: Lasse Collin +Date: 2015-11-02 18:16:51 +0200 + + liblzma: Fix a build failure related to external SHA-256 support. + + If an appropriate header and structure were found by configure, + but a library with a usable SHA-256 functions wasn't, the build + failed. + + src/liblzma/check/check.h | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +commit e18adc56f2262aa9394d46681e9e4b9981ed5e97 +Author: Lasse Collin +Date: 2015-11-02 15:19:10 +0200 + + xz: Always close the file before trying to delete it. + + unlink() can return EBUSY in errno for open files on some + operating systems and file systems. + + src/xz/file_io.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +commit 282e768a1484e88c8b7ec35655ee4959954ec87a +Author: Lasse Collin +Date: 2015-10-12 21:08:42 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 372e402713a1d4337ffce5f56d5c5c9ed99a66d0 +Author: Lasse Collin +Date: 2015-10-12 21:07:41 +0300 + + Tests: Add tests for the two bugs fixed in index.c. + + tests/test_index.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit 21515d79d778b8730a434f151b07202d52a04611 +Author: Lasse Collin +Date: 2015-10-12 20:45:15 +0300 + + liblzma: Fix lzma_index_dup() for empty Streams. + + Stream Flags and Stream Padding weren't copied from + empty Streams. + + src/liblzma/common/index.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 09f395b6b360c0b13e8559eece1d179b908ebd3a +Author: Lasse Collin +Date: 2015-10-12 20:31:44 +0300 + + liblzma: Add a note to index.c for those using static analyzers. + + src/liblzma/common/index.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 3bf857edfef51374f6f3fffae3d817f57d3264a0 +Author: Lasse Collin +Date: 2015-10-12 20:29:09 +0300 + + liblzma: Fix a memory leak in error path of lzma_index_dup(). + + lzma_index_dup() calls index_dup_stream() which, in case of + an error, calls index_stream_end() to free memory allocated + by index_stream_init(). However, it illogically didn't + actually free the memory. To make it logical, the tree + handling code was modified a bit in addition to changing + index_stream_end(). + + Thanks to Evan Nemerson for the bug report. + + src/liblzma/common/index.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 7f05803979b4b79642d5be4218a79da7a0b12c47 +Author: Lasse Collin +Date: 2015-09-29 13:57:28 +0300 + + Update NEWS for 5.2.2. + + NEWS | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 397fcc0946315b55c3c6d80e37e82a2a78bc15c1 +Author: Hauke Henningsen +Date: 2015-08-17 04:59:54 +0200 + + Update German translation, mostly wrt orthography + + Provide an update of the German translation. + * A lot of compound words were previously written with spaces, while + German orthography is relatively clear in that the components + should not be separated. + * When referring to the actual process of (de)compression rather than the + concept, replace “(De-)Kompression” with “(De-)Komprimierung”. + Previously, both forms were used in this context and are now used in a + manner consistent with “Komprimierung” being more likely to refer to + a process. + * Consistently translate “standard input”/“output” + * Use “Zeichen” instead of false friend “Charakter” for “character” + * Insert commas around relative clauses (as required in German) + * Some other minor corrections + * Capitalize “ß” as “ẞ” + * Consistently start option descriptions in --help with capital letters + + Acked-By: Andre Noll + + * Update after msgmerge + + po/de.po | 383 ++++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 196 insertions(+), 187 deletions(-) + +commit cbc9e39bae715accb44168930a71888480aad569 +Author: Lasse Collin +Date: 2015-08-11 13:23:04 +0300 + + Build: Minor Cygwin cleanup. + + Some tests used "cygwin*" and some used "cygwin". I changed + them all to use "cygwin". Shouldn't affect anything in practice. + + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit bcacd8ce7a031566858e5e03c1009064c3f1c89e +Author: Lasse Collin +Date: 2015-08-11 13:21:52 +0300 + + Build: Support building of MSYS2 binaries. + + configure.ac | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 0275a5398c01d57b724dec7fea52dec3bd6edc6c +Author: Lasse Collin +Date: 2015-08-09 21:06:26 +0300 + + Windows: Define DLL_EXPORT when building liblzma.dll with MSVC. + + src/liblzma/common/common.h uses it to set __declspec(dllexport) + for the API symbols. + + Thanks to Adam Walling. + + windows/liblzma_dll.vcxproj | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit a74525cf9b945fb0b370e64cf406104beb31729b +Author: Lasse Collin +Date: 2015-08-09 21:02:20 +0300 + + Windows: Omit unneeded header files from MSVC project files. + + windows/liblzma.vcxproj | 5 ----- + windows/liblzma_dll.vcxproj | 5 ----- + 2 files changed, 10 deletions(-) + +commit fbbb295a91caf39faf8838c8c39526e4cb4dc121 +Author: Lasse Collin +Date: 2015-07-12 20:48:19 +0300 + + liblzma: A MSVC-specific hack isn't needed with MSVC 2013 and newer. + + src/liblzma/api/lzma.h | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +commit 713dbe5c230fe00865a54f5c32358ea30f9a1156 +Author: Lasse Collin +Date: 2015-06-19 20:38:55 +0300 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit 3a5d755d055d51f99c523b4c2952727e1e69cfa1 +Author: Lasse Collin +Date: 2015-06-19 20:21:30 +0300 + + Windows: Update the docs. + + INSTALL | 29 ++++++++----- + windows/INSTALL-MSVC.txt | 47 ++++++++++++++++++++++ + windows/{INSTALL-Windows.txt => INSTALL-MinGW.txt} | 2 +- + 3 files changed, 67 insertions(+), 11 deletions(-) + +commit b0798c6aa6184efcefd0bdcca20f96121a13feda +Author: Lasse Collin +Date: 2015-06-19 17:25:31 +0300 + + Windows: Add MSVC project files for building liblzma. + + Thanks to Adam Walling for creating these files. + + windows/liblzma.vcxproj | 359 ++++++++++++++++++++++++++++++++++++++++ + windows/liblzma_dll.vcxproj | 388 ++++++++++++++++++++++++++++++++++++++++++++ + windows/xz_win.sln | 48 ++++++ + 3 files changed, 795 insertions(+) + +commit 9b02a4ffdac1b9f066658ec4c95c0834f4cd2fb7 +Author: Andre Noll +Date: 2015-05-28 15:50:00 +0200 + + Fix typo in German translation. + + As pointed out by Robert Pollak, there's a typo in the German + translation of the compression preset option (-0 ... -9) help text. + "The compressor" translates to "der Komprimierer", and the genitive + form is "des Komprimierers". The old word makes no sense at all. + + po/de.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c7f4041f6b8f4729f88d3bc888b2a4080ae51f72 +Author: Lasse Collin +Date: 2015-05-13 20:57:55 +0300 + + Tests: Fix a memory leak in test_bcj_exact_size. + + Thanks to Cristian Rodríguez. + + tests/test_bcj_exact_size.c | 1 + + 1 file changed, 1 insertion(+) + +commit 17b29d4f0ae0f780fbd69e15a398dc478d8492f8 +Author: Lasse Collin +Date: 2015-05-12 18:08:24 +0300 + + Fix NEWS about threading in 5.2.0. + + Thanks to Andy Hochhaus. + + NEWS | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 49c26920d6e2d85e5c6123e34958aed2e77485ad +Author: Lasse Collin +Date: 2015-05-11 21:26:16 +0300 + + xz: Document that threaded decompression hasn't been implemented yet. + + src/xz/xz.1 | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 5b2458cb244ed237efe4de1ebcf06e1b3a1f4256 +Author: Lasse Collin +Date: 2015-04-20 20:20:29 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 6bd0349c58451b13442e8f463e35de83548bf985 +Author: Lasse Collin +Date: 2015-04-20 19:59:18 +0300 + + Revert "xz: Use pipe2() if available." + + This reverts commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd. + It is a problem when libc has pipe2() but the kernel is too + old to have pipe2() and thus pipe2() fails. In xz it's pointless + to have a fallback for non-functioning pipe2(); it's better to + avoid pipe2() completely. + + Thanks to Michael Fox for the bug report. + + configure.ac | 4 ++-- + src/xz/file_io.c | 9 +-------- + 2 files changed, 3 insertions(+), 10 deletions(-) + +commit fc0df0f8db87dff45543708a711e17d29c37f632 +Author: Lasse Collin +Date: 2015-04-01 14:45:25 +0300 + + xz: Fix the Capsicum rights on user_abort_pipe. + + src/xz/file_io.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 57393615b31b3788dd77280452d845bcc12d33af +Author: Lasse Collin +Date: 2015-03-31 22:20:11 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 1238381143a9a7ce84839c2582ccd56ff750a440 +Author: Lasse Collin +Date: 2015-03-31 22:19:34 +0300 + + xz: Add support for sandboxing with Capsicum. + + The sandboxing is used conditionally as described in main.c. + This isn't optimal but it was much easier to implement than + a full sandboxing solution and it still covers the most common + use cases where xz is writing to standard output. This should + have practically no effect on performance even with small files + as fork() isn't needed. + + C and locale libraries can open files as needed. This has been + fine in the past, but it's a problem with things like Capsicum. + io_sandbox_enter() tries to ensure that various locale-related + files have been loaded before cap_enter() is called, but it's + possible that there are other similar problems which haven't + been seen yet. + + Currently Capsicum is available on FreeBSD 10 and later + and there is a port to Linux too. + + Thanks to Loganaden Velvindron for help. + + configure.ac | 41 +++++++++++++++++++++++++++ + src/xz/Makefile.am | 2 +- + src/xz/file_io.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/xz/file_io.h | 6 ++++ + src/xz/main.c | 18 ++++++++++++ + src/xz/private.h | 4 +++ + 6 files changed, 151 insertions(+), 1 deletion(-) + +commit 29a087fb5a0c879f0b1bc4c6b989f7b87bacdf9e +Author: Lasse Collin +Date: 2015-03-31 21:12:30 +0300 + + Fix bugs and otherwise improve ax_check_capsicum.m4. + + AU_ALIAS was removed because the new version is incompatible + with the old version. + + It no longer checks for separately. + It's enough to test for it as part of AC_CHECK_DECL. + The defines HAVE_CAPSICUM_SYS_CAPSICUM_H and + HAVE_CAPSICUM_SYS_CAPABILITY_H were removed as unneeded. + HAVE_SYS_CAPSICUM_H from AC_CHECK_HEADERS is enough. + + It no longer does a useless search for the Capsicum library + if the header wasn't found. + + Fixed a bug in ACTION-IF-FOUND (the first argument). Specifying + the argument omitted the default action but the given action + wasn't used instead. + + AC_DEFINE([HAVE_CAPSICUM]) is now always called when Capsicum + support is found. Previously it was part of the default + ACTION-IF-FOUND which a custom action would override. Now + the default action only prepends ${CAPSICUM_LIB} to LIBS. + + The documentation was updated. + + Since there as no serial number, "#serial 2" was added. + + m4/ax_check_capsicum.m4 | 103 ++++++++++++++++++++++++------------------------ + 1 file changed, 51 insertions(+), 52 deletions(-) + +commit 6e845c6a3eddf2fde9db5a29950421dff60a43ac +Author: Lasse Collin +Date: 2015-03-31 19:20:24 +0300 + + Add m4/ax_check_capsicum.m4 for detecting Capsicum support. + + The file was loaded from this web page: + https://github.com/google/capsicum-test/blob/dev/autoconf/m4/ax_check_capsicum.m4 + + Thanks to Loganaden Velvindron for pointing it out for me. + + m4/ax_check_capsicum.m4 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit 3717885f9ef2c06f1bcbad9f4c2ed2d5695f844e +Author: Lasse Collin +Date: 2015-03-30 22:44:02 +0300 + + Bump version to 5.3.0alpha and soname to 5.3.99. + + The idea of 99 is that it looks a bit weird in this context. + For new features there's no API/ABI stability in devel versions. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit eccd8155e107c5ada03d13e7730675cdf1a44ddc +Author: Lasse Collin +Date: 2015-03-29 22:14:47 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 25263fd9e7a8a913395cb93d7c104cd48c2b4a00 +Author: Lasse Collin +Date: 2015-03-29 22:13:48 +0300 + + Fix the detection of installed RAM on QNX. + + The earlier version compiled but didn't actually work + since sysconf(_SC_PHYS_PAGES) always fails (or so I was told). + + Thanks to Ole André Vadla Ravnås for the patch and testing. + + m4/tuklib_physmem.m4 | 6 +++--- + src/common/tuklib_physmem.c | 14 +++++++++++++- + 2 files changed, 16 insertions(+), 4 deletions(-) + +commit 4c544d2410903d38402221cb783ed85585b6a007 +Author: Lasse Collin +Date: 2015-03-27 22:39:07 +0200 + + Fix CPU core count detection on QNX. + + It tried to use sysctl() on QNX but + - it broke the build because sysctl() needs -lsocket on QNX; + - sysctl() doesn't work for detecting the core count on QNX + even if it compiled. + + sysconf() works. An alternative would have been to use + QNX-specific SYSPAGE_ENTRY(num_cpu) from . + + Thanks to Ole André Vadla Ravnås. + + m4/tuklib_cpucores.m4 | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +commit e0ea6737b03e83ccaff4514d00e31bb926f8f0f3 +Author: Lasse Collin +Date: 2015-03-07 22:05:57 +0200 + + xz: size_t/uint32_t cleanup in options.c. + + src/xz/options.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 8bcca29a65335fd679c13814b70b35b68fa5daed +Author: Lasse Collin +Date: 2015-03-07 22:04:23 +0200 + + xz: Fix a comment and silence a warning in message.c. + + src/xz/message.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f243f5f44c6b19a7c289a0ec73a03ee08364cb5b +Author: Lasse Collin +Date: 2015-03-07 22:01:00 +0200 + + liblzma: Silence more uint32_t vs. size_t warnings. + + src/liblzma/lz/lz_encoder.c | 2 +- + src/liblzma/lzma/lzma_encoder.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 7f0a4c50f4a374c40acf4b86848f301ad1e82d34 +Author: Lasse Collin +Date: 2015-03-07 19:54:00 +0200 + + xz: Make arg_count an unsigned int to silence a warning. + + Actually the value of arg_count cannot exceed INT_MAX + but it's nicer as an unsigned int. + + src/xz/args.h | 2 +- + src/xz/main.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit f6ec46801588b1be29c07c9db98558b521304002 +Author: Lasse Collin +Date: 2015-03-07 19:33:17 +0200 + + liblzma: Fix a warning in index.c. + + src/liblzma/common/index.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a24518971cc621315af142dd3bb7614fab04ad27 +Author: Lasse Collin +Date: 2015-02-26 20:46:14 +0200 + + Build: Fix a CR+LF problem when running autoreconf -fi on OS/2. + + build-aux/version.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dec11497a71518423b5ff0e759100cf8aadf6c7b +Author: Lasse Collin +Date: 2015-02-26 16:53:44 +0200 + + Bump version and soname for 5.2.1. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 29e39c79975ab89ee5dd671e97064534a9f3a649 +Author: Lasse Collin +Date: 2015-02-26 13:01:09 +0200 + + Update NEWS for 5.2.1. + + NEWS | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd +Author: Lasse Collin +Date: 2015-02-22 19:38:48 +0200 + + xz: Use pipe2() if available. + + configure.ac | 4 ++-- + src/xz/file_io.c | 9 ++++++++- + 2 files changed, 10 insertions(+), 3 deletions(-) + +commit 117d962685c72682c63edc9bb765367189800202 +Author: Lasse Collin +Date: 2015-02-21 23:40:26 +0200 + + liblzma: Fix a compression-ratio regression in LZMA1/2 in fast mode. + + The bug was added in the commit + f48fce093b07aeda95c18850f5e086d9f2383380 and thus + affected 5.1.4beta and 5.2.0. Luckily the bug cannot + cause data corruption or other nasty things. + + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ae984e31c167d3bc52972ec422dd1ebd5f5d5719 +Author: Lasse Collin +Date: 2015-02-21 23:00:19 +0200 + + xz: Fix the fcntl() usage when creating a pipe for the self-pipe trick. + + Now it reads the old flags instead of blindly setting O_NONBLOCK. + The old code may have worked correctly, but this is better. + + src/xz/file_io.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 2205bb5853098aea36a56df6f5747037175f66b4 +Author: Lasse Collin +Date: 2015-02-10 15:29:34 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit d935b0cdf3db440269b9d952b2b281b18f8c7b08 +Author: Lasse Collin +Date: 2015-02-10 15:28:30 +0200 + + tuklib_cpucores: Use cpuset_getaffinity() on FreeBSD if available. + + In FreeBSD, cpuset_getaffinity() is the preferred way to get + the number of available cores. + + Thanks to Rui Paulo for the patch. I edited it slightly, but + hopefully I didn't break anything. + + m4/tuklib_cpucores.m4 | 23 ++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 18 ++++++++++++++++++ + 2 files changed, 40 insertions(+), 1 deletion(-) + +commit eb61bc58c20769cac4d05f363b9c0e8c9c71a560 +Author: Lasse Collin +Date: 2015-02-09 22:08:37 +0200 + + xzdiff: Make the mktemp usage compatible with FreeBSD's mktemp. + + Thanks to Rui Paulo for the fix. + + src/scripts/xzdiff.in | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit b9a5b6b7a29029680af733082b6a46e0fc01623a +Author: Lasse Collin +Date: 2015-02-03 21:45:53 +0200 + + Add a few casts to tuklib_integer.h to silence possible warnings. + + I heard that Visual Studio 2013 gave warnings without the casts. + + Thanks to Gabi Davar. + + src/common/tuklib_integer.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit c45757135f40e4a0de730ba5fff0100219493982 +Author: Lasse Collin +Date: 2015-01-26 21:24:39 +0200 + + liblzma: Set LZMA_MEMCMPLEN_EXTRA depending on the compare method. + + src/liblzma/common/memcmplen.h | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 3c500174ed5485f550972a2a6109c361e875f069 +Author: Lasse Collin +Date: 2015-01-26 20:40:16 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit fec88d41e672d9e197c9442aecf02bd0dfa6d516 +Author: Lasse Collin +Date: 2015-01-26 20:39:28 +0200 + + liblzma: Silence harmless Valgrind errors. + + Thanks to Torsten Rupp for reporting this. I had + forgotten to run Valgrind before the 5.2.0 release. + + src/liblzma/lz/lz_encoder.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit a9b45badfec0928d20a27c7176c005fa637f7d1e +Author: Lasse Collin +Date: 2015-01-09 21:50:19 +0200 + + xz: Fix comments. + + src/xz/file_io.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 541aee6dd4aa97a809aba281475a21b641bb89e2 +Author: Lasse Collin +Date: 2015-01-09 21:35:06 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4170edc914655310d2363baccf5e615e09b04911 +Author: Lasse Collin +Date: 2015-01-09 21:34:06 +0200 + + xz: Don't fail if stdout doesn't support O_NONBLOCK. + + This is similar to the case with stdin. + + Thanks to Brad Smith for the bug report and testing + on OpenBSD. + + src/xz/file_io.c | 36 +++++++++++++++--------------------- + 1 file changed, 15 insertions(+), 21 deletions(-) + +commit 04bbc0c2843c50c8ad1cba42b937118e38b0508d +Author: Lasse Collin +Date: 2015-01-07 19:18:20 +0200 + + xz: Fix a memory leak in DOS-specific code. + + src/xz/file_io.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f0f1f6c7235ffa901cf76fe18e33749e200b3eea +Author: Lasse Collin +Date: 2015-01-07 19:08:06 +0200 + + xz: Don't fail if stdin doesn't support O_NONBLOCK. + + It's a problem at least on OpenBSD which doesn't support + O_NONBLOCK on e.g. /dev/null. I'm not surprised if it's + a problem on other OSes too since this behavior is allowed + in POSIX-1.2008. + + The code relying on this behavior was committed in June 2013 + and included in 5.1.3alpha released on 2013-10-26. Clearly + the development releases only get limited testing. + + src/xz/file_io.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +commit d2d484647d9d9d679f03c75abb0404f67069271c +Author: Lasse Collin +Date: 2015-01-06 20:30:15 +0200 + + Tests: Don't hide unexpected error messages in test_files.sh. + + Hiding them makes no sense since normally there's no error + when testing the "good" files. With "bad" files errors are + expected and then it makes sense to keep the messages hidden. + + tests/test_files.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit aae6a6aeda51cf94a47e39ad624728f9bee75e30 +Author: Lasse Collin +Date: 2014-12-30 11:17:16 +0200 + + Update Solaris notes in INSTALL. + + Mention the possible "make check" failure on Solaris in the + Solaris-specific section of INSTALL. It was already in + section 4.5 but it is better mention it in the OS-specific + section too. + + INSTALL | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 7815112153178800a3521b9f31960e7cdc26cfba +Author: Lasse Collin +Date: 2014-12-26 12:00:05 +0200 + + Build: POSIX shell isn't required if scripts are disabled. + + INSTALL | 3 ++- + configure.ac | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit a0cd05ee71d330b79ead6eb9222e1b24e1559d3a +Author: Lasse Collin +Date: 2014-12-21 20:48:37 +0200 + + DOS: Update Makefile. + + dos/Makefile | 1 + + 1 file changed, 1 insertion(+) + +commit b85ee0905ec4ab7656d22e63519fdd3bedb21f2e +Author: Lasse Collin +Date: 2014-12-21 19:50:38 +0200 + + Windows: Fix bin_i486 to bin_i686 in build.bash. + + windows/build.bash | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cbafa710918195dbba3db02c3fab4f0538235206 +Author: Lasse Collin +Date: 2014-12-21 18:58:44 +0200 + + Docs: Use lzma_cputhreads() in 04_compress_easy_mt.c. + + doc/examples/04_compress_easy_mt.c | 30 ++++++++++++++++++++++++++---- + 1 file changed, 26 insertions(+), 4 deletions(-) + +commit 8dbb57238d372c7263cfeb3e7f7fd9a73173156a +Author: Lasse Collin +Date: 2014-12-21 18:56:44 +0200 + + Docs: Update docs/examples/00_README.txt. + + doc/examples/00_README.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6 +Author: Lasse Collin +Date: 2014-12-21 18:11:17 +0200 + + Bump version and soname for 5.2.0. + + I know that soname != app version, but I skip AGE=1 + in -version-info to make the soname match the liblzma + version anyway. It doesn't hurt anything as long as + it doesn't conflict with library versioning rules. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 6 +++--- + src/liblzma/liblzma.map | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..7ef2cb4 --- /dev/null +++ b/INSTALL @@ -0,0 +1,765 @@ + +XZ Utils Installation +===================== + + 0. Preface + 1. Supported platforms + 1.1. Compilers + 1.2. Platform-specific notes + 1.2.1. AIX + 1.2.2. IRIX + 1.2.3. MINIX 3 + 1.2.4. OpenVMS + 1.2.5. Solaris, OpenSolaris, and derivatives + 1.2.6. Tru64 + 1.2.7. Windows + 1.2.8. DOS + 1.2.9. z/OS + 1.3. Adding support for new platforms + 2. configure options + 2.1. Static vs. dynamic linking of liblzma + 2.2. Optimizing xzdec and lzmadec + 3. xzgrep and other scripts + 3.1. Dependencies + 3.2. PATH + 4. Tests + 4.1 Testing in parallel + 4.2 Cross compiling + 5. Troubleshooting + 5.1. "No C99 compiler was found." + 5.2. "No POSIX conforming shell (sh) was found." + 5.3. configure works but build fails at crc32_x86.S + 5.4. Lots of warnings about symbol visibility + 5.5. "make check" fails + 5.6. liblzma.so (or similar) not found when running xz + + +0. Preface +---------- + + If you aren't familiar with building packages that use GNU Autotools, + see the file INSTALL.generic for generic instructions before reading + further. + + If you are going to build a package for distribution, see also the + file PACKAGERS. It contains information that should help making the + binary packages as good as possible, but the information isn't very + interesting to those making local builds for private use or for use + in special situations like embedded systems. + + +1. Supported platforms +---------------------- + + XZ Utils are developed on GNU/Linux, but they should work on many + POSIX-like operating systems like *BSDs and Solaris, and even on + a few non-POSIX operating systems. + + +1.1. Compilers + + A C99 compiler is required to compile XZ Utils. If you use GCC, you + need at least version 3.x.x. GCC version 2.xx.x doesn't support some + C99 features used in XZ Utils source code, thus GCC 2 won't compile + XZ Utils. + + XZ Utils takes advantage of some GNU C extensions when building + with GCC. Because these extensions are used only when building + with GCC, it should be possible to use any C99 compiler. + + +1.2. Platform-specific notes + +1.2.1. AIX + + If you use IBM XL C compiler, pass CC=xlc_r to configure. If + you use CC=xlc instead, you must disable threading support + with --disable-threads (usually not recommended). + + +1.2.2. IRIX + + MIPSpro 7.4.4m has been reported to produce broken code if using + the -O2 optimization flag ("make check" fails). Using -O1 should + work. + + A problem has been reported when using shared liblzma. Passing + --disable-shared to configure works around this. Alternatively, + putting "-64" to CFLAGS to build a 64-bit version might help too. + + +1.2.3. MINIX 3 + + The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK), + which doesn't support C99. Install GCC to compile XZ Utils. + + MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has + to be patched before XZ Utils can be compiled correctly. See + . + + MINIX 3.2.0 and later use a different libc and aren't affected by + the above bug. + + XZ Utils doesn't have code to detect the amount of physical RAM and + number of CPU cores on MINIX 3. + + See section 5.4 in this file about symbol visibility warnings (you + may want to pass gl_cv_cc_visibility=no to configure). + + +1.2.4. OpenVMS + + XZ Utils can be built for OpenVMS, but the build system files + are not included in the XZ Utils source package. The required + OpenVMS-specific files are maintained by Jouk Jansen and can be + downloaded here: + + http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils + + +1.2.5. Solaris, OpenSolaris, and derivatives + + The following linker error has been reported on some x86 systems: + + ld: fatal: relocation error: R_386_GOTOFF: ... + + This can be worked around by passing gl_cv_cc_visibility=no + as an argument to the configure script. + + test_scripts.sh in "make check" may fail if good enough tools are + missing from PATH (/usr/xpg4/bin or /usr/xpg6/bin). Nowadays + /usr/xpg4/bin is added to the script PATH by default on Solaris + (see --enable-path-for-scripts=PREFIX in section 2), but old xz + releases needed extra steps. See sections 5.5 and 3.2 for more + information. + + +1.2.6. Tru64 + + If you try to use the native C compiler on Tru64 (passing CC=cc to + configure), you may need the workaround mention in section 5.1 in + this file (pass also ac_cv_prog_cc_c99= to configure). + + +1.2.7. Windows + + If it is enough to build liblzma (no command line tools): + + - There is CMake support. It should be good enough to build + static liblzma or liblzma.dll with Visual Studio. The CMake + support may work with MinGW or MinGW-w64. Read the comment + in the beginning of CMakeLists.txt before running CMake! + + - There are Visual Studio project files under the "windows" + directory. See windows/INSTALL-MSVC.txt. In the future the + project files will be removed when CMake support is good + enough. Thus, please test the CMake version and help fix + possible issues. + + To build also the command line tools: + + - MinGW-w64 + MSYS (32-bit and 64-bit x86): This is used + for building the official binary packages for Windows. + There is windows/build.bash to ease packaging XZ Utils with + MinGW(-w64) + MSYS into a redistributable .zip or .7z file. + See windows/INSTALL-MinGW.txt for more information. + + - MinGW + MSYS (32-bit x86): I haven't recently tested this. + + - Cygwin 1.7.35 and later: NOTE that using XZ Utils >= 5.2.0 + under Cygwin older than 1.7.35 can lead to DATA LOSS! If + you must use an old Cygwin version, stick to XZ Utils 5.0.x + which is safe under older Cygwin versions. You can check + the Cygwin version with the command "cygcheck -V". + + It may be possible to build liblzma with other toolchains too, but + that will probably require writing a separate makefile. Building + the command line tools with non-GNU toolchains will be harder than + building only liblzma. + + Even if liblzma is built with MinGW(-w64), the resulting DLL can + be used by other compilers and linkers, including MSVC. See + windows/README-Windows.txt for details. + + +1.2.8. DOS + + There is a Makefile in the "dos" directory to build XZ Utils on + DOS using DJGPP. Support for long file names (LFN) is needed at + build time but the resulting xz.exe works without LFN support too. + See dos/INSTALL.txt and dos/README.txt for more information. + + +1.2.9. z/OS + + To build XZ Utils on z/OS UNIX System Services using xlc, pass + these options to the configure script: CC='xlc -qhaltonmsg=CCN3296' + CPPFLAS='-D_UNIX03_THREADS -D_XOPEN_SOURCE=600'. The first makes + xlc throw an error if a header file is missing, which is required + to make the tests in configure work. The CPPFLAGS are needed to + get pthread support (some other CPPFLAGS may work too; if there + are problems, try -D_UNIX95_THREADS instead of -D_UNIX03_THREADS). + + test_scripts.sh in "make check" will fail even if the scripts + actually work because the test data includes compressed files + with US-ASCII text. + + No other tests should fail. If test_files.sh fails, check that + the included .xz test files weren't affected by EBCDIC conversion. + + XZ Utils doesn't have code to detect the amount of physical RAM and + number of CPU cores on z/OS. + + +1.3. Adding support for new platforms + + If you have written patches to make XZ Utils to work on previously + unsupported platform, please send the patches to me! I will consider + including them to the official version. It's nice to minimize the + need of third-party patching. + + One exception: Don't request or send patches to change the whole + source package to C89. I find C99 substantially nicer to write and + maintain. However, the public library headers must be in C89 to + avoid frustrating those who maintain programs, which are strictly + in C89 or C++. + + +2. configure options +-------------------- + + In most cases, the defaults are what you want. Many of the options + below are useful only when building a size-optimized version of + liblzma or command line tools. + + --enable-encoders=LIST + --disable-encoders + Specify a comma-separated LIST of filter encoders to + build. See "./configure --help" for exact list of + available filter encoders. The default is to build all + supported encoders. + + If LIST is empty or --disable-encoders is used, no filter + encoders will be built and also the code shared between + encoders will be omitted. + + Disabling encoders will remove some symbols from the + liblzma ABI, so this option should be used only when it + is known to not cause problems. + + --enable-decoders=LIST + --disable-decoders + This is like --enable-encoders but for decoders. The + default is to build all supported decoders. + + --enable-match-finders=LIST + liblzma includes two categories of match finders: + hash chains and binary trees. Hash chains (hc3 and hc4) + are quite fast but they don't provide the best compression + ratio. Binary trees (bt2, bt3 and bt4) give excellent + compression ratio, but they are slower and need more + memory than hash chains. + + You need to enable at least one match finder to build the + LZMA1 or LZMA2 filter encoders. Usually hash chains are + used only in the fast mode, while binary trees are used to + when the best compression ratio is wanted. + + The default is to build all the match finders if LZMA1 + or LZMA2 filter encoders are being built. + + --enable-checks=LIST + liblzma support multiple integrity checks. CRC32 is + mandatory, and cannot be omitted. See "./configure --help" + for exact list of available integrity check types. + + liblzma and the command line tools can decompress files + which use unsupported integrity check type, but naturally + the file integrity cannot be verified in that case. + + Disabling integrity checks may remove some symbols from + the liblzma ABI, so this option should be used only when + it is known to not cause problems. + + --enable-external-sha256 + Try to use SHA-256 code from the operating system libc + or similar base system libraries. This doesn't try to + use OpenSSL or libgcrypt or such libraries. + + The reasons to use this option: + + - It makes liblzma slightly smaller. + + - It might improve SHA-256 speed if the implementation + in the operating is very good (but see below). + + External SHA-256 is disabled by default for two reasons: + + - On some operating systems the symbol names of the + SHA-256 functions conflict with OpenSSL's libcrypto. + This causes weird problems such as decompression + errors if an application is linked against both + liblzma and libcrypto. This problem affects at least + FreeBSD 10 and older and MINIX 3.3.0 and older, but + other OSes that provide a function "SHA256_Init" might + also be affected. FreeBSD 11 has the problem fixed. + NetBSD had the problem but it was fixed it in 2009 + already. OpenBSD uses "SHA256Init" and thus never had + a conflict with libcrypto. + + - The SHA-256 code in liblzma is faster than the SHA-256 + code provided by some operating systems. If you are + curious, build two copies of xz (internal and external + SHA-256) and compare the decompression (xz --test) + times: + + dd if=/dev/zero bs=1024k count=1024 \ + | xz -v -0 -Csha256 > foo.xz + time xz --test foo.xz + + --disable-microlzma + Don't build MicroLZMA encoder and decoder. This omits + lzma_microlzma_encoder() and lzma_microlzma_decoder() + API functions from liblzma. These functions are needed + by specific applications only. They were written for + erofs-utils but they may be used by others too. + + --disable-lzip-decoder + Disable decompression support for .lz (lzip) files. + This omits the API function lzma_lzip_decoder() from + liblzma and .lz support from the xz tool. + + --disable-xz + --disable-xzdec + --disable-lzmadec + --disable-lzmainfo + Don't build and install the command line tool mentioned + in the option name. + + NOTE: Disabling xz will skip some tests in "make check". + + NOTE: If xzdec is disabled and lzmadec is left enabled, + a dangling man page symlink lzmadec.1 -> xzdec.1 is + created. + + --disable-lzma-links + Don't create symlinks for LZMA Utils compatibility. + This includes lzma, unlzma, and lzcat. If scripts are + installed, also lzdiff, lzcmp, lzgrep, lzegrep, lzfgrep, + lzmore, and lzless will be omitted if this option is used. + + --disable-scripts + Don't install the scripts xzdiff, xzgrep, xzmore, xzless, + and their symlinks. + + --disable-doc + Don't install the documentation files to $docdir + (often /usr/doc/xz or /usr/local/doc/xz). Man pages + will still be installed. The $docdir can be changed + with --docdir=DIR. + + --disable-assembler + liblzma includes some assembler optimizations. Currently + there is only assembler code for CRC32 and CRC64 for + 32-bit x86. + + All the assembler code in liblzma is position-independent + code, which is suitable for use in shared libraries and + position-independent executables. So far only i386 + instructions are used, but the code is optimized for i686 + class CPUs. If you are compiling liblzma exclusively for + pre-i686 systems, you may want to disable the assembler + code. + + --disable-clmul-crc + Disable the use carryless multiplication for CRC + calculation even if compiler support for it is detected. + The code uses runtime detection of SSSE3, SSE4.1, and + CLMUL instructions on x86. On 32-bit x86 this currently + is used only if --disable-assembler is used (this might + be fixed in the future). The code works on E2K too. + + If using compiler options that unconditionally allow the + required extensions (-msse4.1 -mpclmul) then runtime + detection isn't used and the generic code is omitted. + + --enable-unaligned-access + Allow liblzma to use unaligned memory access for 16-bit, + 32-bit, and 64-bit loads and stores. This should be + enabled only when the hardware supports this, that is, + when unaligned access is fast. Some operating system + kernels emulate unaligned access, which is extremely + slow. This option shouldn't be used on systems that + rely on such emulation. + + Unaligned access is enabled by default on x86, x86-64, + big endian PowerPC, some ARM, and some ARM64 systems. + + --enable-unsafe-type-punning + This enables use of code like + + uint8_t *buf8 = ...; + *(uint32_t *)buf8 = ...; + + which violates strict aliasing rules and may result + in broken code. There should be no need to use this + option with recent GCC or Clang versions on any + arch as just as fast code can be generated in a safe + way too (using __builtin_assume_aligned + memcpy). + + However, this option might improve performance in some + other cases, especially with old compilers (for example, + GCC 3 and early 4.x on x86, GCC < 6 on ARMv6 and ARMv7). + + --enable-small + Reduce the size of liblzma by selecting smaller but + semantically equivalent version of some functions, and + omit precomputed lookup tables. This option tends to + make liblzma slightly slower. + + Note that while omitting the precomputed tables makes + liblzma smaller on disk, the tables are still needed at + run time, and need to be computed at startup. This also + means that the RAM holding the tables won't be shared + between applications linked against shared liblzma. + + This option doesn't modify CFLAGS to tell the compiler + to optimize for size. You need to add -Os or equivalent + flag(s) to CFLAGS manually. + + --enable-assume-ram=SIZE + On the most common operating systems, XZ Utils is able to + detect the amount of physical memory on the system. This + information is used by the options --memlimit-compress, + --memlimit-decompress, and --memlimit when setting the + limit to a percentage of total RAM. + + On some systems, there is no code to detect the amount of + RAM though. Using --enable-assume-ram one can set how much + memory to assume on these systems. SIZE is given as MiB. + The default is 128 MiB. + + Feel free to send patches to add support for detecting + the amount of RAM on the operating system you use. See + src/common/tuklib_physmem.c for details. + + --enable-threads=METHOD + Threading support is enabled by default so normally there + is no need to specify this option. + + Supported values for METHOD: + + yes Autodetect the threading method. If none + is found, configure will give an error. + + posix Use POSIX pthreads. This is the default + except on Windows outside Cygwin. + + win95 Use Windows 95 compatible threads. This + is compatible with Windows XP and later + too. This is the default for 32-bit x86 + Windows builds. Unless the compiler + supports __attribute__((__constructor__)), + the `win95' threading is incompatible with + --enable-small. + + vista Use Windows Vista compatible threads. The + resulting binaries won't run on Windows XP + or older. This is the default for Windows + excluding 32-bit x86 builds (that is, on + x86-64 the default is `vista'). + + no Disable threading support. This is the + same as using --disable-threads. + NOTE: If combined with --enable-small + and the compiler doesn't support + __attribute__((__constructor__)), the + resulting liblzma won't be thread safe, + that is, if a multi-threaded application + calls any liblzma functions from more than + one thread, something bad may happen. + + --enable-sandbox=METHOD + There is limited sandboxing support in the xz tool. If + built with sandbox support, it's used automatically when + (de)compressing exactly one file to standard output and + the options --files or --files0 weren't used. This is a + common use case, for example, (de)compressing .tar.xz + files via GNU tar. The sandbox is also used for + single-file `xz --test' or `xz --list'. + + Supported METHODs: + + auto Look for a supported sandboxing method + and use it if found. If no method is + found, then sandboxing isn't used. + This is the default. + + no Disable sandboxing support. + + capsicum + Use Capsicum (FreeBSD >= 10) for + sandboxing. If no Capsicum support + is found, configure will give an error. + + pledge Use pledge(2) (OpenBSD >= 5.9) for + sandboxing. If pledge(2) isn't found, + configure will give an error. + + --enable-symbol-versions + Use symbol versioning for liblzma. This is enabled by + default on GNU/Linux, other GNU-based systems, and + FreeBSD. + + --enable-debug + This enables the assert() macro and possibly some other + run-time consistency checks. It makes the code slower, so + you normally don't want to have this enabled. + + --enable-werror + If building with GCC, make all compiler warnings an error, + that abort the compilation. This may help catching bugs, + and should work on most systems. This has no effect on the + resulting binaries. + + --enable-path-for-scripts=PREFIX + If PREFIX isn't empty, PATH=PREFIX:$PATH will be set in + the beginning of the scripts (xzgrep and others). + The default is empty except on Solaris the default is + /usr/xpg4/bin. + + This can be useful if the default PATH doesn't contain + modern POSIX tools (as can be the case on Solaris) or if + one wants to ensure that the correct xz binary is in the + PATH for the scripts. Note that the latter use can break + "make check" if the prefixed PATH causes a wrong xz binary + (other than the one that was just built) to be used. + + Older xz releases support a different method for setting + the PATH for the scripts. It is described in section 3.2 + and is supported in this xz version too. + + +2.1. Static vs. dynamic linking of liblzma + + On 32-bit x86, linking against static liblzma can give a minor + speed improvement. Static libraries on x86 are usually compiled as + position-dependent code (non-PIC) and shared libraries are built as + position-independent code (PIC). PIC wastes one register, which can + make the code slightly slower compared to a non-PIC version. (Note + that this doesn't apply to x86-64.) + + If you want to link xz against static liblzma, the simplest way + is to pass --disable-shared to configure. If you want also shared + liblzma, run configure again and run "make install" only for + src/liblzma. + + +2.2. Optimizing xzdec and lzmadec + + xzdec and lzmadec are intended to be relatively small instead of + optimizing for the best speed. Thus, it is a good idea to build + xzdec and lzmadec separately: + + - To link the tools against static liblzma, pass --disable-shared + to configure. + + - To select somewhat size-optimized variant of some things in + liblzma, pass --enable-small to configure. + + - Tell the compiler to optimize for size instead of speed. + For example, with GCC, put -Os into CFLAGS. + + - xzdec and lzmadec will never use multithreading capabilities of + liblzma. You can avoid dependency on libpthread by passing + --disable-threads to configure. + + - There are and will be no translated messages for xzdec and + lzmadec, so it is fine to pass also --disable-nls to configure. + + - Only decoder code is needed, so you can speed up the build + slightly by passing --disable-encoders to configure. This + shouldn't affect the final size of the executables though, + because the linker is able to omit the encoder code anyway. + + If you have no use for xzdec or lzmadec, you can disable them with + --disable-xzdec and --disable-lzmadec. + + +3. xzgrep and other scripts +--------------------------- + +3.1. Dependencies + + POSIX shell (sh) and bunch of other standard POSIX tools are required + to run the scripts. The configure script tries to find a POSIX + compliant sh, but if it fails, you can force the shell by passing + gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure + script. + + xzdiff (xzcmp/lzdiff/lzcmp) may use mktemp if it is available. As + a fallback xzdiff will use mkdir to securely create a temporary + directory. Having mktemp available is still recommended since the + mkdir fallback method isn't as robust as mktemp is. The original + mktemp can be found from . On GNU, most will + use the mktemp program from GNU coreutils instead of the original + implementation. Both mktemp versions are fine. + + In addition to using xz to decompress .xz files, xzgrep and xzdiff + use gzip, bzip2, and lzop to support .gz, bz2, and .lzo files. + + +3.2. PATH + + The method described below is supported by older xz releases. + It is supported by the current version too, but the newer + --enable-path-for-scripts=PREFIX described in section 2 may be + more convenient. + + The scripts assume that the required tools (standard POSIX utilities, + mktemp, and xz) are in PATH; the scripts don't set the PATH themselves + (except as described for --enable-path-for-scripts=PREFIX). Some + people like this while some think this is a bug. Those in the latter + group can easily patch the scripts before running the configure script + by taking advantage of a placeholder line in the scripts. + + For example, to make the scripts prefix /usr/bin:/bin to PATH: + + perl -pi -e 's|^#SET_PATH.*$|PATH=/usr/bin:/bin:\$PATH|' \ + src/scripts/xz*.in + + +4. Tests +-------- + + The test framework can be built and run by executing "make check" in + the build directory. The tests are a mix of executables and POSIX + shell scripts (sh). All tests should pass if the default configuration + is used. Disabling features through the configure options may cause + some tests to be skipped. If any tests do not pass, see section 5.5. + + +4.1. Testing in parallel + + The tests can be run in parallel using the "-j" make option on systems + that support it. For instance, "make -j4 check" will run up to four + tests simultaneously. + + +4.2. Cross compiling + + The tests can be built without running them: + + make check TESTS= + + The TESTS variable is the list of tests you wish to run. Leaving it + empty will compile the tests without running any. + + If the tests are copied to a target machine to execute, the test data + files in the directory tests/files must also be copied. The tests + search for the data files using the environment variable $srcdir, + expecting to find the data files under $srcdir/files/. If $srcdir + isn't set then it defaults to the current directory. + + The shell script tests can be copied from the source directory to the + target machine to execute. In addition to the test files, these tests + will expect the following relative file paths to execute properly: + + ./create_compress_files + ../config.h + ../src/xz/xz + ../src/xzdec/xzdec + ../src/scripts/xzdiff + ../src/scripts/xzgrep + + +5. Troubleshooting +------------------ + +5.1. "No C99 compiler was found." + + You need a C99 compiler to build XZ Utils. If the configure script + cannot find a C99 compiler and you think you have such a compiler + installed, set the compiler command by passing CC=/path/to/c99 as + an argument to the configure script. + + If you get this error even when you think your compiler supports C99, + you can override the test by passing ac_cv_prog_cc_c99= as an argument + to the configure script. The test for C99 compiler is not perfect (and + it is not as easy to make it perfect as it sounds), so sometimes this + may be needed. You will get a compile error if your compiler doesn't + support enough C99. + + +5.2. "No POSIX conforming shell (sh) was found." + + xzgrep and other scripts need a shell that (roughly) conforms + to POSIX. The configure script tries to find such a shell. If + it fails, you can force the shell to be used by passing + gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure + script. Alternatively you can omit the installation of scripts and + this error by passing --disable-scripts to configure. + + +5.3. configure works but build fails at crc32_x86.S + + The easy fix is to pass --disable-assembler to the configure script. + + The configure script determines if assembler code can be used by + looking at the configure triplet; there is currently no check if + the assembler code can actually actually be built. The x86 assembler + code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW, + Cygwin, and DJGPP. On other x86 systems, there may be problems and + the assembler code may need to be disabled with the configure option. + + If you get this error when building for x86-64, you have specified or + the configure script has misguessed your architecture. Pass the + correct configure triplet using the --build=CPU-COMPANY-SYSTEM option + (see INSTALL.generic). + + +5.4. Lots of warnings about symbol visibility + + On some systems where symbol visibility isn't supported, GCC may + still accept the visibility options and attributes, which will make + configure think that visibility is supported. This will result in + many compiler warnings. You can avoid the warnings by forcing the + visibility support off by passing gl_cv_cc_visibility=no as an + argument to the configure script. This has no effect on the + resulting binaries, but fewer warnings looks nicer and may allow + using --enable-werror. + + +5.5. "make check" fails + + If the other tests pass but test_scripts.sh fails, then the problem + is in the scripts in src/scripts. Comparing the contents of + tests/xzgrep_test_output to tests/xzgrep_expected_output might + give a good idea about problems in xzgrep. One possibility is that + some tools are missing from the current PATH or the tools lack + support for some POSIX features. This can happen at least on + Solaris where the tools in /bin may be ancient but good enough + tools are available in /usr/xpg4/bin or /usr/xpg6/bin. For possible + fixes, see --enable-path-for-scripts=PREFIX in section 2 and the + older alternative method described in section 3.2 of this file. + + If tests other than test_scripts.sh fail, a likely reason is that + libtool links the test programs against an installed version of + liblzma instead of the version that was just built. This is + obviously a bug which seems to happen on some platforms. + A workaround is to uninstall the old liblzma versions first. + + If the problem isn't any of those described above, then it's likely + a bug in XZ Utils or in the compiler. See the platform-specific + notes in this file for possible known problems. Please report + a bug if you cannot solve the problem. See README for contact + information. + + +5.6. liblzma.so (or similar) not found when running xz + + If you installed the package with "make install" and get an error + about liblzma.so (or a similarly named file) being missing, try + running "ldconfig" to update the run-time linker cache (if your + operating system has such a command). + diff --git a/INSTALL.generic b/INSTALL.generic new file mode 100644 index 0000000..8865734 --- /dev/null +++ b/INSTALL.generic @@ -0,0 +1,368 @@ +Installation Instructions +************************* + + Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software +Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command './configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the 'README' file for +instructions specific to this package. Some packages provide this +'INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The 'configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that +you can run in the future to recreate the current configuration, and a +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). + + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. + + If you need to do unusual things to compile the package, please try +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can +be considered for the next release. If you are using the cache, and at +some point 'config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. + + The simplest way to compile this package is: + + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. + + Running 'configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type 'make' to compile the package. + + 3. Optionally, type 'make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type 'make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the 'make install' phase executed with root + privileges. + + 5. Optionally, type 'make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior 'make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type 'make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide 'make + distcheck', which can by used by developers to test that all other + targets like 'make install' and 'make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the 'configure' script does not know about. Run './configure --help' +for details on some of the pertinent environment variables. + + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU 'make'. 'cd' to the +directory where you want the object files and executables to go and run +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. + + With a non-GNU 'make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use 'make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the 'lipo' tool if you have problems. + +Installation Names +================== + + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to 'configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +'make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, 'make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the +package recognizes. + + For packages that use the X Window System, 'configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of 'make' will be. For these packages, running './configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with 'make V=1'; while running './configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with 'make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX 'make' updates targets which have the same time stamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. + + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features 'configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, 'configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option '--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with '--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to 'configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the 'configure' command line, using 'VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified 'gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +'configure' Invocation +====================== + + 'configure' recognizes the following options to control how it +operates. + +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. + +'--help=short' +'--help=recursive' + Print a summary of the options unique to this package's + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' + script, and exit. + +'--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally 'config.cache'. FILE defaults to '/dev/null' to + disable caching. + +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to '/dev/null' (any error + messages will still be shown). + +'--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + 'configure' can determine that directory automatically. + +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. + +'--no-create' +'-n' + Run the configure checks, but stop before creating any output + files. + +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..f562f90 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,134 @@ +## +## Author: Lasse Collin +## +## This file has been put into the public domain. +## You can do whatever you want with this file. +## + +# Use -n to prevent gzip from adding a timestamp to the .gz headers. +GZIP_ENV = -9n + +DIST_SUBDIRS = lib src po tests debug +SUBDIRS = + +if COND_GNULIB +SUBDIRS += lib +endif + +SUBDIRS += src po tests + +if COND_DOC +dist_doc_DATA = \ + AUTHORS \ + COPYING \ + COPYING.GPLv2 \ + NEWS \ + README \ + THANKS \ + TODO \ + doc/faq.txt \ + doc/history.txt \ + doc/xz-file-format.txt \ + doc/lzma-file-format.txt + +examplesdir = $(docdir)/examples +dist_examples_DATA = \ + doc/examples/00_README.txt \ + doc/examples/01_compress_easy.c \ + doc/examples/02_decompress.c \ + doc/examples/03_compress_custom.c \ + doc/examples/04_compress_easy_mt.c \ + doc/examples/Makefile + +examplesolddir = $(docdir)/examples_old +dist_examplesold_DATA = \ + doc/examples_old/xz_pipe_comp.c \ + doc/examples_old/xz_pipe_decomp.c + +# Install the Doxygen generated documentation if they were built. +install-data-local: + if test -d "$(srcdir)/doc/api" ; then \ + $(MKDIR_P) "$(DESTDIR)$(docdir)/api" && \ + $(INSTALL_DATA) "$(srcdir)"/doc/api/* \ + "$(DESTDIR)$(docdir)/api"; \ + fi + +# Remove the Doxygen generated documentation when uninstalling. +uninstall-local: + rm -rf "$(DESTDIR)$(docdir)/api" +endif + +EXTRA_DIST = \ + po4a \ + extra \ + dos \ + doxygen \ + windows \ + macosx \ + cmake \ + CMakeLists.txt \ + autogen.sh \ + COPYING.GPLv2 \ + COPYING.GPLv3 \ + COPYING.LGPLv2.1 \ + INSTALL.generic \ + PACKAGERS \ + build-aux/manconv.sh \ + build-aux/version.sh + +ACLOCAL_AMFLAGS = -I m4 + +# List of man pages to convert to PDF and plain text in the dist-hook target. +manfiles = \ + src/xz/xz.1 \ + src/xzdec/xzdec.1 \ + src/lzmainfo/lzmainfo.1 \ + src/scripts/xzdiff.1 \ + src/scripts/xzgrep.1 \ + src/scripts/xzless.1 \ + src/scripts/xzmore.1 + +# Create ChangeLog from output of "git log --date=iso --stat". +# Convert the man pages to PDF and plain text (ASCII only) formats. +dist-hook: + if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \ + ( cd "$(srcdir)" && git log --date=iso --stat \ + 6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6^..HEAD ) \ + > "$(distdir)/ChangeLog"; \ + fi + if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \ + dest="$(distdir)/doc/man" && \ + $(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \ + for FILE in $(manfiles); do \ + BASE=`basename $$FILE .1` && \ + sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \ + < "$(srcdir)/$$FILE" \ + > "$$dest/pdf-a4/$$BASE-a4.pdf" && \ + sh "$(srcdir)/build-aux/manconv.sh" pdf letter \ + < "$(srcdir)/$$FILE" \ + > "$$dest/pdf-letter/$$BASE-letter.pdf" && \ + sh "$(srcdir)/build-aux/manconv.sh" ascii \ + < "$(srcdir)/$$FILE" \ + > "$$dest/txt/$$BASE.txt"; \ + done; \ + fi + if test -d "$(srcdir)/doc/api" ; then \ + $(MKDIR_P) "$(distdir)/doc/api" && \ + $(INSTALL_DATA) "$(srcdir)"/doc/api/* \ + "$(distdir)/doc/api"; \ + fi + +# This works with GNU tar and gives cleaner package than normal 'make dist'. +# This also ensures that the man page translations are up to date (dist-hook +# would be too late for that). +mydist: + sh "$(srcdir)/src/liblzma/validate_map.sh" + cd "$(srcdir)/po4a" && sh update-po + cd "$(srcdir)/doxygen" && sh update-doxygen + VERSION=$(VERSION); \ + if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \ + SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \ + test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \ + fi; \ + TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \ + $(MAKE) VERSION="$$VERSION" dist-gzip diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..2889d08 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,1121 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@COND_GNULIB_TRUE@am__append_1 = lib +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_capsicum.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix-shell.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/tuklib_common.m4 \ + $(top_srcdir)/m4/tuklib_cpucores.m4 \ + $(top_srcdir)/m4/tuklib_integer.m4 \ + $(top_srcdir)/m4/tuklib_mbstr.m4 \ + $(top_srcdir)/m4/tuklib_physmem.m4 \ + $(top_srcdir)/m4/tuklib_progname.m4 \ + $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__dist_doc_DATA_DIST) \ + $(am__dist_examples_DATA_DIST) \ + $(am__dist_examplesold_DATA_DIST) $(am__DIST_COMMON) +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_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__dist_doc_DATA_DIST = AUTHORS COPYING COPYING.GPLv2 NEWS README \ + THANKS TODO doc/faq.txt doc/history.txt doc/xz-file-format.txt \ + doc/lzma-file-format.txt +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(docdir)" "$(DESTDIR)$(examplesdir)" \ + "$(DESTDIR)$(examplesolddir)" +am__dist_examples_DATA_DIST = doc/examples/00_README.txt \ + doc/examples/01_compress_easy.c doc/examples/02_decompress.c \ + doc/examples/03_compress_custom.c \ + doc/examples/04_compress_easy_mt.c doc/examples/Makefile +am__dist_examplesold_DATA_DIST = doc/examples_old/xz_pipe_comp.c \ + doc/examples_old/xz_pipe_decomp.c +DATA = $(dist_doc_DATA) $(dist_examples_DATA) $(dist_examplesold_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \ + ChangeLog INSTALL NEWS README THANKS TODO build-aux/compile \ + build-aux/config.guess build-aux/config.rpath \ + build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \ + build-aux/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAPSICUM_LIB = @CAPSICUM_LIB@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_EXEEXT = @LN_EXEEXT@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSIX_SHELL = @POSIX_SHELL@ +POSUB = @POSUB@ +PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +enable_path_for_scripts = @enable_path_for_scripts@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +xz = @xz@ + +# Use -n to prevent gzip from adding a timestamp to the .gz headers. +GZIP_ENV = -9n +DIST_SUBDIRS = lib src po tests debug +SUBDIRS = $(am__append_1) src po tests +@COND_DOC_TRUE@dist_doc_DATA = \ +@COND_DOC_TRUE@ AUTHORS \ +@COND_DOC_TRUE@ COPYING \ +@COND_DOC_TRUE@ COPYING.GPLv2 \ +@COND_DOC_TRUE@ NEWS \ +@COND_DOC_TRUE@ README \ +@COND_DOC_TRUE@ THANKS \ +@COND_DOC_TRUE@ TODO \ +@COND_DOC_TRUE@ doc/faq.txt \ +@COND_DOC_TRUE@ doc/history.txt \ +@COND_DOC_TRUE@ doc/xz-file-format.txt \ +@COND_DOC_TRUE@ doc/lzma-file-format.txt + +@COND_DOC_TRUE@examplesdir = $(docdir)/examples +@COND_DOC_TRUE@dist_examples_DATA = \ +@COND_DOC_TRUE@ doc/examples/00_README.txt \ +@COND_DOC_TRUE@ doc/examples/01_compress_easy.c \ +@COND_DOC_TRUE@ doc/examples/02_decompress.c \ +@COND_DOC_TRUE@ doc/examples/03_compress_custom.c \ +@COND_DOC_TRUE@ doc/examples/04_compress_easy_mt.c \ +@COND_DOC_TRUE@ doc/examples/Makefile + +@COND_DOC_TRUE@examplesolddir = $(docdir)/examples_old +@COND_DOC_TRUE@dist_examplesold_DATA = \ +@COND_DOC_TRUE@ doc/examples_old/xz_pipe_comp.c \ +@COND_DOC_TRUE@ doc/examples_old/xz_pipe_decomp.c + +EXTRA_DIST = \ + po4a \ + extra \ + dos \ + doxygen \ + windows \ + macosx \ + cmake \ + CMakeLists.txt \ + autogen.sh \ + COPYING.GPLv2 \ + COPYING.GPLv3 \ + COPYING.LGPLv2.1 \ + INSTALL.generic \ + PACKAGERS \ + build-aux/manconv.sh \ + build-aux/version.sh + +ACLOCAL_AMFLAGS = -I m4 + +# List of man pages to convert to PDF and plain text in the dist-hook target. +manfiles = \ + src/xz/xz.1 \ + src/xzdec/xzdec.1 \ + src/lzmainfo/lzmainfo.1 \ + src/scripts/xzdiff.1 \ + src/scripts/xzgrep.1 \ + src/scripts/xzless.1 \ + src/scripts/xzmore.1 + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-dist_docDATA: $(dist_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + done + +uninstall-dist_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) +install-dist_examplesDATA: $(dist_examples_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(examplesdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(examplesdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(examplesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(examplesdir)" || exit $$?; \ + done + +uninstall-dist_examplesDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(examplesdir)'; $(am__uninstall_files_from_dir) +install-dist_examplesoldDATA: $(dist_examplesold_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_examplesold_DATA)'; test -n "$(examplesolddir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(examplesolddir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(examplesolddir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(examplesolddir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(examplesolddir)" || exit $$?; \ + done + +uninstall-dist_examplesoldDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_examplesold_DATA)'; test -n "$(examplesolddir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(examplesolddir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" + @if test -z "$(am__skip_length_check)" && find "$(distdir)" -type f -print | \ + grep '^...................................................................................................' 1>&2; then \ + echo 'error: the above filenames are too long' 1>&2; \ + exit 1; \ + else :; fi +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(docdir)" "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(examplesolddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +@COND_DOC_FALSE@install-data-local: +@COND_DOC_FALSE@uninstall-local: +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-data-local install-dist_docDATA \ + install-dist_examplesDATA install-dist_examplesoldDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_docDATA uninstall-dist_examplesDATA \ + uninstall-dist_examplesoldDATA uninstall-local + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ + dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local \ + install-dist_docDATA install-dist_examplesDATA \ + install-dist_examplesoldDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-dist_docDATA \ + uninstall-dist_examplesDATA uninstall-dist_examplesoldDATA \ + uninstall-local + +.PRECIOUS: Makefile + + +# Install the Doxygen generated documentation if they were built. +@COND_DOC_TRUE@install-data-local: +@COND_DOC_TRUE@ if test -d "$(srcdir)/doc/api" ; then \ +@COND_DOC_TRUE@ $(MKDIR_P) "$(DESTDIR)$(docdir)/api" && \ +@COND_DOC_TRUE@ $(INSTALL_DATA) "$(srcdir)"/doc/api/* \ +@COND_DOC_TRUE@ "$(DESTDIR)$(docdir)/api"; \ +@COND_DOC_TRUE@ fi + +# Remove the Doxygen generated documentation when uninstalling. +@COND_DOC_TRUE@uninstall-local: +@COND_DOC_TRUE@ rm -rf "$(DESTDIR)$(docdir)/api" + +# Create ChangeLog from output of "git log --date=iso --stat". +# Convert the man pages to PDF and plain text (ASCII only) formats. +dist-hook: + if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \ + ( cd "$(srcdir)" && git log --date=iso --stat \ + 6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6^..HEAD ) \ + > "$(distdir)/ChangeLog"; \ + fi + if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \ + dest="$(distdir)/doc/man" && \ + $(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \ + for FILE in $(manfiles); do \ + BASE=`basename $$FILE .1` && \ + sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \ + < "$(srcdir)/$$FILE" \ + > "$$dest/pdf-a4/$$BASE-a4.pdf" && \ + sh "$(srcdir)/build-aux/manconv.sh" pdf letter \ + < "$(srcdir)/$$FILE" \ + > "$$dest/pdf-letter/$$BASE-letter.pdf" && \ + sh "$(srcdir)/build-aux/manconv.sh" ascii \ + < "$(srcdir)/$$FILE" \ + > "$$dest/txt/$$BASE.txt"; \ + done; \ + fi + if test -d "$(srcdir)/doc/api" ; then \ + $(MKDIR_P) "$(distdir)/doc/api" && \ + $(INSTALL_DATA) "$(srcdir)"/doc/api/* \ + "$(distdir)/doc/api"; \ + fi + +# This works with GNU tar and gives cleaner package than normal 'make dist'. +# This also ensures that the man page translations are up to date (dist-hook +# would be too late for that). +mydist: + sh "$(srcdir)/src/liblzma/validate_map.sh" + cd "$(srcdir)/po4a" && sh update-po + cd "$(srcdir)/doxygen" && sh update-doxygen + VERSION=$(VERSION); \ + if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \ + SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \ + test -n "$$SNAPSHOT" && VERSION=$$SNAPSHOT; \ + fi; \ + TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \ + $(MAKE) VERSION="$$VERSION" dist-gzip + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..d26b636 --- /dev/null +++ b/NEWS @@ -0,0 +1,1798 @@ + +XZ Utils Release Notes +====================== + +5.4.5 (2023-11-01) + + * liblzma: + + - Use __attribute__((__no_sanitize_address__)) to avoid address + sanitization with CRC64 CLMUL. It uses 16-byte-aligned reads + which can extend past the bounds of the input buffer and + inherently trigger address sanitization errors. This isn't + a bug. + + - Fixed an assertion failure that could be triggered by a large + unpadded_size argument. It was verified that there was no + other bug than the assertion failure. + + - Fixed a bug that prevented building with Windows Vista + threading when __attribute__((__constructor__)) is not + supported. + + * xz now properly handles special files such as "con" or "nul" on + Windows. Before this fix, the following wrote "foo" to the + console and deleted the input file "con_xz": + + echo foo | xz > con_xz + xz --suffix=_xz --decompress con_xz + + * Build systems: + + - Allow builds with Windows win95 threading and small mode when + __attribute__((__constructor__)) is supported. + + - Added a new line to liblzma.pc for MSYS2 (Windows): + + Cflags.private: -DLZMA_API_STATIC + + When compiling code that will link against static liblzma, + the LZMA_API_STATIC macro needs to be defined on Windows. + + - CMake specific changes: + + * Fixed a bug that allowed CLOCK_MONOTONIC to be used even + if the check for it failed. + + * Fixed a bug where configuring CMake multiple times + resulted in HAVE_CLOCK_GETTIME and HAVE_CLOCK_MONOTONIC + not being set. + + * Fixed the build with MinGW-w64-based Clang/LLVM 17. + llvm-windres now has more accurate GNU windres emulation + so the GNU windres workaround from 5.4.1 is needed with + llvm-windres version 17 too. + + * The import library on Windows is now properly named + "liblzma.dll.a" instead of "libliblzma.dll.a" + + * Fixed a bug causing the Ninja Generator to fail on + UNIX-like systems. This bug was introduced in 5.4.0. + + * Added a new option to disable CLMUL CRC64. + + * A module-definition (.def) file is now created when + building liblzma.dll with MinGW-w64. + + * The pkg-config liblzma.pc file is now installed on all + builds except when using MSVC on Windows. + + * Added large file support by default for platforms that + need it to handle files larger than 2 GiB. This includes + MinGW-w64, even 64-bit builds. + + * Small fixes and improvements to the tests. + + * Updated translations: Chinese (simplified) and Esperanto. + + +5.4.4 (2023-08-02) + + * liblzma and xzdec can now build against WASI SDK when threading + support is disabled. xz and tests don't build yet. + + * CMake: + + - Fixed a bug preventing other projects from including liblzma + multiple times using find_package(). + + - Don't create broken symlinks in Cygwin and MSYS2 unless + supported by the environment. This prevented building for the + default MSYS2 environment. The problem was introduced in + xz 5.4.0. + + * Documentation: + + - Small improvements to man pages. + + - Small improvements and typo fixes for liblzma API + documentation. + + * Tests: + + - Added a new section to INSTALL to describe basic test usage + and address recent questions about building the tests when + cross compiling. + + - Small fixes and improvements to the tests. + + * Translations: + + - Fixed a mistake that caused one of the error messages to not + be translated. This only affected versions 5.4.2 and 5.4.3. + + - Updated the Chinese (simplified), Croatian, Esperanto, German, + Korean, Polish, Romanian, Spanish, Swedish, Ukrainian, and + Vietnamese translations. + + - Updated the German, Korean, Romanian, and Ukrainian man page + translations. + + +5.4.3 (2023-05-04) + + * All fixes from 5.2.12 + + * Features in the CMake build can now be disabled as CMake cache + variables, similar to the Autotools build. + + * Minor update to the Croatian translation. + + +5.4.2 (2023-03-18) + + * All fixes from 5.2.11 that were not included in 5.4.1. + + * If xz is built with support for the Capsicum sandbox but running + in an environment that doesn't support Capsicum, xz now runs + normally without sandboxing instead of exiting with an error. + + * liblzma: + + - Documentation was updated to improve the style, consistency, + and completeness of the liblzma API headers. + + - The Doxygen-generated HTML documentation for the liblzma API + header files is now included in the source release and is + installed as part of "make install". All JavaScript is + removed to simplify license compliance and to reduce the + install size. + + - Fixed a minor bug in lzma_str_from_filters() that produced + too many filters in the output string instead of reporting + an error if the input array had more than four filters. This + bug did not affect xz. + + * Build systems: + + - autogen.sh now invokes the doxygen tool via the new wrapper + script doxygen/update-doxygen, unless the command line option + --no-doxygen is used. + + - Added microlzma_encoder.c and microlzma_decoder.c to the + VS project files for Windows and to the CMake build. These + should have been included in 5.3.2alpha. + + * Tests: + + - Added a test to the CMake build that was forgotten in the + previous release. + + - Added and refactored a few tests. + + * Translations: + + - Updated the Brazilian Portuguese translation. + + - Added Brazilian Portuguese man page translation. + + +5.4.1 (2023-01-11) + + * liblzma: + + - Fixed the return value of lzma_microlzma_encoder() if the + LZMA options lc/lp/pb are invalid. Invalid lc/lp/pb options + made the function return LZMA_STREAM_END without encoding + anything instead of returning LZMA_OPTIONS_ERROR. + + - Windows / Visual Studio: Workaround a possible compiler bug + when targeting 32-bit x86 and compiling the CLMUL version of + the CRC64 code. The CLMUL code isn't enabled by the Windows + project files but it is in the CMake-based builds. + + * Build systems: + + - Windows-specific CMake changes: + + * Don't try to enable CLMUL CRC64 code if _mm_set_epi64x() + isn't available. This fixes CMake-based build with Visual + Studio 2013. + + * Created a workaround for a build failure with windres + from GNU binutils. It is used only when the C compiler + is GCC (not Clang). The workaround is incompatible + with llvm-windres, resulting in "XZx20Utils" instead + of "XZ Utils" in the resource file, but without the + workaround llvm-windres works correctly. See the + comment in CMakeLists.txt for details. + + * Included the resource files in the xz and xzdec build + rules. Building the command line tools is still + experimental but possible with MinGW-w64. + + - Visual Studio: Added stream_decoder_mt.c to the project + files. Now the threaded decompressor lzma_stream_decoder_mt() + gets built. CMake-based build wasn't affected. + + - Updated windows/INSTALL-MSVC.txt to mention that CMake-based + build is now the preferred method with Visual Studio. The + project files will probably be removed after 5.4.x releases. + + - Changes to #defines in config.h: + + * HAVE_DECL_CLOCK_MONOTONIC was replaced by + HAVE_CLOCK_MONOTONIC. The old macro was always defined + in configure-generated config.h to either 0 or 1. The + new macro is defined (to 1) only if the declaration of + CLOCK_MONOTONIC is available. This matches the way most + other config.h macros work and makes things simpler with + other build systems. + + * HAVE_DECL_PROGRAM_INVOCATION_NAME was replaced by + HAVE_PROGRAM_INVOCATION_NAME for the same reason. + + * Tests: + + - Fixed test script compatibility with ancient /bin/sh + versions. Now the five test_compress_* tests should + no longer fail on Solaris 10. + + - Added and refactored a few tests. + + * Translations: + + - Updated the Catalan and Esperanto translations. + + - Added Korean and Ukrainian man page translations. + + +5.4.0 (2022-12-13) + + This bumps the minor version of liblzma because new features were + added. The API and ABI are still backward compatible with liblzma + 5.2.x and 5.0.x. + + Since 5.3.5beta: + + * All fixes from 5.2.10. + + * The ARM64 filter is now stable. The xz option is now --arm64. + Decompression requires XZ Utils 5.4.0. In the future the ARM64 + filter will be supported by XZ for Java, XZ Embedded (including + the version in Linux), LZMA SDK, and 7-Zip. + + * Translations: + + - Updated Catalan, Croatian, German, Romanian, and Turkish + translations. + + - Updated German man page translations. + + - Added Romanian man page translations. + + Summary of new features added in the 5.3.x development releases: + + * liblzma: + + - Added threaded .xz decompressor lzma_stream_decoder_mt(). + It can use multiple threads with .xz files that have multiple + Blocks with size information in Block Headers. The threaded + encoder in xz has always created such files. + + Single-threaded encoder cannot store the size information in + Block Headers even if one used LZMA_FULL_FLUSH to create + multiple Blocks, so this threaded decoder cannot use multiple + threads with such files. + + If there are multiple Streams (concatenated .xz files), one + Stream will be decompressed completely before starting the + next Stream. + + - A new decoder flag LZMA_FAIL_FAST was added. It makes the + threaded decompressor report errors soon instead of first + flushing all pending data before the error location. + + - New Filter IDs: + * LZMA_FILTER_ARM64 is for ARM64 binaries. + * LZMA_FILTER_LZMA1EXT is for raw LZMA1 streams that don't + necessarily use the end marker. + + - Added lzma_str_to_filters(), lzma_str_from_filters(), and + lzma_str_list_filters() to convert a preset or a filter chain + string to a lzma_filter[] and vice versa. These should make + it easier to write applications that allow users to specify + custom compression options. + + - Added lzma_filters_free() which can be convenient for freeing + the filter options in a filter chain (an array of lzma_filter + structures). + + - lzma_file_info_decoder() to makes it a little easier to get + the Index field from .xz files. This helps in getting the + uncompressed file size but an easy-to-use random access + API is still missing which has existed in XZ for Java for + a long time. + + - Added lzma_microlzma_encoder() and lzma_microlzma_decoder(). + It is used by erofs-utils and may be used by others too. + + The MicroLZMA format is a raw LZMA stream (without end marker) + whose first byte (always 0x00) has been replaced with + bitwise-negation of the LZMA properties (lc/lp/pb). It was + created for use in EROFS but may be used in other contexts + as well where it is important to avoid wasting bytes for + stream headers or footers. The format is also supported by + XZ Embedded (the XZ Embedded version in Linux got MicroLZMA + support in Linux 5.16). + + The MicroLZMA encoder API in liblzma can compress into a + fixed-sized output buffer so that as much data is compressed + as can be fit into the buffer while still creating a valid + MicroLZMA stream. This is needed for EROFS. + + - Added lzma_lzip_decoder() to decompress the .lz (lzip) file + format version 0 and the original unextended version 1 files. + Also lzma_auto_decoder() supports .lz files. + + - lzma_filters_update() can now be used with the multi-threaded + encoder (lzma_stream_encoder_mt()) to change the filter chain + after LZMA_FULL_BARRIER or LZMA_FULL_FLUSH. + + - In lzma_options_lzma, allow nice_len = 2 and 3 with the match + finders that require at least 3 or 4. Now it is internally + rounded up if needed. + + - CLMUL-based CRC64 on x86-64 and E2K with runtime processor + detection. On 32-bit x86 it currently isn't available unless + --disable-assembler is used which can make the non-CLMUL + CRC64 slower; this might be fixed in the future. + + - Building with --disable-threads --enable-small + is now thread-safe if the compiler supports + __attribute__((__constructor__)). + + * xz: + + - Using -T0 (--threads=0) will now use multi-threaded encoder + even on a single-core system. This is to ensure that output + from the same xz binary is identical on both single-core and + multi-core systems. + + - --threads=+1 or -T+1 is now a way to put xz into + multi-threaded mode while using only one worker thread. + The + is ignored if the number is not 1. + + - A default soft memory usage limit is now used for compression + when -T0 is used and no explicit limit has been specified. + This soft limit is used to restrict the number of threads + but if the limit is exceeded with even one thread then xz + will continue with one thread using the multi-threaded + encoder and this limit is ignored. If the number of threads + is specified manually then no default limit will be used; + this affects only -T0. + + This change helps on systems that have very many cores and + using all of them for xz makes no sense. Previously xz -T0 + could run out of memory on such systems because it attempted + to reserve memory for too many threads. + + This also helps with 32-bit builds which don't have a large + amount of address space that would be required for many + threads. The default soft limit for -T0 is at most 1400 MiB + on all 32-bit platforms. + + - Previously a low value in --memlimit-compress wouldn't cause + xz to switch from multi-threaded mode to single-threaded mode + if the limit cannot otherwise be met; xz failed instead. Now + xz can switch to single-threaded mode and then, if needed, + scale down the LZMA2 dictionary size too just like it already + did when it was started in single-threaded mode. + + - The option --no-adjust no longer prevents xz from scaling down + the number of threads as that doesn't affect the compressed + output (only performance). Now --no-adjust only prevents + adjustments that affect compressed output, that is, with + --no-adjust xz won't switch from multi-threaded mode to + single-threaded mode and won't scale down the LZMA2 + dictionary size. + + - Added a new option --memlimit-mt-decompress=LIMIT. This is + used to limit the number of decompressor threads (possibly + falling back to single-threaded mode) but it will never make + xz refuse to decompress a file. This has a system-specific + default value because without any limit xz could end up + allocating memory for the whole compressed input file, the + whole uncompressed output file, multiple thread-specific + decompressor instances and so on. Basically xz could + attempt to use an insane amount of memory even with fairly + common files. The system-specific default value is currently + the same as the one used for compression with -T0. + + The new option works together with the existing option + --memlimit-decompress=LIMIT. The old option sets a hard limit + that must not be exceeded (xz will refuse to decompress) + while the new option only restricts the number of threads. + If the limit set with --memlimit-mt-decompress is greater + than the limit set with --memlimit-compress, then the latter + value is used also for --memlimit-mt-decompress. + + - Added new information to the output of xz --info-memory and + new fields to the output of xz --robot --info-memory. + + - In --lzma2=nice=NUMBER allow 2 and 3 with all match finders + now that liblzma handles it. + + - Don't mention endianness for ARM and ARM-Thumb filters in + --long-help. The filters only work for little endian + instruction encoding but modern ARM processors using + big endian data access still use little endian + instruction encoding. So the help text was misleading. + In contrast, the PowerPC filter is only for big endian + 32/64-bit PowerPC code. Little endian PowerPC would need + a separate filter. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. It is + autodetected by default. See also the option --format on + the xz man page. + + - Sandboxing enabled by default: + * Capsicum (FreeBSD) + * pledge(2) (OpenBSD) + + * Scripts now support the .lz format using xz. + + * A few new tests were added. + + * The liblzma-specific tests are now supported in CMake-based + builds too ("make test"). + + +5.3.5beta (2022-12-01) + + * All fixes from 5.2.9. + + * liblzma: + + - Added new LZMA_FILTER_LZMA1EXT for raw encoder and decoder to + handle raw LZMA1 streams that don't have end of payload marker + (EOPM) alias end of stream (EOS) marker. It can be used in + filter chains, for example, with the x86 BCJ filter. + + - Added lzma_str_to_filters(), lzma_str_from_filters(), and + lzma_str_list_filters() to make it easier for applications + to get custom compression options from a user and convert + it to an array of lzma_filter structures. + + - Added lzma_filters_free(). + + - lzma_filters_update() can now be used with the multi-threaded + encoder (lzma_stream_encoder_mt()) to change the filter chain + after LZMA_FULL_BARRIER or LZMA_FULL_FLUSH. + + - In lzma_options_lzma, allow nice_len = 2 and 3 with the match + finders that require at least 3 or 4. Now it is internally + rounded up if needed. + + - ARM64 filter was modified. It is still experimental. + + - Fixed LTO build with Clang if -fgnuc-version=10 or similar + was used to make Clang look like GCC >= 10. Now it uses + __has_attribute(__symver__) which should be reliable. + + * xz: + + - --threads=+1 or -T+1 is now a way to put xz into multi-threaded + mode while using only one worker thread. + + - In --lzma2=nice=NUMBER allow 2 and 3 with all match finders + now that liblzma handles it. + + * Updated translations: Chinese (simplified), Korean, and Turkish. + + +5.3.4alpha (2022-11-15) + + * All fixes from 5.2.7 and 5.2.8. + + * liblzma: + + - Minor improvements to the threaded decoder. + + - Added CRC64 implementation that uses SSSE3, SSE4.1, and CLMUL + instructions on 32/64-bit x86 and E2K. On 32-bit x86 it's + not enabled unless --disable-assembler is used but then + the non-CLMUL code might be slower. Processor support is + detected at runtime so this is built by default on x86-64 + and E2K. On these platforms, if compiler flags indicate + unconditional CLMUL support (-msse4.1 -mpclmul) then the + generic version is not built, making liblzma 8-9 KiB smaller + compared to having both versions included. + + With extremely compressible files this can make decompression + up to twice as fast but with typical files 5 % improvement + is a more realistic expectation. + + The CLMUL version is slower than the generic version with + tiny inputs (especially at 1-8 bytes per call, but up to + 16 bytes). In normal use in xz this doesn't matter at all. + + - Added an experimental ARM64 filter. This is *not* the final + version! Files created with this experimental version won't + be supported in the future versions! The filter design is + a compromise where improving one use case makes some other + cases worse. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. See the + API docs of lzma_lzip_decoder() for details. Also + lzma_auto_decoder() supports .lz files. + + - Building with --disable-threads --enable-small + is now thread-safe if the compiler supports + __attribute__((__constructor__)) + + * xz: + + - Added support for OpenBSD's pledge(2) as a sandboxing method. + + - Don't mention endianness for ARM and ARM-Thumb filters in + --long-help. The filters only work for little endian + instruction encoding but modern ARM processors using + big endian data access still use little endian + instruction encoding. So the help text was misleading. + In contrast, the PowerPC filter is only for big endian + 32/64-bit PowerPC code. Little endian PowerPC would need + a separate filter. + + - Added --experimental-arm64. This will be renamed once the + filter is finished. Files created with this experimental + filter will not be supported in the future! + + - Added new fields to the output of xz --robot --info-memory. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. It is + autodetected by default. See also the option --format on + the xz man page. + + * Scripts now support the .lz format using xz. + + * Build systems: + + - New #defines in config.h: HAVE_ENCODER_ARM64, + HAVE_DECODER_ARM64, HAVE_LZIP_DECODER, HAVE_CPUID_H, + HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR, HAVE_USABLE_CLMUL + + - New configure options: --disable-clmul-crc, + --disable-microlzma, --disable-lzip-decoder, and + 'pledge' is now an option in --enable-sandbox (but + it's autodetected by default anyway). + + - INSTALL was updated to document the new configure options. + + - PACKAGERS now lists also --disable-microlzma and + --disable-lzip-decoder as configure options that must + not be used in builds for non-embedded use. + + * Tests: + + - Fix some of the tests so that they skip instead of fail if + certain features have been disabled with configure options. + It's still not perfect. + + - Other improvements to tests. + + * Updated translations: Croatian, Finnish, Hungarian, Polish, + Romanian, Spanish, Swedish, and Ukrainian. + + +5.3.3alpha (2022-08-22) + + * All fixes from 5.2.6. + + * liblzma: + + - Fixed 32-bit build. + + - Added threaded .xz decompressor lzma_stream_decoder_mt(). + It can use multiple threads with .xz files that have multiple + Blocks with size information in Block Headers. The threaded + encoder in xz has always created such files. + + Single-threaded encoder cannot store the size information in + Block Headers even if one used LZMA_FULL_FLUSH to create + multiple Blocks, so this threaded decoder cannot use multiple + threads with such files. + + If there are multiple Streams (concatenated .xz files), one + Stream will be decompressed completely before starting the + next Stream. + + - A new decoder flag LZMA_FAIL_FAST was added. It makes the + threaded decompressor report errors soon instead of first + flushing all pending data before the error location. + + * xz: + + - Using -T0 (--threads=0) will now use multi-threaded encoder + even on a single-core system. This is to ensure that output + from the same xz binary is identical on both single-core and + multi-core systems. + + - A default soft memory usage limit is now used for compression + when -T0 is used and no explicit limit has been specified. + This soft limit is used to restrict the number of threads + but if the limit is exceeded with even one thread then xz + will continue with one thread using the multi-threaded + encoder and this limit is ignored. If the number of threads + is specified manually then no default limit will be used; + this affects only -T0. + + This change helps on systems that have very many cores and + using all of them for xz makes no sense. Previously xz -T0 + could run out of memory on such systems because it attempted + to reserve memory for too many threads. + + This also helps with 32-bit builds which don't have a large + amount of address space that would be required for many + threads. The default limit is 1400 MiB on all 32-bit + platforms with -T0. + + Now xz -T0 should just work. It might use too few threads + in some cases but at least it shouldn't easily run out of + memory. It's possible that this will be tweaked before 5.4.0. + + - Changes to --memlimit-compress and --no-adjust: + + In single-threaded mode, --memlimit-compress can make xz + scale down the LZMA2 dictionary size to meet the memory usage + limit. This obviously affects the compressed output. However, + if xz was in threaded mode, --memlimit-compress could make xz + reduce the number of threads but it wouldn't make xz switch + from multi-threaded mode to single-threaded mode or scale + down the LZMA2 dictionary size. This seemed illogical. + + Now --memlimit-compress can make xz switch to single-threaded + mode if one thread in multi-threaded mode uses too much + memory. If memory usage is still too high, then the LZMA2 + dictionary size can be scaled down too. + + The option --no-adjust was also changed so that it no longer + prevents xz from scaling down the number of threads as that + doesn't affect compressed output (only performance). After + this commit --no-adjust only prevents adjustments that affect + compressed output, that is, with --no-adjust xz won't switch + from multithreaded mode to single-threaded mode and won't + scale down the LZMA2 dictionary size. + + - Added a new option --memlimit-mt-decompress=LIMIT. This is + used to limit the number of decompressor threads (possibly + falling back to single-threaded mode) but it will never make + xz refuse to decompress a file. This has a system-specific + default value because without any limit xz could end up + allocating memory for the whole compressed input file, the + whole uncompressed output file, multiple thread-specific + decompressor instances and so on. Basically xz could + attempt to use an insane amount of memory even with fairly + common files. + + The new option works together with the existing option + --memlimit-decompress=LIMIT. The old option sets a hard limit + that must not be exceeded (xz will refuse to decompress) + while the new option only restricts the number of threads. + If the limit set with --memlimit-mt-decompress is greater + than the limit set with --memlimit-compress, then the latter + value is used also for --memlimit-mt-decompress. + + * Tests: + + - Added a few more tests. + + - Added tests/code_coverage.sh to create a code coverage report + of the tests. + + * Build systems: + + - Automake's parallel test harness is now used to make tests + finish faster. + + - Added the CMake files to the distribution tarball. These were + supposed to be in 5.2.5 already. + + - Added liblzma tests to the CMake build. + + - Windows: Fix building of liblzma.dll with the included + Visual Studio project files. + + +5.3.2alpha (2021-10-28) + + This release was made on short notice so that recent erofs-utils can + be built with LZMA support without needing a snapshot from xz.git. + Thus many pending things were not included, not even updated + translations (which would need to be updated for the new --list + strings anyway). + + * All fixes from 5.2.5. + + * xz: + + - When copying metadata from the source file to the destination + file, don't try to set the group (GID) if it is already set + correctly. This avoids a failure on OpenBSD (and possibly on + a few other OSes) where files may get created so that their + group doesn't belong to the user, and fchown(2) can fail even + if it needs to do nothing. + + - The --keep option now accepts symlinks, hardlinks, and + setuid, setgid, and sticky files. Previously this required + using --force. + + - Split the long strings used in --list and --info-memory modes + to make them much easier for translators. + + - If built with sandbox support and enabling the sandbox fails, + xz will now immediately exit with exit status of 1. Previously + it would only display a warning if -vv was used. + + - Cap --memlimit-compress to 2000 MiB on MIPS32 because on + MIPS32 userspace processes are limited to 2 GiB of address + space. + + * liblzma: + + - Added lzma_microlzma_encoder() and lzma_microlzma_decoder(). + The API is in lzma/container.h. + + The MicroLZMA format is a raw LZMA stream (without end marker) + whose first byte (always 0x00) has been replaced with + bitwise-negation of the LZMA properties (lc/lp/pb). It was + created for use in EROFS but may be used in other contexts + as well where it is important to avoid wasting bytes for + stream headers or footers. The format is also supported by + XZ Embedded. + + The MicroLZMA encoder API in liblzma can compress into a + fixed-sized output buffer so that as much data is compressed + as can be fit into the buffer while still creating a valid + MicroLZMA stream. This is needed for EROFS. + + - Added fuzzing support. + + - Support Intel Control-flow Enforcement Technology (CET) in + 32-bit x86 assembly files. + + - Visual Studio: Use non-standard _MSVC_LANG to detect C++ + standard version in the lzma.h API header. It's used to + detect when "noexcept" can be used. + + * Scripts: + + - Fix exit status of xzdiff/xzcmp. Exit status could be 2 when + the correct value is 1. + + - Fix exit status of xzgrep. + + - Detect corrupt .bz2 files in xzgrep. + + - Add zstd support to xzgrep and xzdiff/xzcmp. + + - Fix less(1) version detection in xzless. It failed if the + version number from "less -V" contained a dot. + + * Fix typos and technical issues in man pages. + + * Build systems: + + - Windows: Fix building of resource files when config.h isn't + used. CMake + Visual Studio can now build liblzma.dll. + + - Various fixes to the CMake support. It might still need a few + more fixes even for liblzma-only builds. + + +5.3.1alpha (2018-04-29) + + * All fixes from 5.2.4. + + * Add lzma_file_info_decoder() into liblzma and use it in xz to + implement the --list feature. + + * Capsicum sandbox support is enabled by default where available + (FreeBSD >= 10). + + +5.2.10 (2022-12-13) + + * xz: Don't modify argv[] when parsing the --memlimit* and + --block-list command line options. This fixes confusing + arguments in process listing (like "ps auxf"). + + * GNU/Linux only: Use __has_attribute(__symver__) to detect if + that attribute is supported. This fixes build on Mandriva where + Clang is patched to define __GNUC__ to 11 by default (instead + of 4 as used by Clang upstream). + + +5.2.9 (2022-11-30) + + * liblzma: + + - Fixed an infinite loop in LZMA encoder initialization + if dict_size >= 2 GiB. (The encoder only supports up + to 1536 MiB.) + + - Fixed two cases of invalid free() that can happen if + a tiny allocation fails in encoder re-initialization + or in lzma_filters_update(). These bugs had some + similarities with the bug fixed in 5.2.7. + + - Fixed lzma_block_encoder() not allowing the use of + LZMA_SYNC_FLUSH with lzma_code() even though it was + documented to be supported. The sync-flush code in + the Block encoder was already used internally via + lzma_stream_encoder(), so this was just a missing flag + in the lzma_block_encoder() API function. + + - GNU/Linux only: Don't put symbol versions into static + liblzma as it breaks things in some cases (and even if + it didn't break anything, symbol versions in static + libraries are useless anyway). The downside of the fix + is that if the configure options --with-pic or --without-pic + are used then it's not possible to build both shared and + static liblzma at the same time on GNU/Linux anymore; + with those options --disable-static or --disable-shared + must be used too. + + * New email address for bug reports is which + forwards messages to Lasse Collin and Jia Tan. + + +5.2.8 (2022-11-13) + + * xz: + + - If xz cannot remove an input file when it should, this + is now treated as a warning (exit status 2) instead of + an error (exit status 1). This matches GNU gzip and it + is more logical as at that point the output file has + already been successfully closed. + + - Fix handling of .xz files with an unsupported check type. + Previously such printed a warning message but then xz + behaved as if an error had occurred (didn't decompress, + exit status 1). Now a warning is printed, decompression + is done anyway, and exit status is 2. This used to work + slightly before 5.0.0. In practice this bug matters only + if xz has been built with some check types disabled. As + instructed in PACKAGERS, such builds should be done in + special situations only. + + - Fix "xz -dc --single-stream tests/files/good-0-empty.xz" + which failed with "Internal error (bug)". That is, + --single-stream was broken if the first .xz stream in + the input file didn't contain any uncompressed data. + + - Fix displaying file sizes in the progress indicator when + working in passthru mode and there are multiple input files. + Just like "gzip -cdf", "xz -cdf" works like "cat" when the + input file isn't a supported compressed file format. In + this case the file size counters weren't reset between + files so with multiple input files the progress indicator + displayed an incorrect (too large) value. + + * liblzma: + + - API docs in lzma/container.h: + * Update the list of decoder flags in the decoder + function docs. + * Explain LZMA_CONCATENATED behavior with .lzma files + in lzma_auto_decoder() docs. + + - OpenBSD: Use HW_NCPUONLINE to detect the number of + available hardware threads in lzma_physmem(). + + - Fix use of wrong macro to detect x86 SSE2 support. + __SSE2_MATH__ was used with GCC/Clang but the correct + one is __SSE2__. The first one means that SSE2 is used + for floating point math which is irrelevant here. + The affected SSE2 code isn't used on x86-64 so this affects + only 32-bit x86 builds that use -msse2 without -mfpmath=sse + (there is no runtime detection for SSE2). It improves LZMA + compression speed (not decompression). + + - Fix the build with Intel C compiler 2021 (ICC, not ICX) + on Linux. It defines __GNUC__ to 10 but doesn't support + the __symver__ attribute introduced in GCC 10. + + * Scripts: Ignore warnings from xz by using --quiet --no-warn. + This is needed if the input .xz files use an unsupported + check type. + + * Translations: + + - Updated Croatian and Turkish translations. + + - One new translations wasn't included because it needed + technical fixes. It will be in upcoming 5.4.0. No new + translations will be added to the 5.2.x branch anymore. + + - Renamed the French man page translation file from + fr_FR.po to fr.po and thus also its install directory + (like /usr/share/man/fr_FR -> .../fr). + + - Man page translations for upcoming 5.4.0 are now handled + in the Translation Project. + + * Update doc/faq.txt a little so it's less out-of-date. + + +5.2.7 (2022-09-30) + + * liblzma: + + - Made lzma_filters_copy() to never modify the destination + array if an error occurs. lzma_stream_encoder() and + lzma_stream_encoder_mt() already assumed this. Before this + change, if a tiny memory allocation in lzma_filters_copy() + failed it would lead to a crash (invalid free() or invalid + memory reads) in the cleanup paths of these two encoder + initialization functions. + + - Added missing integer overflow check to lzma_index_append(). + This affects xz --list and other applications that decode + the Index field from .xz files using lzma_index_decoder(). + Normal decompression of .xz files doesn't call this code + and thus most applications using liblzma aren't affected + by this bug. + + - Single-threaded .xz decoder (lzma_stream_decoder()): If + lzma_code() returns LZMA_MEMLIMIT_ERROR it is now possible + to use lzma_memlimit_set() to increase the limit and continue + decoding. This was supposed to work from the beginning + but there was a bug. With other decoders (.lzma or + threaded .xz decoder) this already worked correctly. + + - Fixed accumulation of integrity check type statistics in + lzma_index_cat(). This bug made lzma_index_checks() return + only the type of the integrity check of the last Stream + when multiple lzma_indexes were concatenated. Most + applications don't use these APIs but in xz it made + xz --list not list all check types from concatenated .xz + files. In xz --list --verbose only the per-file "Check:" + lines were affected and in xz --robot --list only the "file" + line was affected. + + - Added ABI compatibility with executables that were linked + against liblzma in RHEL/CentOS 7 or other liblzma builds + that had copied the problematic patch from RHEL/CentOS 7 + (xz-5.2.2-compat-libs.patch). For the details, see the + comment at the top of src/liblzma/validate_map.sh. + + WARNING: This uses __symver__ attribute with GCC >= 10. + In other cases the traditional __asm__(".symver ...") + is used. Using link-time optimization (LTO, -flto) with + GCC versions older than 10 can silently result in + broken liblzma.so.5 (incorrect symbol versions)! If you + want to use -flto with GCC, you must use GCC >= 10. + LTO with Clang seems to work even with the traditional + __asm__(".symver ...") method. + + * xzgrep: Fixed compatibility with old shells that break if + comments inside command substitutions have apostrophes ('). + This problem was introduced in 5.2.6. + + * Build systems: + + - New #define in config.h: HAVE_SYMBOL_VERSIONS_LINUX + + - Windows: Fixed liblzma.dll build with Visual Studio project + files. It broke in 5.2.6 due to a change that was made to + improve CMake support. + + - Windows: Building liblzma with UNICODE defined should now + work. + + - CMake files are now actually included in the release tarball. + They should have been in 5.2.5 already. + + - Minor CMake fixes and improvements. + + * Added a new translation: Turkish + + +5.2.6 (2022-08-12) + + * xz: + + - The --keep option now accepts symlinks, hardlinks, and + setuid, setgid, and sticky files. Previously this required + using --force. + + - When copying metadata from the source file to the destination + file, don't try to set the group (GID) if it is already set + correctly. This avoids a failure on OpenBSD (and possibly on + a few other OSes) where files may get created so that their + group doesn't belong to the user, and fchown(2) can fail even + if it needs to do nothing. + + - Cap --memlimit-compress to 2000 MiB instead of 4020 MiB on + MIPS32 because on MIPS32 userspace processes are limited + to 2 GiB of address space. + + * liblzma: + + - Fixed a missing error-check in the threaded encoder. If a + small memory allocation fails, a .xz file with an invalid + Index field would be created. Decompressing such a file would + produce the correct output but result in an error at the end. + Thus this is a "mild" data corruption bug. Note that while + a failed memory allocation can trigger the bug, it cannot + cause invalid memory access. + + - The decoder for .lzma files now supports files that have + uncompressed size stored in the header and still use the + end of payload marker (end of stream marker) at the end + of the LZMA stream. Such files are rare but, according to + the documentation in LZMA SDK, they are valid. + doc/lzma-file-format.txt was updated too. + + - Improved 32-bit x86 assembly files: + * Support Intel Control-flow Enforcement Technology (CET) + * Use non-executable stack on FreeBSD. + + - Visual Studio: Use non-standard _MSVC_LANG to detect C++ + standard version in the lzma.h API header. It's used to + detect when "noexcept" can be used. + + * xzgrep: + + - Fixed arbitrary command injection via a malicious filename + (CVE-2022-1271, ZDI-CAN-16587). A standalone patch for + this was released to the public on 2022-04-07. A slight + robustness improvement has been made since then and, if + using GNU or *BSD grep, a new faster method is now used + that doesn't use the old sed-based construct at all. This + also fixes bad output with GNU grep >= 3.5 (2020-09-27) + when xzgrepping binary files. + + This vulnerability was discovered by: + cleemy desu wayo working with Trend Micro Zero Day Initiative + + - Fixed detection of corrupt .bz2 files. + + - Improved error handling to fix exit status in some situations + and to fix handling of signals: in some situations a signal + didn't make xzgrep exit when it clearly should have. It's + possible that the signal handling still isn't quite perfect + but hopefully it's good enough. + + - Documented exit statuses on the man page. + + - xzegrep and xzfgrep now use "grep -E" and "grep -F" instead + of the deprecated egrep and fgrep commands. + + - Fixed parsing of the options -E, -F, -G, -P, and -X. The + problem occurred when multiple options were specified in + a single argument, for example, + + echo foo | xzgrep -Fe foo + + treated foo as a filename because -Fe wasn't correctly + split into -F -e. + + - Added zstd support. + + * xzdiff/xzcmp: + + - Fixed wrong exit status. Exit status could be 2 when the + correct value is 1. + + - Documented on the man page that exit status of 2 is used + for decompression errors. + + - Added zstd support. + + * xzless: + + - Fix less(1) version detection. It failed if the version number + from "less -V" contained a dot. + + * Translations: + + - Added new translations: Catalan, Croatian, Esperanto, + Korean, Portuguese, Romanian, Serbian, Spanish, Swedish, + and Ukrainian + + - Updated the Brazilian Portuguese translation. + + - Added French man page translation. This and the existing + German translation aren't complete anymore because the + English man pages got a few updates and the translators + weren't reached so that they could update their work. + + * Build systems: + + - Windows: Fix building of resource files when config.h isn't + used. CMake + Visual Studio can now build liblzma.dll. + + - Various fixes to the CMake support. Building static or shared + liblzma should work fine in most cases. In contrast, building + the command line tools with CMake is still clearly incomplete + and experimental and should be used for testing only. + + +5.2.5 (2020-03-17) + + * liblzma: + + - Fixed several C99/C11 conformance bugs. Now the code is clean + under gcc/clang -fsanitize=undefined. Some of these changes + might have a negative effect on performance with old GCC + versions or compilers other than GCC and Clang. The configure + option --enable-unsafe-type-punning can be used to (mostly) + restore the old behavior but it shouldn't normally be used. + + - Improved API documentation of lzma_properties_decode(). + + - Added a very minor encoder speed optimization. + + * xz: + + - Fixed a crash in "xz -dcfv not_an_xz_file". All four options + were required to trigger it. The crash occurred in the + progress indicator code when xz was in passthru mode where + xz works like "cat". + + - Fixed an integer overflow with 32-bit off_t. It could happen + when decompressing a file that has a long run of zero bytes + which xz would try to write as a sparse file. Since the build + system enables large file support by default, off_t is + normally 64-bit even on 32-bit systems. + + - Fixes for --flush-timeout: + * Fix semi-busy-waiting. + * Avoid unneeded flushes when no new input has arrived + since the previous flush was completed. + + - Added a special case for 32-bit xz: If --memlimit-compress is + used to specify a limit that exceeds 4020 MiB, the limit will + be set to 4020 MiB. The values "0" and "max" aren't affected + by this and neither is decompression. This hack can be + helpful when a 32-bit xz has access to 4 GiB address space + but the specified memlimit exceeds 4 GiB. This can happen + e.g. with some scripts. + + - Capsicum sandbox is now enabled by default where available + (FreeBSD >= 10). The sandbox debug messages (xz -vv) were + removed since they seemed to be more annoying than useful. + + - DOS build now requires DJGPP 2.05 instead of 2.04beta. + A workaround for a locale problem with DJGPP 2.05 was added. + + * xzgrep and other scripts: + + - Added a configure option --enable-path-for-scripts=PREFIX. + It is disabled by default except on Solaris where the default + is /usr/xpg4/bin. See INSTALL for details. + + - Added a workaround for a POSIX shell detection problem on + Solaris. + + * Build systems: + + - Added preliminary build instructions for z/OS. See INSTALL + section 1.2.9. + + - Experimental CMake support was added. It should work to build + static liblzma on a few operating systems. It may or may not + work to build shared liblzma. On some platforms it can build + xz and xzdec too but those are only for testing. See the + comment in the beginning of CMakeLists.txt for details. + + - Visual Studio project files were updated. + WindowsTargetPlatformVersion was removed from VS2017 files + and set to "10.0" in the added VS2019 files. In the future + the VS project files will be removed when CMake support is + good enough. + + - New #defines in config.h: HAVE___BUILTIN_ASSUME_ALIGNED, + HAVE___BUILTIN_BSWAPXX, and TUKLIB_USE_UNSAFE_TYPE_PUNNING. + + - autogen.sh has a new optional dependency on po4a and a new + option --no-po4a to skip that step. This matters only if one + wants to remake the build files. po4a is used to update the + translated man pages but as long as the man pages haven't + been modified, there's nothing to update and one can use + --no-po4a to avoid the dependency on po4a. + + * Translations: + + - XZ Utils translations are now handled by the Translation + Project: https://translationproject.org/domain/xz.html + + - All man pages are now included in German too. + + - New xz translations: Brazilian Portuguese, Finnish, + Hungarian, Chinese (simplified), Chinese (traditional), + and Danish (partial translation) + + - Updated xz translations: French, German, Italian, and Polish + + - Unfortunately a few new xz translations weren't included due + to technical problems like too long lines in --help output or + misaligned column headings in tables. In the future, many of + these strings will be split and e.g. the table column + alignment will be handled in software. This should make the + strings easier to translate. + + +5.2.4 (2018-04-29) + + * liblzma: + + - Allow 0 as memory usage limit instead of returning + LZMA_PROG_ERROR. Now 0 is treated as if 1 byte was specified, + which effectively is the same as 0. + + - Use "noexcept" keyword instead of "throw()" in the public + headers when a C++11 (or newer standard) compiler is used. + + - Added a portability fix for recent Intel C Compilers. + + - Microsoft Visual Studio build files have been moved under + windows/vs2013 and windows/vs2017. + + * xz: + + - Fix "xz --list --robot missing_or_bad_file.xz" which would + try to print an uninitialized string and thus produce garbage + output. Since the exit status is non-zero, most uses of such + a command won't try to interpret the garbage output. + + - "xz --list foo.xz" could print "Internal error (bug)" in a + corner case where a specific memory usage limit had been set. + + +5.2.3 (2016-12-30) + + * xz: + + - Always close a file before trying to delete it to avoid + problems on some operating system and file system combinations. + + - Fixed copying of file timestamps on Windows. + + - Added experimental (disabled by default) sandbox support using + Capsicum (FreeBSD >= 10). See --enable-sandbox in INSTALL. + + * C99/C11 conformance fixes to liblzma. The issues affected at least + some builds using link-time optimizations. + + * Fixed bugs in the rarely-used function lzma_index_dup(). + + * Use of external SHA-256 code is now disabled by default. + It can still be enabled by passing --enable-external-sha256 + to configure. The reasons to disable it by default (see INSTALL + for more details): + + - Some OS-specific SHA-256 implementations conflict with + OpenSSL and cause problems in programs that link against both + liblzma and libcrypto. At least FreeBSD 10 and MINIX 3.3.0 + are affected. + + - The internal SHA-256 is faster than the SHA-256 code in + some operating systems. + + * Changed CPU core count detection to use sched_getaffinity() on + GNU/Linux and GNU/kFreeBSD. + + * Fixes to the build-system and xz to make xz buildable even when + encoders, decoders, or threading have been disabled from libilzma + using configure options. These fixes added two new #defines to + config.h: HAVE_ENCODERS and HAVE_DECODERS. + + +5.2.2 (2015-09-29) + + * Fixed bugs in QNX-specific code. + + * Omitted the use of pipe2() even if it is available to avoid + portability issues with some old Linux and glibc combinations. + + * Updated German translation. + + * Added project files to build static and shared liblzma (not the + whole XZ Utils) with Visual Studio 2013 update 2 or later. + + * Documented that threaded decompression hasn't been implemented + yet. A 5.2.0 NEWS entry describing multi-threading support had + incorrectly said "decompression" when it should have said + "compression". + + +5.2.1 (2015-02-26) + + * Fixed a compression-ratio regression in fast mode of LZMA1 and + LZMA2. The bug is present in 5.1.4beta and 5.2.0 releases. + + * Fixed a portability problem in xz that affected at least OpenBSD. + + * Fixed xzdiff to be compatible with FreeBSD's mktemp which differs + from most other mktemp implementations. + + * Changed CPU core count detection to use cpuset_getaffinity() on + FreeBSD. + + +5.2.0 (2014-12-21) + + Since 5.1.4beta: + + * All fixes from 5.0.8 + + * liblzma: Fixed lzma_stream_encoder_mt_memusage() when a preset + was used. + + * xzdiff: If mktemp isn't installed, mkdir will be used as + a fallback to create a temporary directory. Installing mktemp + is still recommended. + + * Updated French, German, Italian, Polish, and Vietnamese + translations. + + Summary of fixes and new features added in the 5.1.x development + releases: + + * liblzma: + + - Added support for multi-threaded compression. See the + lzma_mt structure, lzma_stream_encoder_mt(), and + lzma_stream_encoder_mt_memusage() in , + lzma_get_progress() in , and lzma_cputhreads() + in for details. + + - Made the uses of lzma_allocator const correct. + + - Added lzma_block_uncomp_encode() to create uncompressed + .xz Blocks using LZMA2 uncompressed chunks. + + - Added support for LZMA_IGNORE_CHECK. + + - A few speed optimizations were made. + + - Added support for symbol versioning. It is enabled by default + on GNU/Linux, other GNU-based systems, and FreeBSD. + + - liblzma (not the whole XZ Utils) should now be buildable + with MSVC 2013 update 2 or later using windows/config.h. + + * xz: + + - Fixed a race condition in the signal handling. It was + possible that e.g. the first SIGINT didn't make xz exit + if reading or writing blocked and one had bad luck. The fix + is non-trivial, so as of writing it is unknown if it will be + backported to the v5.0 branch. + + - Multi-threaded compression can be enabled with the + --threads (-T) option. + [Fixed: This originally said "decompression".] + + - New command line options in xz: --single-stream, + --block-size=SIZE, --block-list=SIZES, + --flush-timeout=TIMEOUT, and --ignore-check. + + - xz -lvv now shows the minimum xz version that is required to + decompress the file. Currently it is 5.0.0 for all supported + .xz files except files with empty LZMA2 streams require 5.0.2. + + * xzdiff and xzgrep now support .lzo files if lzop is installed. + The .tzo suffix is also recognized as a shorthand for .tar.lzo. + + +5.1.4beta (2014-09-14) + + * All fixes from 5.0.6 + + * liblzma: Fixed the use of presets in threaded encoder + initialization. + + * xz --block-list and --block-size can now be used together + in single-threaded mode. Previously the combination only + worked in multi-threaded mode. + + * Added support for LZMA_IGNORE_CHECK to liblzma and made it + available in xz as --ignore-check. + + * liblzma speed optimizations: + + - Initialization of a new LZMA1 or LZMA2 encoder has been + optimized. (The speed of reinitializing an already-allocated + encoder isn't affected.) This helps when compressing many + small buffers with lzma_stream_buffer_encode() and other + similar situations where an already-allocated encoder state + isn't reused. This speed-up is visible in xz too if one + compresses many small files one at a time instead running xz + once and giving all files as command-line arguments. + + - Buffer comparisons are now much faster when unaligned access + is allowed (configured with --enable-unaligned-access). This + speeds up encoding significantly. There is arch-specific code + for 32-bit and 64-bit x86 (32-bit needs SSE2 for the best + results and there's no run-time CPU detection for now). + For other archs there is only generic code which probably + isn't as optimal as arch-specific solutions could be. + + - A few speed optimizations were made to the SHA-256 code. + (Note that the builtin SHA-256 code isn't used on all + operating systems.) + + * liblzma can now be built with MSVC 2013 update 2 or later + using windows/config.h. + + * Vietnamese translation was added. + + +5.1.3alpha (2013-10-26) + + * All fixes from 5.0.5 + + * liblzma: + + - Fixed a deadlock in the threaded encoder. + + - Made the uses of lzma_allocator const correct. + + - Added lzma_block_uncomp_encode() to create uncompressed + .xz Blocks using LZMA2 uncompressed chunks. + + - Added support for native threads on Windows and the ability + to detect the number of CPU cores. + + * xz: + + - Fixed a race condition in the signal handling. It was + possible that e.g. the first SIGINT didn't make xz exit + if reading or writing blocked and one had bad luck. The fix + is non-trivial, so as of writing it is unknown if it will be + backported to the v5.0 branch. + + - Made the progress indicator work correctly in threaded mode. + + - Threaded encoder now works together with --block-list=SIZES. + + - Added preliminary support for --flush-timeout=TIMEOUT. + It can be useful for (somewhat) real-time streaming. For + now the decompression side has to be done with something + else than the xz tool due to how xz does buffering, but this + should be fixed. + + +5.1.2alpha (2012-07-04) + + * All fixes from 5.0.3 and 5.0.4 + + * liblzma: + + - Fixed a deadlock and an invalid free() in the threaded encoder. + + - Added support for symbol versioning. It is enabled by default + on GNU/Linux, other GNU-based systems, and FreeBSD. + + - Use SHA-256 implementation from the operating system if one is + available in libc, libmd, or libutil. liblzma won't use e.g. + OpenSSL or libgcrypt to avoid introducing new dependencies. + + - Fixed liblzma.pc for static linking. + + - Fixed a few portability bugs. + + * xz --decompress --single-stream now fixes the input position after + successful decompression. Now the following works: + + echo foo | xz > foo.xz + echo bar | xz >> foo.xz + ( xz -dc --single-stream ; xz -dc --single-stream ) < foo.xz + + Note that it doesn't work if the input is not seekable + or if there is Stream Padding between the concatenated + .xz Streams. + + * xz -lvv now shows the minimum xz version that is required to + decompress the file. Currently it is 5.0.0 for all supported .xz + files except files with empty LZMA2 streams require 5.0.2. + + * Added an *incomplete* implementation of --block-list=SIZES to xz. + It only works correctly in single-threaded mode and when + --block-size isn't used at the same time. --block-list allows + specifying the sizes of Blocks which can be useful e.g. when + creating files for random-access reading. + + +5.1.1alpha (2011-04-12) + + * All fixes from 5.0.2 + + * liblzma fixes that will also be included in 5.0.3: + + - A memory leak was fixed. + + - lzma_stream_buffer_encode() no longer creates an empty .xz + Block if encoding an empty buffer. Such an empty Block with + LZMA2 data would trigger a bug in 5.0.1 and older (see the + first bullet point in 5.0.2 notes). When releasing 5.0.2, + I thought that no encoder creates this kind of files but + I was wrong. + + - Validate function arguments better in a few functions. Most + importantly, specifying an unsupported integrity check to + lzma_stream_buffer_encode() no longer creates a corrupt .xz + file. Probably no application tries to do that, so this + shouldn't be a big problem in practice. + + - Document that lzma_block_buffer_encode(), + lzma_easy_buffer_encode(), lzma_stream_encoder(), and + lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK. + + - The return values of the _memusage() functions are now + documented better. + + * Support for multithreaded compression was added using the simplest + method, which splits the input data into blocks and compresses + them independently. Other methods will be added in the future. + The current method has room for improvement, e.g. it is possible + to reduce the memory usage. + + * Added the options --single-stream and --block-size=SIZE to xz. + + * xzdiff and xzgrep now support .lzo files if lzop is installed. + The .tzo suffix is also recognized as a shorthand for .tar.lzo. + + * Support for short 8.3 filenames under DOS was added to xz. It is + experimental and may change before it gets into a stable release. + + +5.0.8 (2014-12-21) + + * Fixed an old bug in xzgrep that affected OpenBSD and probably + a few other operating systems too. + + * Updated French and German translations. + + * Added support for detecting the amount of RAM on AmigaOS/AROS. + + * Minor build system updates. + + +5.0.7 (2014-09-20) + + * Fix regressions introduced in 5.0.6: + + - Fix building with non-GNU make. + + - Fix invalid Libs.private value in liblzma.pc which broke + static linking against liblzma if the linker flags were + taken from pkg-config. + + +5.0.6 (2014-09-14) + + * xzgrep now exits with status 0 if at least one file matched. + + * A few minor portability and build system fixes + + +5.0.5 (2013-06-30) + + * lzmadec and liblzma's lzma_alone_decoder(): Support decompressing + .lzma files that have less common settings in the headers + (dictionary size other than 2^n or 2^n + 2^(n-1), or uncompressed + size greater than 256 GiB). The limitations existed to avoid false + positives when detecting .lzma files. The lc + lp <= 4 limitation + still remains since liblzma's LZMA decoder has that limitation. + + NOTE: xz's .lzma support or liblzma's lzma_auto_decoder() are NOT + affected by this change. They still consider uncommon .lzma headers + as not being in the .lzma format. Changing this would give way too + many false positives. + + * xz: + + - Interaction of preset and custom filter chain options was + made less illogical. This affects only certain less typical + uses cases so few people are expected to notice this change. + + Now when a custom filter chain option (e.g. --lzma2) is + specified, all preset options (-0 ... -9, -e) earlier are on + the command line are completely forgotten. Similarly, when + a preset option is specified, all custom filter chain options + earlier on the command line are completely forgotten. + + Example 1: "xz -9 --lzma2=preset=5 -e" is equivalent to "xz -e" + which is equivalent to "xz -6e". Earlier -e didn't put xz back + into preset mode and thus the example command was equivalent + to "xz --lzma2=preset=5". + + Example 2: "xz -9e --lzma2=preset=5 -7" is equivalent to + "xz -7". Earlier a custom filter chain option didn't make + xz forget the -e option so the example was equivalent to + "xz -7e". + + - Fixes and improvements to error handling. + + - Various fixes to the man page. + + * xzless: Fixed to work with "less" versions 448 and later. + + * xzgrep: Made -h an alias for --no-filename. + + * Include the previously missing debug/translation.bash which can + be useful for translators. + + * Include a build script for Mac OS X. This has been in the Git + repository since 2010 but due to a mistake in Makefile.am the + script hasn't been included in a release tarball before. + + +5.0.4 (2012-06-22) + + * liblzma: + + - Fix lzma_index_init(). It could crash if memory allocation + failed. + + - Fix the possibility of an incorrect LZMA_BUF_ERROR when a BCJ + filter is used and the application only provides exactly as + much output space as is the uncompressed size of the file. + + - Fix a bug in doc/examples_old/xz_pipe_decompress.c. It didn't + check if the last call to lzma_code() really returned + LZMA_STREAM_END, which made the program think that truncated + files are valid. + + - New example programs in doc/examples (old programs are now in + doc/examples_old). These have more comments and more detailed + error handling. + + * Fix "xz -lvv foo.xz". It could crash on some corrupted files. + + * Fix output of "xz --robot -lv" and "xz --robot -lvv" which + incorrectly printed the filename also in the "foo (x/x)" format. + + * Fix exit status of "xzdiff foo.xz bar.xz". + + * Fix exit status of "xzgrep foo binary_file". + + * Fix portability to EBCDIC systems. + + * Fix a configure issue on AIX with the XL C compiler. See INSTALL + for details. + + * Update French, German, Italian, and Polish translations. + + +5.0.3 (2011-05-21) + + * liblzma fixes: + + - A memory leak was fixed. + + - lzma_stream_buffer_encode() no longer creates an empty .xz + Block if encoding an empty buffer. Such an empty Block with + LZMA2 data would trigger a bug in 5.0.1 and older (see the + first bullet point in 5.0.2 notes). When releasing 5.0.2, + I thought that no encoder creates this kind of files but + I was wrong. + + - Validate function arguments better in a few functions. Most + importantly, specifying an unsupported integrity check to + lzma_stream_buffer_encode() no longer creates a corrupt .xz + file. Probably no application tries to do that, so this + shouldn't be a big problem in practice. + + - Document that lzma_block_buffer_encode(), + lzma_easy_buffer_encode(), lzma_stream_encoder(), and + lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK. + + - The return values of the _memusage() functions are now + documented better. + + * Fix command name detection in xzgrep. xzegrep and xzfgrep now + correctly use egrep and fgrep instead of grep. + + * French translation was added. + + +5.0.2 (2011-04-01) + + * LZMA2 decompressor now correctly accepts LZMA2 streams with no + uncompressed data. Previously it considered them corrupt. The + bug can affect applications that use raw LZMA2 streams. It is + very unlikely to affect .xz files because no compressor creates + .xz files with empty LZMA2 streams. (Empty .xz files are a + different thing than empty LZMA2 streams.) + + * "xz --suffix=.foo filename.foo" now refuses to compress the + file due to it already having the suffix .foo. It was already + documented on the man page, but the code lacked the test. + + * "xzgrep -l foo bar.xz" works now. + + * Polish translation was added. + + +5.0.1 (2011-01-29) + + * xz --force now (de)compresses files that have setuid, setgid, + or sticky bit set and files that have multiple hard links. + The man page had it documented this way already, but the code + had a bug. + + * gzip and bzip2 support in xzdiff was fixed. + + * Portability fixes + + * Minor fix to Czech translation + + +5.0.0 (2010-10-23) + + Only the most important changes compared to 4.999.9beta are listed + here. One change is especially important: + + * The memory usage limit is now disabled by default. Some scripts + written before this change may have used --memory=max on xz command + line or in XZ_OPT. THESE USES OF --memory=max SHOULD BE REMOVED + NOW, because they interfere with user's ability to set the memory + usage limit himself. If user-specified limit causes problems to + your script, blame the user. + + Other significant changes: + + * Added support for XZ_DEFAULTS environment variable. This variable + allows users to set default options for xz, e.g. default memory + usage limit or default compression level. Scripts that use xz + must never set or unset XZ_DEFAULTS. Scripts should use XZ_OPT + instead if they need a way to pass options to xz via an + environment variable. + + * The compression settings associated with the preset levels + -0 ... -9 have been changed. --extreme was changed a little too. + It is now less likely to make compression worse, but with some + files the new --extreme may compress slightly worse than the old + --extreme. + + * If a preset level (-0 ... -9) is specified after a custom filter + chain options have been used (e.g. --lzma2), the custom filter + chain will be forgotten. Earlier the preset options were + completely ignored after custom filter chain options had been + seen. + + * xz will create sparse files when decompressing if the uncompressed + data contains long sequences of binary zeros. This is done even + when writing to standard output that is connected to a regular + file and certain additional conditions are met to make it safe. + + * Support for "xz --list" was added. Combine with --verbose or + --verbose --verbose (-vv) for detailed output. + + * I had hoped that liblzma API would have been stable after + 4.999.9beta, but there have been a couple of changes in the + advanced features, which don't affect most applications: + + - Index handling code was revised. If you were using the old + API, you will get a compiler error (so it's easy to notice). + + - A subtle but important change was made to the Block handling + API. lzma_block.version has to be initialized even for + lzma_block_header_decode(). Code that doesn't do it will work + for now, but might break in the future, which makes this API + change easy to miss. + + * The major soname has been bumped to 5.0.0. liblzma API and ABI + are now stable, so the need to recompile programs linking against + liblzma shouldn't arise soon. + diff --git a/PACKAGERS b/PACKAGERS new file mode 100644 index 0000000..3042c66 --- /dev/null +++ b/PACKAGERS @@ -0,0 +1,243 @@ + +Information to packagers of XZ Utils +==================================== + + 0. Preface + 1. Package naming + 2. Package description + 3. License + 4. configure options + 5. Additional documentation + 6. Extra files + 7. Installing XZ Utils and LZMA Utils in parallel + 8. Example + + +0. Preface +---------- + + This document is meant for people who create and maintain XZ Utils + packages for operating system distributions. The focus is on GNU/Linux + systems, but most things apply to other systems too. + + While the standard "configure && make DESTDIR=$PKG install" should + give a pretty good package, there are some details which packagers + may want to tweak. + + Packagers should also read the INSTALL file. + + +1. Package naming +----------------- + + The preferred name for the XZ Utils package is "xz", because that's + the name of the upstream tarball. Naturally you may have good reasons + to use some other name; I won't get angry about it. ;-) It's just nice + to be able to point people to the correct package name without asking + what distro they have. + + If your distro policy is to split things into small pieces, here is + one suggestion: + + xz xz, xzdec, scripts (xzdiff, xzgrep, etc.), docs + xz-lzma lzma, unlzma, lzcat, lzgrep etc. symlinks and + lzmadec binary for compatibility with LZMA Utils + liblzma liblzma.so.* + liblzma-devel liblzma.so, liblzma.a, API headers + liblzma-doc Doxygen-generated liblzma API docs (HTML), + example programs + + +2. Package description +---------------------- + + Here is a suggestion which you may use as the package description. + If you can use only one-line description, pick only the first line. + Naturally, feel free to use some other description if you find it + better, and maybe send it to me too. + + Library and command line tools for XZ and LZMA compressed files + + XZ Utils provide a general purpose data compression library + and command line tools. The native file format is the .xz + format, but also the legacy .lzma format is supported. The .xz + format supports multiple compression algorithms, of which LZMA2 + is currently the primary algorithm. With typical files, XZ Utils + create about 30 % smaller files than gzip. + + If you are splitting XZ Utils into multiple packages, here are some + suggestions for package descriptions: + + xz: + + Command line tools for XZ and LZMA compressed files + + This package includes the xz compression tool and other command + line tools from XZ Utils. xz has command line syntax similar to + that of gzip. The native file format is the .xz format, but also + the legacy .lzma format is supported. The .xz format supports + multiple compression algorithms, of which LZMA2 is currently the + primary algorithm. With typical files, XZ Utils create about 30 % + smaller files than gzip. + + Note that this package doesn't include the files needed for + LZMA Utils 4.32.x compatibility. Install also the xz-lzma + package to make XZ Utils emulate LZMA Utils 4.32.x. + + xz-lzma: + + LZMA Utils emulation with XZ Utils + + This package includes executables and symlinks to make + XZ Utils emulate lzma, unlzma, lzcat, and other command + line tools found from the legacy LZMA Utils 4.32.x package. + + liblzma: + + Library for XZ and LZMA compressed files + + liblzma is a general purpose data compression library with + an API similar to that of zlib. liblzma supports multiple + algorithms, of which LZMA2 is currently the primary algorithm. + The native file format is .xz, but also the legacy .lzma + format and raw streams (no headers at all) are supported. + + This package includes the shared library. + + liblzma-devel: + + Library for XZ and LZMA compressed files + + This package includes the API headers, static library, and + other development files related to liblzma. + + liblzma-doc: + + liblzma API documentation in HTML and example usage + + This package includes the Doxygen-generated liblzma API + HTML docs and example programs showing how to use liblzma. + + +3. License +---------- + + If the package manager supports a license field, you probably should + put GPLv2+ there (GNU GPL v2 or later). The interesting parts of + XZ Utils are in the public domain, but some less important files + ending up into the binary package are under GPLv2+. So it is simplest + to just say GPLv2+ if you cannot specify "public domain and GPLv2+". + + If you split XZ Utils into multiple packages as described earlier + in this file, liblzma and liblzma-dev packages will contain only + public domain code (from XZ Utils at least; compiler or linker may + add some third-party code, which may be copyrighted). + + +4. configure options +-------------------- + + Unless you are building a package for a distribution that is meant + only for embedded systems, don't use the following configure options: + + --enable-debug + --enable-encoders (*) + --enable-decoders + --enable-match-finders + --enable-checks + --enable-small (*) + --disable-threads (*) + --disable-microlzma (*) + --disable-lzip-decoder (*) + + (*) These are OK when building xzdec and lzmadec as described + in INSTALL. + + xzdec and lzmadec don't provide any functionality that isn't already + available in the xz tool. Shipping xzdec and lzmadec without size + optimization and statically-linked liblzma isn't very useful. Doing + that would give users the xzdec man page, which may make it easier + for people to find out that such tools exists, but the executables + wouldn't have any advantage over the full-featured xz. + + +5. Additional documentation +--------------------------- + + "make install" copies some additional documentation to $docdir + (--docdir in configure). There is a copy of the GNU GPL v2, which + can be replaced with a symlink if your distro ships with shared + copies of the common license texts. + + The Doxygen-generated documentation (HTML) for the liblzma API + headers is included in the source release and will be installed by + "make install" to $docdir/api. All JavaScript is removed to + simplify license compliance and to reduce the install size. If the + liblzma API documentation is not desired, either run configure with + --disable-doc or remove the doc/api directory before running + "make install". + + +6. Extra files +-------------- + + The "extra" directory contains some small extra tools or other files. + The exact set of extra files can vary between XZ Utils releases. The + extra files have only limited use or they are too dangerous to be + put directly to $bindir (7z2lzma.sh is a good example, since it can + silently create corrupt output if certain conditions are not met). + + If you feel like it, you may copy the extra directory under the doc + directory (e.g. /usr/share/doc/xz/extra). Maybe some people will find + them useful. However, most people needing these tools probably are + able to find them from the source package too. + + The "debug" directory contains some tools that are useful only when + hacking on XZ Utils. Don't package these tools. + + +7. Installing XZ Utils and LZMA Utils in parallel +------------------------------------------------- + + XZ Utils and LZMA Utils 4.32.x can be installed in parallel by + omitting the compatibility symlinks (lzma, unlzma, lzcat, lzgrep etc.) + from the XZ Utils package. It's probably a good idea to still package + the symlinks into a separate package so that users may choose if they + want to use XZ Utils or LZMA Utils for handling .lzma files. + + +8. Example +---------- + + Here is an example for i686 GNU/Linux that + - links xz and lzmainfo against shared liblzma; + - links size-optimized xzdec and lzmadec against static liblzma + while avoiding libpthread dependency; + - includes only shared liblzma in the final package; and + - copies also the "extra" directory to the package. + + PKG=/tmp/xz-pkg + tar xf xz-x.y.z.tar.gz + cd xz-x.y.z + ./configure \ + --prefix=/usr \ + --disable-static \ + --disable-xzdec \ + --disable-lzmadec \ + CFLAGS='-march=i686 -mtune=generic -O2' + make + make DESTDIR=$PKG install-strip + make clean + ./configure \ + --prefix=/usr \ + --disable-shared \ + --disable-nls \ + --disable-encoders \ + --enable-small \ + --disable-threads \ + CFLAGS='-march=i686 -mtune=generic -Os' + make -C src/liblzma + make -C src/xzdec + make -C src/xzdec DESTDIR=$PKG install-strip + cp -a extra $PKG/usr/share/doc/xz + diff --git a/README b/README new file mode 100644 index 0000000..9e76301 --- /dev/null +++ b/README @@ -0,0 +1,307 @@ + +XZ Utils +======== + + 0. Overview + 1. Documentation + 1.1. Overall documentation + 1.2. Documentation for command-line tools + 1.3. Documentation for liblzma + 2. Version numbering + 3. Reporting bugs + 4. Translations + 5. Other implementations of the .xz format + 6. Contact information + + +0. Overview +----------- + + XZ Utils provide a general-purpose data-compression library plus + command-line tools. The native file format is the .xz format, but + also the legacy .lzma format is supported. The .xz format supports + multiple compression algorithms, which are called "filters" in the + context of XZ Utils. The primary filter is currently LZMA2. With + typical files, XZ Utils create about 30 % smaller files than gzip. + + To ease adapting support for the .xz format into existing applications + and scripts, the API of liblzma is somewhat similar to the API of the + popular zlib library. For the same reason, the command-line tool xz + has a command-line syntax similar to that of gzip. + + When aiming for the highest compression ratio, the LZMA2 encoder uses + a lot of CPU time and may use, depending on the settings, even + hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder + competes with bzip2 in compression speed, RAM usage, and compression + ratio. + + LZMA2 is reasonably fast to decompress. It is a little slower than + gzip, but a lot faster than bzip2. Being fast to decompress means + that the .xz format is especially nice when the same file will be + decompressed very many times (usually on different computers), which + is the case e.g. when distributing software packages. In such + situations, it's not too bad if the compression takes some time, + since that needs to be done only once to benefit many people. + + With some file types, combining (or "chaining") LZMA2 with an + additional filter can improve the compression ratio. A filter chain may + contain up to four filters, although usually only one or two are used. + For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2 + in the filter chain can improve compression ratio of executable files. + + Since the .xz format allows adding new filter IDs, it is possible that + some day there will be a filter that is, for example, much faster to + compress than LZMA2 (but probably with worse compression ratio). + Similarly, it is possible that some day there is a filter that will + compress better than LZMA2. + + XZ Utils supports multithreaded compression. XZ Utils doesn't support + multithreaded decompression yet. It has been planned though and taken + into account when designing the .xz file format. In the future, files + that were created in threaded mode can be decompressed in threaded + mode too. + + +1. Documentation +---------------- + +1.1. Overall documentation + + README This file + + INSTALL.generic Generic install instructions for those not familiar + with packages using GNU Autotools + INSTALL Installation instructions specific to XZ Utils + PACKAGERS Information to packagers of XZ Utils + + COPYING XZ Utils copyright and license information + COPYING.GPLv2 GNU General Public License version 2 + COPYING.GPLv3 GNU General Public License version 3 + COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1 + + AUTHORS The main authors of XZ Utils + THANKS Incomplete list of people who have helped making + this software + NEWS User-visible changes between XZ Utils releases + ChangeLog Detailed list of changes (commit log) + TODO Known bugs and some sort of to-do list + + Note that only some of the above files are included in binary + packages. + + +1.2. Documentation for command-line tools + + The command-line tools are documented as man pages. In source code + releases (and possibly also in some binary packages), the man pages + are also provided in plain text (ASCII only) and PDF formats in the + directory "doc/man" to make the man pages more accessible to those + whose operating system doesn't provide an easy way to view man pages. + + +1.3. Documentation for liblzma + + The liblzma API headers include short docs about each function + and data type as Doxygen tags. These docs should be quite OK as + a quick reference. + + There are a few example/tutorial programs that should help in + getting started with liblzma. In the source package the examples + are in "doc/examples" and in binary packages they may be under + "examples" in the same directory as this README. + + Since the liblzma API has similarities to the zlib API, some people + may find it useful to read the zlib docs and tutorial too: + + https://zlib.net/manual.html + https://zlib.net/zlib_how.html + + +2. Version numbering +-------------------- + + The version number format of XZ Utils is X.Y.ZS: + + - X is the major version. When this is incremented, the library + API and ABI break. + + - Y is the minor version. It is incremented when new features + are added without breaking the existing API or ABI. An even Y + indicates a stable release and an odd Y indicates unstable + (alpha or beta version). + + - Z is the revision. This has a different meaning for stable and + unstable releases: + + * Stable: Z is incremented when bugs get fixed without adding + any new features. This is intended to be convenient for + downstream distributors that want bug fixes but don't want + any new features to minimize the risk of introducing new bugs. + + * Unstable: Z is just a counter. API or ABI of features added + in earlier unstable releases having the same X.Y may break. + + - S indicates stability of the release. It is missing from the + stable releases, where Y is an even number. When Y is odd, S + is either "alpha" or "beta" to make it very clear that such + versions are not stable releases. The same X.Y.Z combination is + not used for more than one stability level, i.e. after X.Y.Zalpha, + the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta. + + +3. Reporting bugs +----------------- + + Naturally it is easiest for me if you already know what causes the + unexpected behavior. Even better if you have a patch to propose. + However, quite often the reason for unexpected behavior is unknown, + so here are a few things to do before sending a bug report: + + 1. Try to create a small example how to reproduce the issue. + + 2. Compile XZ Utils with debugging code using configure switches + --enable-debug and, if possible, --disable-shared. If you are + using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting + binaries. + + 3. Turn on core dumps. The exact command depends on your shell; + for example in GNU bash it is done with "ulimit -c unlimited", + and in tcsh with "limit coredumpsize unlimited". + + 4. Try to reproduce the suspected bug. If you get "assertion failed" + message, be sure to include the complete message in your bug + report. If the application leaves a coredump, get a backtrace + using gdb: + $ gdb /path/to/app-binary # Load the app to the debugger. + (gdb) core core # Open the coredump. + (gdb) bt # Print the backtrace. Copy & paste to bug report. + (gdb) quit # Quit gdb. + + Report your bug via email or IRC (see Contact information below). + Don't send core dump files or any executables. If you have a small + example file(s) (total size less than 256 KiB), please include + it/them as an attachment. If you have bigger test files, put them + online somewhere and include a URL to the file(s) in the bug report. + + Always include the exact version number of XZ Utils in the bug report. + If you are using a snapshot from the git repository, use "git describe" + to get the exact snapshot version. If you are using XZ Utils shipped + in an operating system distribution, mention the distribution name, + distribution version, and exact xz package version; if you cannot + repeat the bug with the code compiled from unpatched source code, + you probably need to report a bug to your distribution's bug tracking + system. + + +4. Translations +--------------- + + The xz command line tool and all man pages can be translated. + The translations are handled via the Translation Project. If you + wish to help translating xz, please join the Translation Project: + + https://translationproject.org/html/translators.html + + Below are notes and testing instructions specific to xz + translations. + + Testing can be done by installing xz into a temporary directory: + + ./configure --disable-shared --prefix=/tmp/xz-test + # + make -C po update-po + make install + bash debug/translation.bash | less + bash debug/translation.bash | less -S # For --list outputs + + Repeat the above as needed (no need to re-run configure though). + + Note especially the following: + + - The output of --help and --long-help must look nice on + an 80-column terminal. It's OK to add extra lines if needed. + + - In contrast, don't add extra lines to error messages and such. + They are often preceded with e.g. a filename on the same line, + so you have no way to predict where to put a \n. Let the terminal + do the wrapping even if it looks ugly. Adding new lines will be + even uglier in the generic case even if it looks nice in a few + limited examples. + + - Be careful with column alignment in tables and table-like output + (--list, --list --verbose --verbose, --info-memory, --help, and + --long-help): + + * All descriptions of options in --help should start in the + same column (but it doesn't need to be the same column as + in the English messages; just be consistent if you change it). + Check that both --help and --long-help look OK, since they + share several strings. + + * --list --verbose and --info-memory print lines that have + the format "Description: %s". If you need a longer + description, you can put extra space between the colon + and %s. Then you may need to add extra space to other + strings too so that the result as a whole looks good (all + values start at the same column). + + * The columns of the actual tables in --list --verbose --verbose + should be aligned properly. Abbreviate if necessary. It might + be good to keep at least 2 or 3 spaces between column headings + and avoid spaces in the headings so that the columns stand out + better, but this is a matter of opinion. Do what you think + looks best. + + - Be careful to put a period at the end of a sentence when the + original version has it, and don't put it when the original + doesn't have it. Similarly, be careful with \n characters + at the beginning and end of the strings. + + - Read the TRANSLATORS comments that have been extracted from the + source code and included in xz.pot. Some comments suggest + testing with a specific command which needs an .xz file. You + may use e.g. any tests/files/good-*.xz. However, these test + commands are included in translations.bash output, so reading + translations.bash output carefully can be enough. + + - If you find language problems in the original English strings, + feel free to suggest improvements. Ask if something is unclear. + + - The translated messages should be understandable (sometimes this + may be a problem with the original English messages too). Don't + make a direct word-by-word translation from English especially if + the result doesn't sound good in your language. + + Thanks for your help! + + +5. Other implementations of the .xz format +------------------------------------------ + + 7-Zip and the p7zip port of 7-Zip support the .xz format starting + from the version 9.00alpha. + + https://7-zip.org/ + https://p7zip.sourceforge.net/ + + XZ Embedded is a limited implementation written for use in the Linux + kernel, but it is also suitable for other embedded use. + + https://tukaani.org/xz/embedded.html + + XZ for Java is a complete implementation written in pure Java. + + https://tukaani.org/xz/java.html + + +6. Contact information +---------------------- + + If you have questions, bug reports, patches etc. related to XZ Utils, + the project maintainers Lasse Collin and Jia Tan can be reached via + . + + You might find Lasse also from #tukaani on Libera Chat (IRC). + The nick is Larhzu. The channel tends to be pretty quiet, + so just ask your question and someone might wake up. + diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..0206af9 --- /dev/null +++ b/THANKS @@ -0,0 +1,174 @@ + +Thanks +====== + +Some people have helped more, some less, but nevertheless everyone's help +has been important. :-) In alphabetical order: + - Mark Adler + - H. Peter Anvin + - Jeff Bastian + - Nelson H. F. Beebe + - Karl Beldan + - Karl Berry + - Anders F. Björklund + - Emmanuel Blot + - Melanie Blower + - Alexander Bluhm + - Martin Blumenstingl + - Ben Boeckel + - Jakub Bogusz + - Adam Borowski + - Maarten Bosmans + - Lukas Braune + - Benjamin Buch + - Trent W. Buck + - Kevin R. Bulgrien + - James Buren + - David Burklund + - Frank Busse + - Daniel Mealha Cabrita + - Milo Casagrande + - Marek Černocký + - Tomer Chachamu + - Vitaly Chikunov + - Antoine Cœur + - Gabi Davar + - İhsan Doğan + - Chris Donawa + - Andrew Dudman + - Markus Duft + - İsmail Dönmez + - Paul Eggert + - Robert Elz + - Gilles Espinasse + - Denis Excoffier + - Vincent Fazio + - Michael Felt + - Michael Fox + - Mike Frysinger + - Daniel Richard G. + - Tomasz Gajc + - Bjarni Ingi Gislason + - John Paul Adrian Glaubitz + - Bill Glessner + - Michał Górny + - Jason Gorski + - Juan Manuel Guerrero + - Diederik de Haas + - Joachim Henke + - Christian Hesse + - Vincenzo Innocente + - Peter Ivanov + - Nicholas Jackson + - Sam James + - Hajin Jang + - Jouk Jansen + - Jun I Jin + - Kiyoshi Kanazawa + - Joona Kannisto + - Per Øyvind Karlsen + - Iouri Kharon + - Thomas Klausner + - Richard Koch + - Anton Kochkov + - Ville Koskinen + - Marcin Kowalczyk + - Jan Kratochvil + - Christian Kujau + - Stephan Kulow + - Ilya Kurdyukov + - Peter Lawler + - James M Leddy + - Vincent Lefevre + - Hin-Tak Leung + - Andraž 'ruskie' Levstik + - Cary Lewis + - Wim Lewis + - Xin Li + - Eric Lindblad + - Lorenzo De Liso + - H.J. Lu + - Bela Lubkin + - Gregory Margo + - Julien Marrec + - Ed Maste + - Martin Matuška + - Ivan A. Melnikov + - Jim Meyering + - Arkadiusz Miskiewicz + - Nathan Moinvaziri + - Étienne Mollier + - Conley Moorhous + - Rafał Mużyło + - Adrien Nader + - Evan Nemerson + - Hongbo Ni + - Jonathan Nieder + - Andre Noll + - Peter O'Gorman + - Dimitri Papadopoulos Orfanos + - Daniel Packard + - Filip Palian + - Peter Pallinger + - Rui Paulo + - Igor Pavlov + - Diego Elio Pettenò + - Elbert Pol + - Mikko Pouru + - Rich Prohaska + - Trần Ngọc Quân + - Pavel Raiskup + - Ole André Vadla Ravnås + - Eric S. Raymond + - Robert Readman + - Bernhard Reutner-Fischer + - Markus Rickert + - Cristian Rodríguez + - Christian von Roques + - Boud Roukema + - Torsten Rupp + - Stephen Sachs + - Jukka Salmi + - Agostino Sarubbo + - Alexandre Sauvé + - Benno Schulenberg + - Andreas Schwab + - Bhargava Shastry + - Dan Shechter + - Stuart Shelton + - Sebastian Andrzej Siewior + - Ville Skyttä + - Brad Smith + - Bruce Stark + - Pippijn van Steenhoven + - Martin Storsjö + - Jonathan Stott + - Dan Stromberg + - Jia Tan + - Vincent Torri + - Paul Townsend + - Mohammed Adnène Trojette + - Alexey Tourbin + - Taiki Tsunekawa + - Loganaden Velvindron + - Patrick J. Volkerding + - Martin Väth + - Adam Walling + - Jeffrey Walton + - Christian Weisgerber + - Dan Weiss + - Bert Wesarg + - Fredrik Wikstrom + - Jim Wilcoxson + - Ralf Wildenhues + - Charles Wilson + - Lars Wirzenius + - Pilorz Wojciech + - Ryan Young + - Andreas Zieringer + +Also thanks to all the people who have participated in the Tukaani project. + +I have probably forgot to add some names to the above list. Sorry about +that and thanks for your help. + diff --git a/TODO b/TODO new file mode 100644 index 0000000..7b9a3ad --- /dev/null +++ b/TODO @@ -0,0 +1,109 @@ + +XZ Utils To-Do List +=================== + +Known bugs +---------- + + The test suite is too incomplete. + + If the memory usage limit is less than about 13 MiB, xz is unable to + automatically scale down the compression settings enough even though + it would be possible by switching from BT2/BT3/BT4 match finder to + HC3/HC4. + + XZ Utils compress some files significantly worse than LZMA Utils. + This is due to faster compression presets used by XZ Utils, and + can often be worked around by using "xz --extreme". With some files + --extreme isn't enough though: it's most likely with files that + compress extremely well, so going from compression ratio of 0.003 + to 0.004 means big relative increase in the compressed file size. + + xz doesn't quote unprintable characters when it displays file names + given on the command line. + + tuklib_exit() doesn't block signals => EINTR is possible. + + SIGTSTP is not handled. If xz is stopped, the estimated remaining + time and calculated (de)compression speed won't make sense in the + progress indicator (xz --verbose). + + If liblzma has created threads and fork() gets called, liblzma + code will break in the child process unless it calls exec() and + doesn't touch liblzma. + + +Missing features +---------------- + + Add support for storing metadata in .xz files. A preliminary + idea is to create a new Stream type for metadata. When both + metadata and data are wanted in the same .xz file, two or more + Streams would be concatenated. + + The state stored in lzma_stream should be cloneable, which would + be mostly useful when using a preset dictionary in LZMA2, but + it may have other uses too. Compare to deflateCopy() in zlib. + + Support LZMA_FINISH in raw decoder to indicate end of LZMA1 and + other streams that don't have an end of payload marker. + + Adjust dictionary size when the input file size is known. + Maybe do this only if an option is given. + + xz doesn't support copying extended attributes, access control + lists etc. from source to target file. + + Multithreaded compression: + - Reduce memory usage of the current method. + - Implement threaded match finders. + - Implement pigz-style threading in LZMA2. + + Buffer-to-buffer coding could use less RAM (especially when + decompressing LZMA1 or LZMA2). + + I/O library is not implemented (similar to gzopen() in zlib). + It will be a separate library that supports uncompressed, .gz, + .bz2, .lzma, and .xz files. + + Support changing lzma_options_lzma.mode with lzma_filters_update(). + + Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at + Block and Stream boundaries. + + lzma_strerror() to convert lzma_ret to human readable form? + This is tricky, because the same error codes are used with + slightly different meanings, and this cannot be fixed anymore. + + Make it possible to adjust LZMA2 options in the middle of a Block + so that the encoding speed vs. compression ratio can be optimized + when the compressed data is streamed over network. + + Improved BCJ filters. The current filters are small but they aren't + so great when compressing binary packages that contain various file + types. Specifically, they make things worse if there are static + libraries or Linux kernel modules. The filtering could also be + more effective (without getting overly complex), for example, + streamable variant BCJ2 from 7-Zip could be implemented. + + Filter that autodetects specific data types in the input stream + and applies appropriate filters for the corrects parts of the input. + Perhaps combine this with the BCJ filter improvement point above. + + Long-range LZ77 method as a separate filter or as a new LZMA2 + match finder. + + +Documentation +------------- + + More tutorial programs are needed for liblzma. + + Document the LZMA1 and LZMA2 algorithms. + + +Miscellaneous +------------ + + Try to get the media type for .xz registered at IANA. + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..6d41ec8 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1196 @@ +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- + +# Copyright (C) 1996-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. +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-2021 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.16' +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.16.5], [], + [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 AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.5])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001-2021 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_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2021 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], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2021 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_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$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 +m4_define([_AM_COND_VALUE_$1], [$2])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-2021 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. + + +# 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", "OBJC", "OBJCXX", "UPC", or "GJC". +# 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 + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" 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". + rm -rf conftest.dir + 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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + 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 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2021 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_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _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. +# This creates each '.Po' and '.Plo' makefile fragment that we'll 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" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2021 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. + +# 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. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# 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.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])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], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +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_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [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]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). 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])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# 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-2021 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 +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2021 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. + +# 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 -*- + +# Copyright (C) 2001-2021 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_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2021 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_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2021 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_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2021 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_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2021 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_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2021 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_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # 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". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2021 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_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2021 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_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2021 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_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2021 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_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/ax_check_capsicum.m4]) +m4_include([m4/ax_pthread.m4]) +m4_include([m4/getopt.m4]) +m4_include([m4/gettext.m4]) +m4_include([m4/host-cpu-c-abi.m4]) +m4_include([m4/iconv.m4]) +m4_include([m4/intlmacosx.m4]) +m4_include([m4/lib-ld.m4]) +m4_include([m4/lib-link.m4]) +m4_include([m4/lib-prefix.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([m4/nls.m4]) +m4_include([m4/po.m4]) +m4_include([m4/posix-shell.m4]) +m4_include([m4/progtest.m4]) +m4_include([m4/tuklib_common.m4]) +m4_include([m4/tuklib_cpucores.m4]) +m4_include([m4/tuklib_integer.m4]) +m4_include([m4/tuklib_mbstr.m4]) +m4_include([m4/tuklib_physmem.m4]) +m4_include([m4/tuklib_progname.m4]) +m4_include([m4/visibility.m4]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..d5cec1b --- /dev/null +++ b/autogen.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +############################################################################### +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +set -e -x + +# The following six lines are almost identical to "autoreconf -fi" but faster. +${AUTOPOINT:-autopoint} -f +${LIBTOOLIZE:-libtoolize} -c -f || glibtoolize -c -f +${ACLOCAL:-aclocal} -I m4 +${AUTOCONF:-autoconf} +${AUTOHEADER:-autoheader} +${AUTOMAKE:-automake} -acf --foreign + +# Generate the translated man pages and the doxygen documentation if the +# "po4a" and "doxygen" tools are available. +# This is *NOT* done by "autoreconf -fi" or when "make" is run. +# Pass --no-po4a or --no-doxygen to this script to skip these steps. +# It can be useful when you know that po4a or doxygen aren't available and +# don't want autogen.sh to exit with non-zero exit status. +generate_po4a="y" +generate_doxygen="y" + +for arg in "$@" +do + case $arg in + "--no-po4a") + generate_po4a="n" + ;; + + "--no-doxygen") + generate_doxygen="n" + ;; + esac +done + +if test "$generate_po4a" != "n"; then + cd po4a + sh update-po + cd .. +fi + +if test "$generate_doxygen" != "n"; then + cd doxygen + sh update-doxygen + cd .. +fi + +exit 0 diff --git a/build-aux/compile b/build-aux/compile new file mode 100755 index 0000000..df363c8 --- /dev/null +++ b/build-aux/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# 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 or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + 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'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +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 . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +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 's|^.*[\\/]||; s|^[a-zA-Z]:||; 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 + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/config.guess b/build-aux/config.guess new file mode 100755 index 0000000..7f76b62 --- /dev/null +++ b/build-aux/config.guess @@ -0,0 +1,1754 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2022 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' + +# 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 3 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, see . +# +# 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 Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -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 ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2022 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 ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # 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 + +# Just in case it came from the environment. +GUESS= + +# 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. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + 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 ; 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 + +case $UNAME_SYSTEM in +Linux|GNU|GNU/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif + EOF + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +esac + +# 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 tuples: *-*-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". + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-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) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + 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 + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + 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/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + GUESS=$machine-${os}${release}${abi-} + ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; + *:ekkoBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; + *:SolidBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; + macppc:MirBSD:*:*) + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; + *:MirBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; + alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # 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 Pn.n version is a patched version. + # 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. + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; + Amiga*:UNIX_System_V:4.0:*) + GUESS=m68k-unknown-sysv4 + ;; + *:[Aa]miga[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; + *:[Mm]orph[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-morphos + ;; + *:OS/390:*:*) + GUESS=i370-ibm-openedition + ;; + *:z/VM:*:*) + GUESS=s390-ibm-zvmoe + ;; + *:OS400:*:*) + GUESS=powerpc-ibm-os400 + ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + GUESS=arm-unknown-riscos + ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + GUESS=hppa1.1-hitachi-hiuxmpp + ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; + NILE*:*:*:dcosx) + GUESS=pyramid-pyramid-svr4 + ;; + DRS?6000:unix:4.0:6*) + GUESS=sparc-icl-nx6 + ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; + s390x:SunOS:*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; + sun4H:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; + 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. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; + 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'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; + sun3*:SunOS:*:*) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + 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) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun4) + GUESS=sparc-sun-sunos$UNAME_RELEASE + ;; + esac + ;; + aushp:SunOS:*:*) + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; + # 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:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; + m68k:machten:*:*) + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; + powerpc:machten:*:*) + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; + RISC*:Mach:*:*) + GUESS=mips-dec-mach_bsd4.3 + ;; + RISC*:ULTRIX:*:*) + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; + VAX*:ULTRIX*:*:*) + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* 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" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; + Motorola:PowerMAX_OS:*:*) + GUESS=powerpc-motorola-powermax + ;; + Motorola:*:4.3:PL8-*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:Power_UNIX:*:*) + GUESS=powerpc-harris-powerunix + ;; + m88k:CX/UX:7*:*) + GUESS=m88k-harris-cxux7 + ;; + m88k:*:4*:R4*) + GUESS=m88k-motorola-sysv4 + ;; + m88k:*:3*:R3*) + GUESS=m88k-motorola-sysv3 + ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x + then + GUESS=m88k-dg-dgux$UNAME_RELEASE + else + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE + fi + else + GUESS=i586-dg-dgux$UNAME_RELEASE + fi + ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + GUESS=m88k-dolphin-sysv3 + ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + GUESS=m88k-motorola-sysv3 + ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + GUESS=m88k-tektronix-sysv3 + ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + GUESS=m68k-tektronix-bsd + ;; + *:IRIX*:*:*) + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + GUESS=i386-ibm-aix + ;; + ia64:AIX:*:*) + if test -x /usr/bin/oslevel ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + GUESS=$SYSTEM_NAME + else + GUESS=rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + GUESS=rs6000-ibm-aix3.2.4 + else + GUESS=rs6000-ibm-aix3.2 + fi + ;; + *:AIX:*:[4567]) + 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 test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; + *:AIX:*:*) + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + GUESS=rs6000-bull-bosx + ;; + DPX/2?00:B.O.S.:*:*) + GUESS=m68k-bull-sysv3 + ;; + 9000/[34]??:4.3bsd:1.*:*) + GUESS=m68k-hp-bsd + ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + GUESS=m68k-hp-bsd4.4 + ;; + 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 test -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 test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + 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 test "$HP_ARCH" = hppa2.0w + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + 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" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; + 9000/8??:4.3bsd:*:*) + GUESS=hppa1.0-hp-bsd + ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; + hp8??:OSF1:*:*) + GUESS=hppa1.0-hp-osf + ;; + i*86:OSF1:*:*) + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk + else + GUESS=$UNAME_MACHINE-unknown-osf1 + fi + ;; + parisc*:Lites*:*:*) + GUESS=hppa1.1-hp-lites + ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + GUESS=c1-convex-bsd + ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + GUESS=c34-convex-bsd + ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + GUESS=c38-convex-bsd + ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + GUESS=c4-convex-bsd + ;; + CRAY*Y-MP:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; + 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 ;; + CRAY*TS:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; + CRAY*T3E:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; + CRAY*SV1:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; + *:UNICOS/mp:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; + 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/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; + sparc*:BSD/OS:*:*) + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; + *:BSD/OS:*:*) + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case $UNAME_PROCESSOR in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; + i*:CYGWIN*:*) + GUESS=$UNAME_MACHINE-pc-cygwin + ;; + *:MINGW64*:*) + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; + *:MINGW*:*) + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; + *:MSYS*:*) + GUESS=$UNAME_MACHINE-pc-msys + ;; + i*:PW*:*) + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; + *:Interix*:*) + case $UNAME_MACHINE in + x86) + GUESS=i586-pc-interix$UNAME_RELEASE + ;; + authenticamd | genuineintel | EM64T) + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; + IA64) + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; + esac ;; + i*:UWIN*:*) + GUESS=$UNAME_MACHINE-pc-uwin + ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + GUESS=x86_64-pc-cygwin + ;; + prep*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; + *:GNU:*:*) + # the GNU system + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; + aarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` 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 -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi + else + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf + fi + fi + ;; + avr32*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + cris:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + crisv32:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + frv:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + hexagon:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:Linux:*:*) + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; + ia64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m32r*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m68*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + openrisc*:Linux:*:*) + GUESS=or1k-unknown-linux-$LIBC + ;; + or32:Linux:*:* | or1k*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + padre:Linux:*:*) + GUESS=sparc-unknown-linux-$LIBC + ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + GUESS=hppa64-unknown-linux-$LIBC + ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; + esac + ;; + ppc64:Linux:*:*) + GUESS=powerpc64-unknown-linux-$LIBC + ;; + ppc:Linux:*:*) + GUESS=powerpc-unknown-linux-$LIBC + ;; + ppc64le:Linux:*:*) + GUESS=powerpc64le-unknown-linux-$LIBC + ;; + ppcle:Linux:*:*) + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + s390:Linux:*:* | s390x:Linux:*:*) + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; + sh64*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sh*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + tile*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + vax:Linux:*:*) + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; + x86_64:Linux:*:*) + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; + xtensa*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + 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. + GUESS=i386-sequent-sysv4 + ;; + 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. + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; + i*86:XTS-300:*:STOP) + GUESS=$UNAME_MACHINE-unknown-stop + ;; + i*86:atheos:*:*) + GUESS=$UNAME_MACHINE-unknown-atheos + ;; + i*86:syllable:*:*) + GUESS=$UNAME_MACHINE-pc-syllable + ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; + i*86:*DOS:*:*) + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL + fi + ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /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 + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv32 + fi + ;; + 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 i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + GUESS=i586-pc-msdosdjgpp + ;; + Intel:Mach:3*:*) + GUESS=i386-pc-mach3 + ;; + paragon:*:*:*) + GUESS=i860-intel-osf1 + ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 + fi + ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + GUESS=m68010-convergent-sysv + ;; + mc68k:UNIX:SYSTEM5:3.51m) + GUESS=m68k-convergent-sysv + ;; + M680?0:D-NIX:5.3:*) + GUESS=m68k-diab-dnix + ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*: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 | S7501*:*: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; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + 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; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; + mc68030:UNIX_System_V:4.*:*) + GUESS=m68k-atari-sysv4 + ;; + TSUNAMI:LynxOS:2.*:*) + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; + rs6000:LynxOS:2.*:*) + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; + SM[BE]S:UNIX_SV:*:*) + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; + RM*:ReliantUNIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + RM*:SINIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 + else + GUESS=ns32k-sni-sysv + fi + ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + GUESS=i586-unisys-sysv4 + ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + GUESS=hppa1.1-stratus-sysv4 + ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + GUESS=i860-stratus-sysv4 + ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=$UNAME_MACHINE-stratus-vos + ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=hppa1.1-stratus-vos + ;; + mc68*:A/UX:*:*) + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; + news*:NEWS-OS:6*:*) + GUESS=mips-sony-newsos6 + ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE + else + GUESS=mips-unknown-sysv$UNAME_RELEASE + fi + ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + GUESS=powerpc-be-beos + ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + GUESS=powerpc-apple-beos + ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + GUESS=i586-pc-beos + ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + GUESS=i586-pc-haiku + ;; + x86_64:Haiku:*:*) + GUESS=x86_64-unknown-haiku + ;; + SX-4:SUPER-UX:*:*) + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; + SX-5:SUPER-UX:*:*) + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; + SX-6:SUPER-UX:*:*) + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; + SX-7:SUPER-UX:*:*) + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; + SX-8:SUPER-UX:*:*) + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; + SX-8R:SUPER-UX:*:*) + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; + Power*:Rhapsody:*:*) + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; + *:Rhapsody:*:*) + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; + *:QNX:*:4*) + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; + NSE-*:NONSTOP_KERNEL:*:*) + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; + *:NonStop-UX:*:*) + GUESS=mips-compaq-nonstopux + ;; + BS2000:POSIX*:*:*) + GUESS=bs2000-siemens-sysv + ;; + DS/*:UNIX_System_V:*:*) + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; + *: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 + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype + fi + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; + *:TOPS-10:*:*) + GUESS=pdp10-unknown-tops10 + ;; + *:TENEX:*:*) + GUESS=pdp10-unknown-tenex + ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + GUESS=pdp10-dec-tops20 + ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + GUESS=pdp10-xkl-tops20 + ;; + *:TOPS-20:*:*) + GUESS=pdp10-unknown-tops20 + ;; + *:ITS:*:*) + GUESS=pdp10-unknown-its + ;; + SEI:*:*:SEIUX) + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; + *:DragonFly:*:*) + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; + esac ;; + *:XENIX:*:SysV) + GUESS=i386-pc-xenix + ;; + i*86:skyos:*:*) + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; + i*86:rdos:*:*) + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; + x86_64:VMkernel:*:*) + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#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 + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#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 +#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 +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#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 && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&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 +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-aux/config.rpath b/build-aux/config.rpath new file mode 100755 index 0000000..1e1ab67 --- /dev/null +++ b/build-aux/config.rpath @@ -0,0 +1,684 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2022 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally 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. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + ;; + *nto* | *qnx*) + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + 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++. + 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=yes +if test "$with_gnu_ld" = yes; then + # 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. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + haiku*) + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + 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 + 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 + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + 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 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + ;; + 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. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then + : + else + ld_shlibs=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd2.[01]*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly* | midnightbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' + ;; + freebsd* | dragonfly* | midnightbsd*) + library_names_spec='$libname$shrext' + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + haiku*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + *nto* | *qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + tpf*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. +# +# 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 Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# 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. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub + +# 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. + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -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 ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2021 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 ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + 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 + +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | 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 | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # 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) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if test x$basic_os != x +then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) + vendor=acorn + ;; + *-sunos*) + vendor=sun + ;; + *-cnk* | *-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 + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) + vendor=sequent + ;; + *-tpf*) + vendor=ibm + ;; + *-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 + ;; +esac + +echo "$cpu-$vendor-${kernel:+$kernel-}$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-aux/depcomp b/build-aux/depcomp new file mode 100755 index 0000000..715e343 --- /dev/null +++ b/build-aux/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2021 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, see . + +# 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 . + +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 outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +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" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# 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 + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +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 -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## 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). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - 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 -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # 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. +## 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. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -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 -ne 0; then + 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 ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # 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 + ;; + +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. + set_dir_from "$object" + set_base_from "$object" + 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 -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + 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. + set_dir_from "$object" + set_base_from "$object" + 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 -ne 0; then + 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,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_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. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool 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$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # 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 + ;; + +#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 "X$1" != 'X--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|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | 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 "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + 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. + -arch) + eat=yes ;; + -*|$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" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | 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 "X$1" != 'X--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. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # 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 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/install-sh b/build-aux/install-sh new file mode 100755 index 0000000..ec298b5 --- /dev/null +++ b/build-aux/install-sh @@ -0,0 +1,541 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2020-11-14.01; # UTC + +# 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. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# 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_mkdir= + +# Desired mode of installed file. +mode=0755 + +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +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 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. + -p pass -p to $cpprog. + -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. + -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 + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ +" + +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 + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -p) cpprog="$cpprog -p";; + + -s) stripcmd=$stripprog;; + + -S) backupsuffix="$2" + shift;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +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 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + 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 + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 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 problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi + 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 + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # 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 + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/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-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # 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 + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && 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=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_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 && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $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` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + + # 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 "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd "$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 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh new file mode 100644 index 0000000..5506693 --- /dev/null +++ b/build-aux/ltmain.sh @@ -0,0 +1,11437 @@ +#! /usr/bin/env sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2019-02-19.15 + +# libtool (GNU libtool) 2.4.7.4-1ec8f-dirty +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2019, 2021-2022 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 this program. If not, see . + + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.7.4-1ec8f-dirty +package_revision=2.4.7.4 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # 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 +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +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 + + +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >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 + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# 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. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_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 '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +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. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# 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. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# 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" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_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 "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || 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_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () +{ + $debug_cmd + + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS + ;; + *) ;; + esac + break + done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution 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_portable_result=\"$func_quote_portable_result\" + ;; + esac +} + + +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi + + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; + esac + + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result + ;; + esac +} + + +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# 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). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet 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 () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet 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 () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# Copyright'. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug in processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# in the main code. A hook is just a list of function names that can be +# run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It's assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook functions." ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi + done +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: +# args_changed=: +# ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# args_changed=: +# ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; +# esac +# done +# +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll also need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + _G_options_quoted=false + + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done + + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + func_propagate_result func_run_hooks func_options_prep +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + _G_parse_options_requote=false + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" >&2 + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) _G_parse_options_requote=: ; break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; + esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi + done + + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs=" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk + } + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt + } + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.7.4-1ec8f-dirty' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --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 + --no-warnings equivalent to '-Wnone' + --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 more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$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. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +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) + version: $progname (GNU libtool) 2.4.7.4-1ec8f-dirty + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "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 yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; 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 +} + + +# 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 +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + _G_rc_lt_options_prep=: + + # 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 + ;; + *) + _G_rc_lt_options_prep=false + ;; + esac + + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + _G_rc_lt_parse_options=false + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_match_lt_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + 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 $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; + esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: + done + + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# 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= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# 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 | func_generated_by_libtool_p +} + +# 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 yes = "$lalib_p" +} + +# 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 () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# 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_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# 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 () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + 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 () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$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 () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # 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_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # 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 + 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 yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# 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. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # 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_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # 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_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # 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) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append 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_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append 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_append_quoted base_compile "$lastarg" + 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 | *.go | *.obj | *.sx | *.cu | *.cup) + 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 yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot 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_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_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 yes = "$build_old_libs"; 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 no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; 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 yes = "$need_locks"; 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 warn = "$need_locks"; 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 + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; 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 + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + 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 yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + 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 no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_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 build PIC objects only + -prefer-non-pic try to build 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 + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler + +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-dir 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 + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -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 + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -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 + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +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 '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # 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 $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # 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 + func_append 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 + -* | *.la | *.lo ) ;; + *) + # 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_append_quoted args "$file" + done + + if $opt_dry_run; then + # 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 + else + 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 + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + 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" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + 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 "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_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_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" + if test -n "$arg2"; then + func_quote_arg pretty "$arg2" + fi + func_append install_shared_prog " $func_quote_arg_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 -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" + fi + fi + + 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=: + if $isdir; 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. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # 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 "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -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 "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "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_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + 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" && func_append 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 yes = "$build_old_libs"; 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=: + 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 "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_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 "$file$stripped_ext" | $SED "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_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_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 install = "$opt_mode" && 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 () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; 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 "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $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 + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + 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 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 + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + 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" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append 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" "${nlist}I"' + + # 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 "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + 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 "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# 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. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + 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 + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + 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_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + 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 () +{ + $debug_cmd + + 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` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + 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 "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $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 | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# 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 where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $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. +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 + file=\"\$0\"" + + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=$qECHO + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_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 \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; 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" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${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\ +" +} + + +# 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 < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#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 + +/* path handling portability macros */ +#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 */ + +#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 (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +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_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +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_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 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; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + 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]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + 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 = (size_t) (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 (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + 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 (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + 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) + { + lt_debugprintf (__FILE__, __LINE__, + "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 + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "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 (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t 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) + { + size_t orig_value_len = strlen (orig_value); + size_t 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; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + 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 + # what 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 that 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 + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + 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 yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && 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_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_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 + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append 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 "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append 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 none = "$pic_object" && + test none = "$non_pic_object"; 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 none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append 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 dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; 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 none = "$pic_object"; 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 + ;; + os2dllname) + os2dllname=$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 rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append 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 + ;; + + -bindir) + prev=bindir + 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-export-symbols = "X$arg"; 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" + if test -z "$func_stripname_result"; 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 + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # 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 "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # 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-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + 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|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + 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 + ;; + + -os2dllname) + prev=os2dllname + 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_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append 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_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_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_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xassembler) + prev=xassembler + continue + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -Wa,* Pass flags directly to the assembler + # -Werror, -Werror=* Report (specified) warnings as errors + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*|-Werror|-Werror=*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + ;; + + *.$objext) + # A standard object. + func_append 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 none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append 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 dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; 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 none = "$pic_object"; 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. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + 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_arg pretty "$arg" + arg=$func_quote_arg_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 yes = "$export_dynamic" && 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 \"\$$shlibpath_var\" \| \$SED \'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\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # 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_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; 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 "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append 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=false + 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 lib,link = "$linkmode,$pass"; 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 lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; 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 .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; 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=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + 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." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # 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 "$inherited_linker_flags" | $SED '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 "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; 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. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + 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 dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + 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. + func_append dlprefiles " $lib $dependency_libs" + else + func_append 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 yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && 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 + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append 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 dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append 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" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append 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" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; 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_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + 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:"*) ;; + *) func_append 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 "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + 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 built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append 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 yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; 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 lib = "$linkmode" && + test yes = "$hardcode_into_libs"; 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 "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append 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* | *os2*) + 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 prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; 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 cannot + # 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 no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; 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 yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; 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 + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; 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 "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + 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 + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append 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 link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # 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 "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=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 "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # 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 + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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 + func_append 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 no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; 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 pass_all != "$deplibs_check_method"; 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!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; 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 + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|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" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf | midnightbsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; 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 0 -ne "$loop"; 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) # correct to gnu/linux during the next big refactor + 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 0 -ne "$loop"; 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. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + 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 no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; 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 -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 "*) ;; + *) func_append 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 "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) + # 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 yes = "$build_libtool_need_lc"; then + func_append 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 </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + 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 "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append 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. + func_append 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 yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append 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 \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append 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. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; 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 + ;; + esac + ;; + 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 " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED '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 "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append 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 yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + 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"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append 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 "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append 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 relink = "$opt_mode" || 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 + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$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 + func_append 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 + func_dll_def_p "$export_symbols" || { + # 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 + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || 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 cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + 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 : != "$skipped_export"; 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && 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 + func_append 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 "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + 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 + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; 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 yes = "$module" && 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 : != "$skipped_export" && + 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 + func_basename "$output" + output_la=$func_basename_result + + # 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 : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + 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 -z "$objlist" || + 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 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$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~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + 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 + } + + 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_quiet || { + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; 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 + + ${skipped_export-false} && { + 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 "$include_expsyms" | $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 + func_append 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 + } + + 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 yes = "$module" && 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 + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; 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 relink = "$opt_mode"; 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 yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + 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 + + test yes = "$build_libtool_libs" || { + 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 + } + + if test -n "$pic_flag" || test default != "$pic_mode"; 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" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && 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 " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED '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 CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED '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 "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append 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 "*) ;; + *) func_append 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"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append 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;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append 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"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append 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 yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED '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=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # 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 + } + + 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 + func_append 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 + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; 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 "$link_command" | $SED '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 $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # 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" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED '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 $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # 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_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" + fi + done + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result + 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 + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; 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 + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append 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 + func_append 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" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + 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 + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + 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 -z "$oldobjs"; 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 yes = "$build_old_libs" && 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_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; 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 + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append 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" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append 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" + func_append newdlprefiles " ${lt_sysroot:+=}$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 + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $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 cannot 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 no,yes = "$installed,$need_relink"; 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 +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + 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) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + 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 $rmforce; 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 + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || 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 none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; 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 + func_append 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 + func_append 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 + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # 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 +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_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 +# where 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: diff --git a/build-aux/manconv.sh b/build-aux/manconv.sh new file mode 100644 index 0000000..73e8e3b --- /dev/null +++ b/build-aux/manconv.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# +############################################################################### +# +# Wrapper for GNU groff to convert man pages to a few formats +# +# Usage: manconv.sh FORMAT [PAPER_SIZE] < in.1 > out.suffix +# +# FORMAT can be ascii, utf8, ps, or pdf. PAPER_SIZE can be anything that +# groff accepts, e.g. a4 or letter. See groff_font(5). PAPER_SIZE defaults +# to a4 and is used only when FORMAT is ps (PostScript) or pdf. +# +# Multiple man pages can be given at once e.g. to create a single PDF file +# with continuous page numbering. +# +############################################################################### +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +FORMAT=$1 +PAPER=${2-a4} + +# Make PostScript and PDF output more readable: +# - Use 11 pt font instead of the default 10 pt. +# - Use larger paragraph spacing than the default 0.4v (man(7) only). +FONT=11 +PD=0.8 + +SED_PD=" +/^\\.TH /s/\$/\\ +.PD $PD/ +s/^\\.PD\$/.PD $PD/" + +case $FORMAT in + ascii) + groff -t -mandoc -Tascii -P-c | col -bx + ;; + utf8) + groff -t -mandoc -Tutf8 -P-c | col -bx + ;; + ps) + sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \ + -rC1 -rS$FONT -Tps -P-p$PAPER + ;; + pdf) + sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \ + -rC1 -rS$FONT -Tps -P-p$PAPER | ps2pdf - - + ;; + *) + echo 'Invalid arguments' >&2 + exit 1 + ;; +esac diff --git a/build-aux/missing b/build-aux/missing new file mode 100755 index 0000000..1fe1611 --- /dev/null +++ b/build-aux/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 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, see . + +# 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 + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + 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 + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/test-driver b/build-aux/test-driver new file mode 100755 index 0000000..be73b80 --- /dev/null +++ b/build-aux/test-driver @@ -0,0 +1,153 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 2011-2021 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, see . + +# 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 or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <"$log_file" +"$@" >>"$log_file" 2>&1 +estatus=$? + +if test $enable_hard_errors = no && test $estatus -eq 99; then + tweaked_estatus=1 +else + tweaked_estatus=$estatus +fi + +case $tweaked_estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>"$log_file" + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/version.sh b/build-aux/version.sh new file mode 100644 index 0000000..f9fcda7 --- /dev/null +++ b/build-aux/version.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +############################################################################# +# +# Get the version string from version.h and print it out without +# trailing newline. This makes it suitable for use in configure.ac. +# +############################################################################# +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################# + +sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/ + s/LZMA_VERSION_STABILITY_BETA/beta/ + s/LZMA_VERSION_STABILITY_STABLE// + s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \ + src/liblzma/api/lzma/version.h \ + | tr '\n' '|' \ + | sed 's/|/./; s/|/./; s/|//g' \ + | tr -d '\r\n' diff --git a/cmake/remove-ordinals.cmake b/cmake/remove-ordinals.cmake new file mode 100644 index 0000000..96419d5 --- /dev/null +++ b/cmake/remove-ordinals.cmake @@ -0,0 +1,26 @@ +############################################################################# +# +# remove-ordinals.cmake +# +# Removes the ordinal numbers from a DEF file that has been created by +# GNU ld or LLVM lld option --output-def (when creating a Windows DLL). +# This should be equivalent: sed 's/ \+@ *[0-9]\+//' +# +# Usage: +# +# cmake -DINPUT_FILE=infile.def.in \ +# -DOUTPUT_FILE=outfile.def \ +# -P remove-ordinals.cmake +# +############################################################################# +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################# + +file(READ "${INPUT_FILE}" STR) +string(REGEX REPLACE " +@ *[0-9]+" "" STR "${STR}") +file(WRITE "${OUTPUT_FILE}" "${STR}") diff --git a/cmake/tuklib_common.cmake b/cmake/tuklib_common.cmake new file mode 100644 index 0000000..088a3cb --- /dev/null +++ b/cmake/tuklib_common.cmake @@ -0,0 +1,49 @@ +# +# tuklib_common.cmake - common functions and macros for tuklib_*.cmake files +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +function(tuklib_add_definitions TARGET_OR_ALL DEFINITIONS) + # DEFINITIONS may be an empty string/list but it's fine here. There is + # no need to quote ${DEFINITIONS} as empty arguments are fine here. + if(TARGET_OR_ALL STREQUAL "ALL") + add_compile_definitions(${DEFINITIONS}) + else() + target_compile_definitions("${TARGET_OR_ALL}" PRIVATE ${DEFINITIONS}) + endif() +endfunction() + +function(tuklib_add_definition_if TARGET_OR_ALL VAR) + if(${VAR}) + tuklib_add_definitions("${TARGET_OR_ALL}" "${VAR}") + endif() +endfunction() + +# This is an over-simplified version of AC_USE_SYSTEM_EXTENSIONS in Autoconf +# or gl_USE_SYSTEM_EXTENSIONS in gnulib. +macro(tuklib_use_system_extensions TARGET_OR_ALL) + if(NOT WIN32) + # FIXME? The Solaris-specific __EXTENSIONS__ should be conditional + # even on Solaris. See gnulib: git log m4/extensions.m4. + # FIXME? gnulib and autoconf.git has lots of new stuff. + tuklib_add_definitions("${TARGET_OR_ALL}" + _GNU_SOURCE + __EXTENSIONS__ + _POSIX_PTHREAD_SEMANTICS + _TANDEM_SOURCE + _ALL_SOURCE + ) + + list(APPEND CMAKE_REQUIRED_DEFINITIONS + -D_GNU_SOURCE + -D__EXTENSIONS__ + -D_POSIX_PTHREAD_SEMANTICS + -D_TANDEM_SOURCE + -D_ALL_SOURCE + ) + endif() +endmacro() diff --git a/cmake/tuklib_cpucores.cmake b/cmake/tuklib_cpucores.cmake new file mode 100644 index 0000000..ea16e42 --- /dev/null +++ b/cmake/tuklib_cpucores.cmake @@ -0,0 +1,180 @@ +# +# tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake") +include(CheckCSourceCompiles) +include(CheckIncludeFile) + +function(tuklib_cpucores_internal_check) + if(WIN32 OR CYGWIN) + # Nothing to do, the tuklib_cpucores.c handles it. + set(TUKLIB_CPUCORES_DEFINITIONS "" CACHE INTERNAL "") + return() + endif() + + # glibc-based systems (GNU/Linux and GNU/kFreeBSD) have + # sched_getaffinity(). The CPU_COUNT() macro was added in glibc 2.9. + # glibc 2.9 is old enough that if someone uses the code on older glibc, + # the fallback to sysconf() should be good enough. + # + # NOTE: This required that _GNU_SOURCE is defined. We assume that whatever + # feature test macros the caller wants to use are already set in + # CMAKE_REQUIRED_DEFINES and in the target defines. + check_c_source_compiles(" + #include + int main(void) + { + cpu_set_t cpu_mask; + sched_getaffinity(0, sizeof(cpu_mask), &cpu_mask); + return CPU_COUNT(&cpu_mask); + } + " + TUKLIB_CPUCORES_SCHED_GETAFFINITY) + if(TUKLIB_CPUCORES_SCHED_GETAFFINITY) + set(TUKLIB_CPUCORES_DEFINITIONS + "TUKLIB_CPUCORES_SCHED_GETAFFINITY" + CACHE INTERNAL "") + return() + endif() + + # FreeBSD has both cpuset and sysctl. Look for cpuset first because + # it's a better approach. + # + # This test would match on GNU/kFreeBSD too but it would require + # -lfreebsd-glue when linking and thus in the current form this would + # fail on GNU/kFreeBSD. The above test for sched_getaffinity() matches + # on GNU/kFreeBSD so the test below should never run on that OS. + check_c_source_compiles(" + #include + #include + int main(void) + { + cpuset_t set; + cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, + sizeof(set), &set); + return 0; + } + " + TUKLIB_CPUCORES_CPUSET) + if(TUKLIB_CPUCORES_CPUSET) + set(TUKLIB_CPUCORES_DEFINITIONS "HAVE_PARAM_H;TUKLIB_CPUCORES_CPUSET" + CACHE INTERNAL "") + return() + endif() + + # On OS/2, both sysconf() and sysctl() pass the tests in this file, + # but only sysctl() works. On QNX it's the opposite: only sysconf() works + # (although it assumes that _POSIX_SOURCE, _XOPEN_SOURCE, and + # _POSIX_C_SOURCE are undefined or alternatively _QNX_SOURCE is defined). + # + # We test sysctl() first and intentionally break the sysctl() test on QNX + # so that sysctl() is never used on QNX. + check_include_file(sys/param.h HAVE_SYS_PARAM_H) + if(HAVE_SYS_PARAM_H) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_PARAM_H) + endif() + check_c_source_compiles(" + #ifdef __QNX__ + compile error + #endif + #ifdef HAVE_SYS_PARAM_H + # include + #endif + #include + int main(void) + { + #ifdef HW_NCPUONLINE + /* This is preferred on OpenBSD, see tuklib_cpucores.c. */ + int name[2] = { CTL_HW, HW_NCPUONLINE }; + #else + int name[2] = { CTL_HW, HW_NCPU }; + #endif + int cpus; + size_t cpus_size = sizeof(cpus); + sysctl(name, 2, &cpus, &cpus_size, NULL, 0); + return 0; + } + " + TUKLIB_CPUCORES_SYSCTL) + if(TUKLIB_CPUCORES_SYSCTL) + if(HAVE_SYS_PARAM_H) + set(TUKLIB_CPUCORES_DEFINITIONS + "HAVE_PARAM_H;TUKLIB_CPUCORES_SYSCTL" + CACHE INTERNAL "") + else() + set(TUKLIB_CPUCORES_DEFINITIONS + "TUKLIB_CPUCORES_SYSCTL" + CACHE INTERNAL "") + endif() + return() + endif() + + # Many platforms support sysconf(). + check_c_source_compiles(" + #include + int main(void) + { + long i; + #ifdef _SC_NPROCESSORS_ONLN + /* Many systems using sysconf() */ + i = sysconf(_SC_NPROCESSORS_ONLN); + #else + /* IRIX */ + i = sysconf(_SC_NPROC_ONLN); + #endif + return 0; + } + " + TUKLIB_CPUCORES_SYSCONF) + if(TUKLIB_CPUCORES_SYSCONF) + set(TUKLIB_CPUCORES_DEFINITIONS "TUKLIB_CPUCORES_SYSCONF" + CACHE INTERNAL "") + return() + endif() + + # HP-UX + check_c_source_compiles(" + #include + #include + int main(void) + { + struct pst_dynamic pst; + pstat_getdynamic(&pst, sizeof(pst), 1, 0); + (void)pst.psd_proc_cnt; + return 0; + } + " + TUKLIB_CPUCORES_PSTAT_GETDYNAMIC) + if(TUKLIB_CPUCORES_PSTAT_GETDYNAMIC) + set(TUKLIB_CPUCORES_DEFINITIONS "TUKLIB_CPUCORES_PSTAT_GETDYNAMIC" + CACHE INTERNAL "") + return() + endif() +endfunction() + +function(tuklib_cpucores TARGET_OR_ALL) + if(NOT DEFINED TUKLIB_CPUCORES_FOUND) + message(STATUS + "Checking how to detect the number of available CPU cores") + tuklib_cpucores_internal_check() + + if(DEFINED TUKLIB_CPUCORES_DEFINITIONS) + set(TUKLIB_CPUCORES_FOUND 1 CACHE INTERNAL "") + else() + set(TUKLIB_CPUCORES_FOUND 0 CACHE INTERNAL "") + message(WARNING + "No method to detect the number of CPU cores was found") + endif() + endif() + + if(TUKLIB_CPUCORES_FOUND) + tuklib_add_definitions("${TARGET_OR_ALL}" + "${TUKLIB_CPUCORES_DEFINITIONS}") + endif() +endfunction() diff --git a/cmake/tuklib_integer.cmake b/cmake/tuklib_integer.cmake new file mode 100644 index 0000000..949d2d9 --- /dev/null +++ b/cmake/tuklib_integer.cmake @@ -0,0 +1,101 @@ +# +# tuklib_integer.cmake - see tuklib_integer.m4 for description and comments +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake") +include(TestBigEndian) +include(CheckCSourceCompiles) +include(CheckIncludeFile) +include(CheckSymbolExists) + +function(tuklib_integer TARGET_OR_ALL) + # Check for endianness. Unlike the Autoconf's AC_C_BIGENDIAN, this doesn't + # support Apple universal binaries. The CMake module will leave the + # variable unset so we can catch that situation here instead of continuing + # as if we were little endian. + test_big_endian(WORDS_BIGENDIAN) + if(NOT DEFINED WORDS_BIGENDIAN) + message(FATAL_ERROR "Cannot determine endianness") + endif() + tuklib_add_definition_if("${TARGET_OR_ALL}" WORDS_BIGENDIAN) + + # Look for a byteswapping method. + check_c_source_compiles(" + int main(void) + { + __builtin_bswap16(1); + __builtin_bswap32(1); + __builtin_bswap64(1); + return 0; + } + " + HAVE___BUILTIN_BSWAPXX) + if(HAVE___BUILTIN_BSWAPXX) + tuklib_add_definitions("${TARGET_OR_ALL}" HAVE___BUILTIN_BSWAPXX) + else() + check_include_file(byteswap.h HAVE_BYTESWAP_H) + if(HAVE_BYTESWAP_H) + tuklib_add_definitions("${TARGET_OR_ALL}" HAVE_BYTESWAP_H) + check_symbol_exists(bswap_16 byteswap.h HAVE_BSWAP_16) + tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_BSWAP_16) + check_symbol_exists(bswap_32 byteswap.h HAVE_BSWAP_32) + tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_BSWAP_32) + check_symbol_exists(bswap_64 byteswap.h HAVE_BSWAP_64) + tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_BSWAP_64) + else() + check_include_file(sys/endian.h HAVE_SYS_ENDIAN_H) + if(HAVE_SYS_ENDIAN_H) + tuklib_add_definitions("${TARGET_OR_ALL}" HAVE_SYS_ENDIAN_H) + else() + check_include_file(sys/byteorder.h HAVE_SYS_BYTEORDER_H) + tuklib_add_definition_if("${TARGET_OR_ALL}" + HAVE_SYS_BYTEORDER_H) + endif() + endif() + endif() + + # Unaligned access is fast on x86(-64), big endian PowerPC, and usually on + # 32/64-bit ARM too. There are others too and ARM could be a false match. + # + # Guess the default value for the option. + # CMake's ability to give info about the target arch seems bad. + # The the same arch can have different name depending on the OS. + # + # FIXME: The regex is based on guessing, not on factual information! + # + # NOTE: Compared to the Autoconf test, this lacks the GCC/Clang test + # on ARM and always assumes that unaligned is fast on ARM. + set(FAST_UNALIGNED_GUESS OFF) + if(CMAKE_SYSTEM_PROCESSOR MATCHES + "[Xx3456]86|^[Xx]64|^[Aa][Mm][Dd]64|^[Aa][Rr][Mm]|^aarch|^powerpc|^ppc") + if(NOT WORDS_BIGENDIAN OR + NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc|^ppc") + set(FAST_UNALIGNED_GUESS ON) + endif() + endif() + option(TUKLIB_FAST_UNALIGNED_ACCESS + "Enable if the system supports *fast* unaligned memory access \ +with 16-bit, 32-bit, and 64-bit integers." + "${FAST_UNALIGNED_GUESS}") + tuklib_add_definition_if("${TARGET_OR_ALL}" TUKLIB_FAST_UNALIGNED_ACCESS) + + # Unsafe type punning: + option(TUKLIB_USE_UNSAFE_TYPE_PUNNING + "This introduces strict aliasing violations and \ +may result in broken code. However, this might improve performance \ +in some cases, especially with old compilers \ +(e.g. GCC 3 and early 4.x on x86, GCC < 6 on ARMv6 and ARMv7)." + OFF) + tuklib_add_definition_if("${TARGET_OR_ALL}" TUKLIB_USE_UNSAFE_TYPE_PUNNING) + + # Check for GCC/Clang __builtin_assume_aligned(). + check_c_source_compiles( + "int main(void) { __builtin_assume_aligned(\"\", 1); return 0; }" + HAVE___BUILTIN_ASSUME_ALIGNED) + tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE___BUILTIN_ASSUME_ALIGNED) +endfunction() diff --git a/cmake/tuklib_large_file_support.cmake b/cmake/tuklib_large_file_support.cmake new file mode 100644 index 0000000..0800faa --- /dev/null +++ b/cmake/tuklib_large_file_support.cmake @@ -0,0 +1,52 @@ +# +# tuklib_large_file_support.cmake +# +# If off_t is less than 64 bits by default and -D_FILE_OFFSET_BITS=64 +# makes off_t become 64-bit, the CMake option LARGE_FILE_SUPPORT is +# provided (ON by default) and -D_FILE_OFFSET_BITS=64 is added to +# the compile definitions if LARGE_FILE_SUPPORT is ON. +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake") +include(CheckCSourceCompiles) + +function(tuklib_large_file_support TARGET_OR_ALL) + # MSVC must be handled specially in the C code. + if(MSVC) + return() + endif() + + set(TUKLIB_LARGE_FILE_SUPPORT_TEST + "#include + int foo[sizeof(off_t) >= 8 ? 1 : -1]; + int main(void) { return 0; }") + + check_c_source_compiles("${TUKLIB_LARGE_FILE_SUPPORT_TEST}" + TUKLIB_LARGE_FILE_SUPPORT_BY_DEFAULT) + + if(NOT TUKLIB_LARGE_FILE_SUPPORT_BY_DEFAULT) + cmake_push_check_state() + # This needs -D. + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64") + check_c_source_compiles("${TUKLIB_LARGE_FILE_SUPPORT_TEST}" + TUKLIB_LARGE_FILE_SUPPORT_WITH_FOB64) + cmake_pop_check_state() + endif() + + if(TUKLIB_LARGE_FILE_SUPPORT_WITH_FOB64) + # Show the option only when _FILE_OFFSET_BITS=64 affects sizeof(off_t). + option(LARGE_FILE_SUPPORT + "Use -D_FILE_OFFSET_BITS=64 to support files larger than 2 GiB." + ON) + + if(LARGE_FILE_SUPPORT) + # This must not use -D. + tuklib_add_definitions("${TARGET_OR_ALL}" "_FILE_OFFSET_BITS=64") + endif() + endif() +endfunction() diff --git a/cmake/tuklib_mbstr.cmake b/cmake/tuklib_mbstr.cmake new file mode 100644 index 0000000..e073be6 --- /dev/null +++ b/cmake/tuklib_mbstr.cmake @@ -0,0 +1,20 @@ +# +# tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake") +include(CheckSymbolExists) + +function(tuklib_mbstr TARGET_OR_ALL) + check_symbol_exists(mbrtowc wchar.h HAVE_MBRTOWC) + tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_MBRTOWC) + + # NOTE: wcwidth() requires _GNU_SOURCE or _XOPEN_SOURCE on GNU/Linux. + check_symbol_exists(wcwidth wchar.h HAVE_WCWIDTH) + tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_WCWIDTH) +endfunction() diff --git a/cmake/tuklib_physmem.cmake b/cmake/tuklib_physmem.cmake new file mode 100644 index 0000000..f5ed888 --- /dev/null +++ b/cmake/tuklib_physmem.cmake @@ -0,0 +1,150 @@ +# +# tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments +# +# NOTE: Compared tuklib_physmem.m4, this lacks support for Tru64, IRIX, and +# Linux sysinfo() (usually sysconf() is used on GNU/Linux). +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake") +include(CheckCSourceCompiles) +include(CheckIncludeFile) + +function(tuklib_physmem_internal_check) + # Shortcut on Windows: + if(WIN32 OR CYGWIN) + # Nothing to do, the tuklib_physmem.c handles it. + set(TUKLIB_PHYSMEM_DEFINITIONS "" CACHE INTERNAL "") + return() + endif() + + # Full check for special cases: + check_c_source_compiles(" + #if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \ + || defined(__DJGPP__) || defined(__VMS) \ + || defined(AMIGA) || defined(__AROS__) || defined(__QNX__) + int main(void) { return 0; } + #else + compile error + #endif + " + TUKLIB_PHYSMEM_SPECIAL) + if(TUKLIB_PHYSMEM_SPECIAL) + # Nothing to do, the tuklib_physmem.c handles it. + set(TUKLIB_PHYSMEM_DEFINITIONS "" CACHE INTERNAL "") + return() + endif() + + # Look for AIX-specific solution before sysconf(), because the test + # for sysconf() will pass on AIX but won't actually work + # (sysconf(_SC_PHYS_PAGES) compiles but always returns -1 on AIX). + check_c_source_compiles(" + #include + int main(void) + { + (void)_system_configuration.physmem; + return 0; + } + " + TUKLIB_PHYSMEM_AIX) + if(TUKLIB_PHYSMEM_AIX) + set(TUKLIB_PHYSMEM_DEFINITIONS "TUKLIB_PHYSMEM_AIX" CACHE INTERNAL "") + return() + endif() + + # sysconf() + check_c_source_compiles(" + #include + int main(void) + { + long i; + i = sysconf(_SC_PAGESIZE); + i = sysconf(_SC_PHYS_PAGES); + return 0; + } + " + TUKLIB_PHYSMEM_SYSCONF) + if(TUKLIB_PHYSMEM_SYSCONF) + set(TUKLIB_PHYSMEM_DEFINITIONS "TUKLIB_PHYSMEM_SYSCONF" + CACHE INTERNAL "") + return() + endif() + + # sysctl() + check_include_file(sys/param.h HAVE_SYS_PARAM_H) + if(HAVE_SYS_PARAM_H) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_PARAM_H) + endif() + + check_c_source_compiles(" + #ifdef HAVE_SYS_PARAM_H + # include + #endif + #include + int main(void) + { + int name[2] = { CTL_HW, HW_PHYSMEM }; + unsigned long mem; + size_t mem_ptr_size = sizeof(mem); + sysctl(name, 2, &mem, &mem_ptr_size, NULL, 0); + return 0; + } + " + TUKLIB_PHYSMEM_SYSCTL) + if(TUKLIB_PHYSMEM_SYSCTL) + if(HAVE_SYS_PARAM_H) + set(TUKLIB_PHYSMEM_DEFINITIONS + "HAVE_PARAM_H;TUKLIB_PHYSMEM_SYSCTL" + CACHE INTERNAL "") + else() + set(TUKLIB_PHYSMEM_DEFINITIONS + "TUKLIB_PHYSMEM_SYSCTL" + CACHE INTERNAL "") + endif() + return() + endif() + + # HP-UX + check_c_source_compiles(" + #include + #include + int main(void) + { + struct pst_static pst; + pstat_getstatic(&pst, sizeof(pst), 1, 0); + (void)pst.physical_memory; + (void)pst.page_size; + return 0; + } + " + TUKLIB_PHYSMEM_PSTAT_GETSTATIC) + if(TUKLIB_PHYSMEM_PSTAT_GETSTATIC) + set(TUKLIB_PHYSMEM_DEFINITIONS "TUKLIB_PHYSMEM_PSTAT_GETSTATIC" + CACHE INTERNAL "") + return() + endif() +endfunction() + +function(tuklib_physmem TARGET_OR_ALL) + if(NOT DEFINED TUKLIB_PHYSMEM_FOUND) + message(STATUS "Checking how to detect the amount of physical memory") + tuklib_physmem_internal_check() + + if(DEFINED TUKLIB_PHYSMEM_DEFINITIONS) + set(TUKLIB_PHYSMEM_FOUND 1 CACHE INTERNAL "") + else() + set(TUKLIB_PHYSMEM_FOUND 0 CACHE INTERNAL "") + message(WARNING + "No method to detect the amount of physical memory was found") + endif() + endif() + + if(TUKLIB_PHYSMEM_FOUND) + tuklib_add_definitions("${TARGET_OR_ALL}" + "${TUKLIB_PHYSMEM_DEFINITIONS}") + endif() +endfunction() diff --git a/cmake/tuklib_progname.cmake b/cmake/tuklib_progname.cmake new file mode 100644 index 0000000..d4ab006 --- /dev/null +++ b/cmake/tuklib_progname.cmake @@ -0,0 +1,18 @@ +# +# tuklib_progname.cmake - see tuklib_progname.m4 for description and comments +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake") +include(CheckSymbolExists) + +function(tuklib_progname TARGET_OR_ALL) + # NOTE: This glibc extension requires _GNU_SOURCE. + check_symbol_exists(program_invocation_name errno.h + HAVE_PROGRAM_INVOCATION_NAME) + tuklib_add_definition_if("${TARGET_OR_ALL}" HAVE_PROGRAM_INVOCATION_NAME) +endfunction() diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..5e254c3 --- /dev/null +++ b/config.h.in @@ -0,0 +1,601 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* How many MiB of RAM to assume if the real amount cannot be determined. */ +#undef ASSUME_RAM + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Define to 1 if bswap_16 is available. */ +#undef HAVE_BSWAP_16 + +/* Define to 1 if bswap_32 is available. */ +#undef HAVE_BSWAP_32 + +/* Define to 1 if bswap_64 is available. */ +#undef HAVE_BSWAP_64 + +/* Define to 1 if you have the header file. */ +#undef HAVE_BYTESWAP_H + +/* Define to 1 if Capsicum is available. */ +#undef HAVE_CAPSICUM + +/* Define to 1 if the system has the type `CC_SHA256_CTX'. */ +#undef HAVE_CC_SHA256_CTX + +/* Define to 1 if you have the `CC_SHA256_Init' function. */ +#undef HAVE_CC_SHA256_INIT + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define to 1 if crc32 integrity check is enabled. */ +#undef HAVE_CHECK_CRC32 + +/* Define to 1 if crc64 integrity check is enabled. */ +#undef HAVE_CHECK_CRC64 + +/* Define to 1 if sha256 integrity check is enabled. */ +#undef HAVE_CHECK_SHA256 + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if `CLOCK_MONOTONIC' is declared in . */ +#undef HAVE_CLOCK_MONOTONIC + +/* Define to 1 if you have the header file. */ +#undef HAVE_COMMONCRYPTO_COMMONDIGEST_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CPUID_H + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if any of HAVE_DECODER_foo have been defined. */ +#undef HAVE_DECODERS + +/* Define to 1 if arm decoder is enabled. */ +#undef HAVE_DECODER_ARM + +/* Define to 1 if arm64 decoder is enabled. */ +#undef HAVE_DECODER_ARM64 + +/* Define to 1 if armthumb decoder is enabled. */ +#undef HAVE_DECODER_ARMTHUMB + +/* Define to 1 if delta decoder is enabled. */ +#undef HAVE_DECODER_DELTA + +/* Define to 1 if ia64 decoder is enabled. */ +#undef HAVE_DECODER_IA64 + +/* Define to 1 if lzma1 decoder is enabled. */ +#undef HAVE_DECODER_LZMA1 + +/* Define to 1 if lzma2 decoder is enabled. */ +#undef HAVE_DECODER_LZMA2 + +/* Define to 1 if powerpc decoder is enabled. */ +#undef HAVE_DECODER_POWERPC + +/* Define to 1 if sparc decoder is enabled. */ +#undef HAVE_DECODER_SPARC + +/* Define to 1 if x86 decoder is enabled. */ +#undef HAVE_DECODER_X86 + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if any of HAVE_ENCODER_foo have been defined. */ +#undef HAVE_ENCODERS + +/* Define to 1 if arm encoder is enabled. */ +#undef HAVE_ENCODER_ARM + +/* Define to 1 if arm64 encoder is enabled. */ +#undef HAVE_ENCODER_ARM64 + +/* Define to 1 if armthumb encoder is enabled. */ +#undef HAVE_ENCODER_ARMTHUMB + +/* Define to 1 if delta encoder is enabled. */ +#undef HAVE_ENCODER_DELTA + +/* Define to 1 if ia64 encoder is enabled. */ +#undef HAVE_ENCODER_IA64 + +/* Define to 1 if lzma1 encoder is enabled. */ +#undef HAVE_ENCODER_LZMA1 + +/* Define to 1 if lzma2 encoder is enabled. */ +#undef HAVE_ENCODER_LZMA2 + +/* Define to 1 if powerpc encoder is enabled. */ +#undef HAVE_ENCODER_POWERPC + +/* Define to 1 if sparc encoder is enabled. */ +#undef HAVE_ENCODER_SPARC + +/* Define to 1 if x86 encoder is enabled. */ +#undef HAVE_ENCODER_X86 + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if __attribute__((__constructor__)) is supported for functions. + */ +#undef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR + +/* 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 `futimesat' function. */ +#undef HAVE_FUTIMESAT + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the header file. */ +#undef HAVE_IMMINTRIN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if .lz (lzip) decompression support is enabled. */ +#undef HAVE_LZIP_DECODER + +/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ +#undef HAVE_MBRTOWC + +/* Define to 1 to enable bt2 match finder. */ +#undef HAVE_MF_BT2 + +/* Define to 1 to enable bt3 match finder. */ +#undef HAVE_MF_BT3 + +/* Define to 1 to enable bt4 match finder. */ +#undef HAVE_MF_BT4 + +/* Define to 1 to enable hc3 match finder. */ +#undef HAVE_MF_HC3 + +/* Define to 1 to enable hc4 match finder. */ +#undef HAVE_MF_HC4 + +/* Define to 1 if you have the header file. */ +#undef HAVE_MINIX_CONFIG_H + +/* Define to 1 if getopt.h declares extern int optreset. */ +#undef HAVE_OPTRESET + +/* Define to 1 if you have the `pledge' function. */ +#undef HAVE_PLEDGE + +/* Define to 1 if you have the `posix_fadvise' function. */ +#undef HAVE_POSIX_FADVISE + +/* Define to 1 if `program_invocation_name' is declared in . */ +#undef HAVE_PROGRAM_INVOCATION_NAME + +/* Define to 1 if you have the `pthread_condattr_setclock' function. */ +#undef HAVE_PTHREAD_CONDATTR_SETCLOCK + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + +/* Define to 1 if you have the `SHA256Init' function. */ +#undef HAVE_SHA256INIT + +/* Define to 1 if the system has the type `SHA256_CTX'. */ +#undef HAVE_SHA256_CTX + +/* Define to 1 if you have the header file. */ +#undef HAVE_SHA256_H + +/* Define to 1 if you have the `SHA256_Init' function. */ +#undef HAVE_SHA256_INIT + +/* Define to 1 if the system has the type `SHA2_CTX'. */ +#undef HAVE_SHA2_CTX + +/* Define to 1 if you have the header file. */ +#undef HAVE_SHA2_H + +/* Define to 1 if optimizing for size. */ +#undef HAVE_SMALL + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if `st_atimensec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC + +/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC + +/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC + +/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + +/* Define to 1 if `st_uatime' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_UATIME + +/* Define to 1 to if GNU/Linux-specific details are unconditionally wanted for + symbol versioning. Define to 2 to if these are wanted only if also PIC is + defined (allows building both shared and static liblzma at the same time + with Libtool if neither --with-pic nor --without-pic is used). This define + must be used together with liblzma_linux.map. */ +#undef HAVE_SYMBOL_VERSIONS_LINUX + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BYTEORDER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_CAPSICUM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if the system has the type `uintptr_t'. */ +#undef HAVE_UINTPTR_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if _mm_set_epi64x and _mm_clmulepi64_si128 are usable. See + configure.ac for details. */ +#undef HAVE_USABLE_CLMUL + +/* Define to 1 if you have the `utime' function. */ +#undef HAVE_UTIME + +/* Define to 1 if you have the `utimes' function. */ +#undef HAVE_UTIMES + +/* Define to 1 or 0, depending whether the compiler supports simple visibility + declarations. */ +#undef HAVE_VISIBILITY + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define to 1 if you have the `wcwidth' function. */ +#undef HAVE_WCWIDTH + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if you have the `_futime' function. */ +#undef HAVE__FUTIME + +/* Define to 1 if _mm_movemask_epi8 is available. */ +#undef HAVE__MM_MOVEMASK_EPI8 + +/* Define to 1 if the GNU C extension __builtin_assume_aligned is supported. + */ +#undef HAVE___BUILTIN_ASSUME_ALIGNED + +/* Define to 1 if the GNU C extensions __builtin_bswap16/32/64 are supported. + */ +#undef HAVE___BUILTIN_BSWAPXX + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Define to 1 when using POSIX threads (pthreads). */ +#undef MYTHREAD_POSIX + +/* Define to 1 when using Windows Vista compatible threads. This uses features + that are not available on Windows XP. */ +#undef MYTHREAD_VISTA + +/* Define to 1 when using Windows 95 (and thus XP) compatible threads. This + avoids use of features that were added in Windows Vista. */ +#undef MYTHREAD_WIN95 + +/* Define to 1 to disable debugging code. */ +#undef NDEBUG + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* Define to 1 if the number of available CPU cores can be detected with + cpuset(2). */ +#undef TUKLIB_CPUCORES_CPUSET + +/* Define to 1 if the number of available CPU cores can be detected with + pstat_getdynamic(). */ +#undef TUKLIB_CPUCORES_PSTAT_GETDYNAMIC + +/* Define to 1 if the number of available CPU cores can be detected with + sched_getaffinity() */ +#undef TUKLIB_CPUCORES_SCHED_GETAFFINITY + +/* Define to 1 if the number of available CPU cores can be detected with + sysconf(_SC_NPROCESSORS_ONLN) or sysconf(_SC_NPROC_ONLN). */ +#undef TUKLIB_CPUCORES_SYSCONF + +/* Define to 1 if the number of available CPU cores can be detected with + sysctl(). */ +#undef TUKLIB_CPUCORES_SYSCTL + +/* Define to 1 if the system supports fast unaligned access to 16-bit, 32-bit, + and 64-bit integers. */ +#undef TUKLIB_FAST_UNALIGNED_ACCESS + +/* Define to 1 if the amount of physical memory can be detected with + _system_configuration.physmem. */ +#undef TUKLIB_PHYSMEM_AIX + +/* Define to 1 if the amount of physical memory can be detected with + getinvent_r(). */ +#undef TUKLIB_PHYSMEM_GETINVENT_R + +/* Define to 1 if the amount of physical memory can be detected with + getsysinfo(). */ +#undef TUKLIB_PHYSMEM_GETSYSINFO + +/* Define to 1 if the amount of physical memory can be detected with + pstat_getstatic(). */ +#undef TUKLIB_PHYSMEM_PSTAT_GETSTATIC + +/* Define to 1 if the amount of physical memory can be detected with + sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES). */ +#undef TUKLIB_PHYSMEM_SYSCONF + +/* Define to 1 if the amount of physical memory can be detected with sysctl(). + */ +#undef TUKLIB_PHYSMEM_SYSCTL + +/* Define to 1 if the amount of physical memory can be detected with Linux + sysinfo(). */ +#undef TUKLIB_PHYSMEM_SYSINFO + +/* Define to 1 to use unsafe type punning, e.g. char *x = ...; *(int *)x = + 123; which violates strict aliasing rules and thus is undefined behavior + and might result in broken code. */ +#undef TUKLIB_USE_UNSAFE_TYPE_PUNNING + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +# undef _MINIX +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ +#ifndef _NETBSD_SOURCE +# undef _NETBSD_SOURCE +#endif +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ +#ifndef _OPENBSD_SOURCE +# undef _OPENBSD_SOURCE +#endif +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +# undef _POSIX_SOURCE +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +# undef _POSIX_1_SOURCE +#endif +/* Enable POSIX-compatible threading on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif + + +/* Version number of package */ +#undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef 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. */ +#undef int64_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef 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. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t + +/* Define to the type of an unsigned integer type wide enough to hold a + pointer, if such a type exists, and if the system does not define it. */ +#undef uintptr_t diff --git a/configure b/configure new file mode 100755 index 0000000..5f8aa8c --- /dev/null +++ b/configure @@ -0,0 +1,24905 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for XZ Utils 5.4.5. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # 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 +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; 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 + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # 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 +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and xz@tukaani.org +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + 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 -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='XZ Utils' +PACKAGE_TARNAME='xz' +PACKAGE_VERSION='5.4.5' +PACKAGE_STRING='XZ Utils 5.4.5' +PACKAGE_BUGREPORT='xz@tukaani.org' +PACKAGE_URL='https://tukaani.org/xz/' + +ac_unique_file="src/liblzma/common/common.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +gt_needs= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +xz +AM_CFLAGS +COND_GNULIB_FALSE +COND_GNULIB_TRUE +HAVE_VISIBILITY +CFLAG_VISIBILITY +CAPSICUM_LIB +COND_INTERNAL_SHA256_FALSE +COND_INTERNAL_SHA256_TRUE +GETOPT_H +LIBOBJS +POSUB +LTLIBINTL +LIBINTL +INTLLIBS +LTLIBICONV +LIBICONV +INTL_MACOSX_LIBS +XGETTEXT_EXTRA_OPTIONS +MSGMERGE_FOR_MSGFMT_OPTION +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +GMSGFMT +MSGFMT +GETTEXT_MACRO_VERSION +USE_NLS +COND_SYMVERS_GENERIC_FALSE +COND_SYMVERS_GENERIC_TRUE +COND_SYMVERS_LINUX_FALSE +COND_SYMVERS_LINUX_TRUE +COND_SHARED_FALSE +COND_SHARED_TRUE +RC +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +FILECMD +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +LIBTOOL +OBJDUMP +DLLTOOL +AS +COND_THREADS_FALSE +COND_THREADS_TRUE +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CXX +PTHREAD_CC +ax_pthread_config +EGREP +GREP +CPP +SED +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +CCASFLAGS +CCAS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +LN_S +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +PREFERABLY_POSIX_SHELL +POSIX_SHELL +enable_path_for_scripts +COND_DOC_FALSE +COND_DOC_TRUE +COND_SCRIPTS_FALSE +COND_SCRIPTS_TRUE +COND_LZMALINKS_FALSE +COND_LZMALINKS_TRUE +COND_LZMAINFO_FALSE +COND_LZMAINFO_TRUE +COND_LZMADEC_FALSE +COND_LZMADEC_TRUE +COND_XZDEC_FALSE +COND_XZDEC_TRUE +COND_XZ_FALSE +COND_XZ_TRUE +COND_SMALL_FALSE +COND_SMALL_TRUE +COND_ASM_X86_FALSE +COND_ASM_X86_TRUE +COND_LZIP_DECODER_FALSE +COND_LZIP_DECODER_TRUE +COND_MICROLZMA_FALSE +COND_MICROLZMA_TRUE +COND_CHECK_SHA256_FALSE +COND_CHECK_SHA256_TRUE +COND_CHECK_CRC64_FALSE +COND_CHECK_CRC64_TRUE +COND_CHECK_CRC32_FALSE +COND_CHECK_CRC32_TRUE +COND_DECODER_LZ_FALSE +COND_DECODER_LZ_TRUE +COND_ENCODER_LZ_FALSE +COND_ENCODER_LZ_TRUE +COND_FILTER_LZ_FALSE +COND_FILTER_LZ_TRUE +COND_DECODER_SIMPLE_FALSE +COND_DECODER_SIMPLE_TRUE +COND_ENCODER_SIMPLE_FALSE +COND_ENCODER_SIMPLE_TRUE +COND_FILTER_SIMPLE_FALSE +COND_FILTER_SIMPLE_TRUE +COND_DECODER_SPARC_FALSE +COND_DECODER_SPARC_TRUE +COND_ENCODER_SPARC_FALSE +COND_ENCODER_SPARC_TRUE +COND_FILTER_SPARC_FALSE +COND_FILTER_SPARC_TRUE +COND_DECODER_ARM64_FALSE +COND_DECODER_ARM64_TRUE +COND_ENCODER_ARM64_FALSE +COND_ENCODER_ARM64_TRUE +COND_FILTER_ARM64_FALSE +COND_FILTER_ARM64_TRUE +COND_DECODER_ARMTHUMB_FALSE +COND_DECODER_ARMTHUMB_TRUE +COND_ENCODER_ARMTHUMB_FALSE +COND_ENCODER_ARMTHUMB_TRUE +COND_FILTER_ARMTHUMB_FALSE +COND_FILTER_ARMTHUMB_TRUE +COND_DECODER_ARM_FALSE +COND_DECODER_ARM_TRUE +COND_ENCODER_ARM_FALSE +COND_ENCODER_ARM_TRUE +COND_FILTER_ARM_FALSE +COND_FILTER_ARM_TRUE +COND_DECODER_IA64_FALSE +COND_DECODER_IA64_TRUE +COND_ENCODER_IA64_FALSE +COND_ENCODER_IA64_TRUE +COND_FILTER_IA64_FALSE +COND_FILTER_IA64_TRUE +COND_DECODER_POWERPC_FALSE +COND_DECODER_POWERPC_TRUE +COND_ENCODER_POWERPC_FALSE +COND_ENCODER_POWERPC_TRUE +COND_FILTER_POWERPC_FALSE +COND_FILTER_POWERPC_TRUE +COND_DECODER_X86_FALSE +COND_DECODER_X86_TRUE +COND_ENCODER_X86_FALSE +COND_ENCODER_X86_TRUE +COND_FILTER_X86_FALSE +COND_FILTER_X86_TRUE +COND_DECODER_DELTA_FALSE +COND_DECODER_DELTA_TRUE +COND_ENCODER_DELTA_FALSE +COND_ENCODER_DELTA_TRUE +COND_FILTER_DELTA_FALSE +COND_FILTER_DELTA_TRUE +COND_DECODER_LZMA2_FALSE +COND_DECODER_LZMA2_TRUE +COND_ENCODER_LZMA2_FALSE +COND_ENCODER_LZMA2_TRUE +COND_FILTER_LZMA2_FALSE +COND_FILTER_LZMA2_TRUE +COND_DECODER_LZMA1_FALSE +COND_DECODER_LZMA1_TRUE +COND_ENCODER_LZMA1_FALSE +COND_ENCODER_LZMA1_TRUE +COND_FILTER_LZMA1_FALSE +COND_FILTER_LZMA1_TRUE +COND_MAIN_DECODER_FALSE +COND_MAIN_DECODER_TRUE +COND_MAIN_ENCODER_FALSE +COND_MAIN_ENCODER_TRUE +LN_EXEEXT +COND_W32_FALSE +COND_W32_TRUE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_debug +enable_encoders +enable_decoders +enable_match_finders +enable_checks +enable_external_sha256 +enable_microlzma +enable_lzip_decoder +enable_assembler +enable_clmul_crc +enable_small +enable_threads +enable_assume_ram +enable_xz +enable_xzdec +enable_lzmadec +enable_lzmainfo +enable_lzma_links +enable_scripts +enable_doc +enable_sandbox +enable_path_for_scripts +enable_silent_rules +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_symbol_versions +enable_nls +enable_rpath +with_libiconv_prefix +with_libintl_prefix +enable_largefile +enable_unaligned_access +enable_unsafe_type_punning +enable_werror +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCAS +CCASFLAGS +CPP +LT_SYS_LIBRARY_PATH' + + +# 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 +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$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 ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$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- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$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_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$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. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$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 runstatedir +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 + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +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 .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + 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 || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +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 XZ Utils 5.4.5 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +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] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --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/xz] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of XZ Utils 5.4.5:";; + 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] + --enable-debug Enable debugging code. + --enable-encoders=LIST Comma-separated list of encoders to build. + Default=all. Available encoders: lzma1 lzma2 delta + x86 powerpc ia64 arm armthumb arm64 sparc + --enable-decoders=LIST Comma-separated list of decoders to build. + Default=all. Available decoders are the same as + available encoders. + --enable-match-finders=LIST + Comma-separated list of match finders to build. + Default=all. At least one match finder is required + for encoding with the LZMA1 and LZMA2 filters. + Available match finders: hc3 hc4 bt2 bt3 bt4 + --enable-checks=LIST Comma-separated list of integrity checks to build. + Default=all. Available integrity checks: crc32 crc64 + sha256 + --enable-external-sha256 + Use SHA-256 code from the operating system. See + INSTALL for possible subtle problems. + --disable-microlzma Do not build MicroLZMA encoder and decoder. It is + needed by specific applications only, for example, + erofs-utils. + --disable-lzip-decoder Disable decompression support for .lz (lzip) files. + --disable-assembler Do not use assembler optimizations even if such + exist for the architecture. + --disable-clmul-crc Do not use carryless multiplication for CRC + calculation even if support for it is detected. + --enable-small Make liblzma smaller and a little slower. This is + disabled by default to optimize for speed. + --enable-threads=METHOD Supported METHODS are `yes', `no', `posix', `win95', + and `vista'. The default is `yes'. Using `no' + together with --enable-small makes liblzma thread + unsafe. + --enable-assume-ram=SIZE + If and only if the real amount of RAM cannot be + determined, assume SIZE MiB. The default is 128 MiB. + This affects the default memory usage limit. + --disable-xz do not build the xz tool + --disable-xzdec do not build xzdec + --disable-lzmadec do not build lzmadec (it exists primarily for LZMA + Utils compatibility) + --disable-lzmainfo do not build lzmainfo (it exists primarily for LZMA + Utils compatibility) + --disable-lzma-links do not create symlinks for LZMA Utils compatibility + --disable-scripts do not install the scripts xzdiff, xzgrep, xzless, + xzmore, and their symlinks + --disable-doc do not install documentation files to docdir (man + pages will still be installed) + --enable-sandbox=METHOD Sandboxing METHOD can be `auto', `no', `capsicum', + or `pledge'. The default is `auto' which enables + sandboxing if a supported sandboxing method is + found. + --enable-path-for-scripts=PREFIX + If PREFIX isn't empty, PATH=PREFIX:$PATH will be set + in the beginning of the scripts (xzgrep and others). + The default is empty except on Solaris the default + is /usr/xpg4/bin. + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-symbol-versions + Use symbol versioning for liblzma. Enabled by + default on GNU/Linux, other GNU-based systems, and + FreeBSD. + --disable-nls do not use Native Language Support + --disable-rpath do not hardcode runtime library paths + --disable-largefile omit support for large files + --enable-unaligned-access + Enable if the system supports *fast* unaligned + memory access with 16-bit, 32-bit, and 64-bit + integers. By default, this is enabled only on x86, + x86_64, big endian PowerPC, and some ARM systems. + --enable-unsafe-type-punning + This introduces strict aliasing violations and may + result in broken code. However, this might improve + performance in some cases, especially with old + compilers (e.g. GCC 3 and early 4.x on x86, GCC < 6 + on ARMv6 and ARMv7). + --enable-werror Enable -Werror to abort compilation on all compiler + warnings. + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + CPP C preprocessor + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +XZ Utils home page: . +_ACEOF +ac_status=$? +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" || + { 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +XZ Utils configure 5.4.5 +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + 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:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam 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:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + 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:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include +#undef $2 + +/* 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 $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_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + 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:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { 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:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +printf %s "checking for uint$2_t... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no" +then : + +else $as_nop + break +fi + done +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_uintX_t + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +printf %s "checking for int$2_t... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main (void) +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main (void) +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no" +then : + +else $as_nop + break +fi + done +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else $as_nop + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else $as_nop + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else $as_nop + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +#include +#include +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + 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 +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 &5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else $as_nop + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +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 XZ Utils $as_me 5.4.5, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +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 || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$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= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" +gt_needs="$gt_needs " + +# Auxiliary files required by this configure script. +ac_aux_files="config.rpath ltmain.sh compile missing install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/build-aux" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$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 + # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$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=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 + + + + + +ac_config_headers="$ac_config_headers config.h" + + +echo +echo "$PACKAGE_STRING" + +echo +echo "System type:" +# This is needed to know if assembler optimizations can be used. + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +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 + + + +# We do some special things on Windows (32-bit or 64-bit) builds. +case $host_os in + mingw* | cygwin | msys) is_w32=yes ;; + *) is_w32=no ;; +esac + if test "$is_w32" = yes; then + COND_W32_TRUE= + COND_W32_FALSE='#' +else + COND_W32_TRUE='#' + COND_W32_FALSE= +fi + + +# We need to use $EXEEXT with $(LN_S) when creating symlinks to +# executables. Cygwin is an exception to this, since it is recommended +# that symlinks don't have the .exe suffix. To make this work, we +# define LN_EXEEXT. +# +# MSYS2 is treated the same way as Cygwin. It uses plain "msys" like +# the original MSYS when building MSYS/MSYS2-binaries. Hopefully this +# doesn't break things for the original MSYS developers. Note that this +# doesn't affect normal MSYS/MSYS2 users building non-MSYS/MSYS2 binaries +# since in that case the $host_os is usually mingw32. +case $host_os in + cygwin | msys) LN_EXEEXT= ;; + *) LN_EXEEXT='$(EXEEXT)' ;; +esac + + +echo +echo "Configure options:" +AM_CFLAGS= + + +############# +# Debugging # +############# + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if debugging code should be compiled" >&5 +printf %s "checking if debugging code should be compiled... " >&6; } +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; +else $as_nop + enable_debug=no +fi + +if test "x$enable_debug" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + +printf "%s\n" "#define NDEBUG 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +########### +# Filters # +########### + + + + +enable_filter_lzma1=no +enable_encoder_lzma1=no +enable_decoder_lzma1=no +enable_filter_lzma2=no +enable_encoder_lzma2=no +enable_decoder_lzma2=no +enable_filter_delta=no +enable_encoder_delta=no +enable_decoder_delta=no +enable_filter_x86=no +enable_encoder_x86=no +enable_decoder_x86=no +enable_filter_powerpc=no +enable_encoder_powerpc=no +enable_decoder_powerpc=no +enable_filter_ia64=no +enable_encoder_ia64=no +enable_decoder_ia64=no +enable_filter_arm=no +enable_encoder_arm=no +enable_decoder_arm=no +enable_filter_armthumb=no +enable_encoder_armthumb=no +enable_decoder_armthumb=no +enable_filter_arm64=no +enable_encoder_arm64=no +enable_decoder_arm64=no +enable_filter_sparc=no +enable_encoder_sparc=no +enable_decoder_sparc=no + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which encoders to build" >&5 +printf %s "checking which encoders to build... " >&6; } +# Check whether --enable-encoders was given. +if test ${enable_encoders+y} +then : + enableval=$enable_encoders; +else $as_nop + enable_encoders=lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc +fi + +enable_encoders=`echo "$enable_encoders" | sed 's/,/ /g'` +if test "x$enable_encoders" = xno || test "x$enable_encoders" = x; then + enable_encoders=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (none)" >&5 +printf "%s\n" "(none)" >&6; } +else + for arg in $enable_encoders + do + case $arg in + lzma1) + enable_filter_lzma1=yes + enable_encoder_lzma1=yes + +printf "%s\n" "#define HAVE_ENCODER_LZMA1 1" >>confdefs.h + + ;; + lzma2) + enable_filter_lzma2=yes + enable_encoder_lzma2=yes + +printf "%s\n" "#define HAVE_ENCODER_LZMA2 1" >>confdefs.h + + ;; + delta) + enable_filter_delta=yes + enable_encoder_delta=yes + +printf "%s\n" "#define HAVE_ENCODER_DELTA 1" >>confdefs.h + + ;; + x86) + enable_filter_x86=yes + enable_encoder_x86=yes + +printf "%s\n" "#define HAVE_ENCODER_X86 1" >>confdefs.h + + ;; + powerpc) + enable_filter_powerpc=yes + enable_encoder_powerpc=yes + +printf "%s\n" "#define HAVE_ENCODER_POWERPC 1" >>confdefs.h + + ;; + ia64) + enable_filter_ia64=yes + enable_encoder_ia64=yes + +printf "%s\n" "#define HAVE_ENCODER_IA64 1" >>confdefs.h + + ;; + arm) + enable_filter_arm=yes + enable_encoder_arm=yes + +printf "%s\n" "#define HAVE_ENCODER_ARM 1" >>confdefs.h + + ;; + armthumb) + enable_filter_armthumb=yes + enable_encoder_armthumb=yes + +printf "%s\n" "#define HAVE_ENCODER_ARMTHUMB 1" >>confdefs.h + + ;; + arm64) + enable_filter_arm64=yes + enable_encoder_arm64=yes + +printf "%s\n" "#define HAVE_ENCODER_ARM64 1" >>confdefs.h + + ;; + sparc) + enable_filter_sparc=yes + enable_encoder_sparc=yes + +printf "%s\n" "#define HAVE_ENCODER_SPARC 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "unknown filter: $arg" "$LINENO" 5 + ;; + esac + done + +printf "%s\n" "#define HAVE_ENCODERS 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_encoders" >&5 +printf "%s\n" "$enable_encoders" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which decoders to build" >&5 +printf %s "checking which decoders to build... " >&6; } +# Check whether --enable-decoders was given. +if test ${enable_decoders+y} +then : + enableval=$enable_decoders; +else $as_nop + enable_decoders=lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc +fi + +enable_decoders=`echo "$enable_decoders" | sed 's/,/ /g'` +if test "x$enable_decoders" = xno || test "x$enable_decoders" = x; then + enable_decoders=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (none)" >&5 +printf "%s\n" "(none)" >&6; } +else + for arg in $enable_decoders + do + case $arg in + lzma1) + enable_filter_lzma1=yes + enable_decoder_lzma1=yes + +printf "%s\n" "#define HAVE_DECODER_LZMA1 1" >>confdefs.h + + ;; + lzma2) + enable_filter_lzma2=yes + enable_decoder_lzma2=yes + +printf "%s\n" "#define HAVE_DECODER_LZMA2 1" >>confdefs.h + + ;; + delta) + enable_filter_delta=yes + enable_decoder_delta=yes + +printf "%s\n" "#define HAVE_DECODER_DELTA 1" >>confdefs.h + + ;; + x86) + enable_filter_x86=yes + enable_decoder_x86=yes + +printf "%s\n" "#define HAVE_DECODER_X86 1" >>confdefs.h + + ;; + powerpc) + enable_filter_powerpc=yes + enable_decoder_powerpc=yes + +printf "%s\n" "#define HAVE_DECODER_POWERPC 1" >>confdefs.h + + ;; + ia64) + enable_filter_ia64=yes + enable_decoder_ia64=yes + +printf "%s\n" "#define HAVE_DECODER_IA64 1" >>confdefs.h + + ;; + arm) + enable_filter_arm=yes + enable_decoder_arm=yes + +printf "%s\n" "#define HAVE_DECODER_ARM 1" >>confdefs.h + + ;; + armthumb) + enable_filter_armthumb=yes + enable_decoder_armthumb=yes + +printf "%s\n" "#define HAVE_DECODER_ARMTHUMB 1" >>confdefs.h + + ;; + arm64) + enable_filter_arm64=yes + enable_decoder_arm64=yes + +printf "%s\n" "#define HAVE_DECODER_ARM64 1" >>confdefs.h + + ;; + sparc) + enable_filter_sparc=yes + enable_decoder_sparc=yes + +printf "%s\n" "#define HAVE_DECODER_SPARC 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "unknown filter: $arg" "$LINENO" 5 + ;; + esac + done + +printf "%s\n" "#define HAVE_DECODERS 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_decoders" >&5 +printf "%s\n" "$enable_decoders" >&6; } +fi + +if test "x$enable_encoder_lzma2$enable_encoder_lzma1" = xyesno \ + || test "x$enable_decoder_lzma2$enable_decoder_lzma1" = xyesno; then + as_fn_error $? "LZMA2 requires that LZMA1 is also enabled." "$LINENO" 5 +fi + + if test "x$enable_encoders" != xno; then + COND_MAIN_ENCODER_TRUE= + COND_MAIN_ENCODER_FALSE='#' +else + COND_MAIN_ENCODER_TRUE='#' + COND_MAIN_ENCODER_FALSE= +fi + + if test "x$enable_decoders" != xno; then + COND_MAIN_DECODER_TRUE= + COND_MAIN_DECODER_FALSE='#' +else + COND_MAIN_DECODER_TRUE='#' + COND_MAIN_DECODER_FALSE= +fi + + + if test "x$enable_filter_lzma1" = xyes; then + COND_FILTER_LZMA1_TRUE= + COND_FILTER_LZMA1_FALSE='#' +else + COND_FILTER_LZMA1_TRUE='#' + COND_FILTER_LZMA1_FALSE= +fi + + if test "x$enable_encoder_lzma1" = xyes; then + COND_ENCODER_LZMA1_TRUE= + COND_ENCODER_LZMA1_FALSE='#' +else + COND_ENCODER_LZMA1_TRUE='#' + COND_ENCODER_LZMA1_FALSE= +fi + + if test "x$enable_decoder_lzma1" = xyes; then + COND_DECODER_LZMA1_TRUE= + COND_DECODER_LZMA1_FALSE='#' +else + COND_DECODER_LZMA1_TRUE='#' + COND_DECODER_LZMA1_FALSE= +fi + + if test "x$enable_filter_lzma2" = xyes; then + COND_FILTER_LZMA2_TRUE= + COND_FILTER_LZMA2_FALSE='#' +else + COND_FILTER_LZMA2_TRUE='#' + COND_FILTER_LZMA2_FALSE= +fi + + if test "x$enable_encoder_lzma2" = xyes; then + COND_ENCODER_LZMA2_TRUE= + COND_ENCODER_LZMA2_FALSE='#' +else + COND_ENCODER_LZMA2_TRUE='#' + COND_ENCODER_LZMA2_FALSE= +fi + + if test "x$enable_decoder_lzma2" = xyes; then + COND_DECODER_LZMA2_TRUE= + COND_DECODER_LZMA2_FALSE='#' +else + COND_DECODER_LZMA2_TRUE='#' + COND_DECODER_LZMA2_FALSE= +fi + + if test "x$enable_filter_delta" = xyes; then + COND_FILTER_DELTA_TRUE= + COND_FILTER_DELTA_FALSE='#' +else + COND_FILTER_DELTA_TRUE='#' + COND_FILTER_DELTA_FALSE= +fi + + if test "x$enable_encoder_delta" = xyes; then + COND_ENCODER_DELTA_TRUE= + COND_ENCODER_DELTA_FALSE='#' +else + COND_ENCODER_DELTA_TRUE='#' + COND_ENCODER_DELTA_FALSE= +fi + + if test "x$enable_decoder_delta" = xyes; then + COND_DECODER_DELTA_TRUE= + COND_DECODER_DELTA_FALSE='#' +else + COND_DECODER_DELTA_TRUE='#' + COND_DECODER_DELTA_FALSE= +fi + + if test "x$enable_filter_x86" = xyes; then + COND_FILTER_X86_TRUE= + COND_FILTER_X86_FALSE='#' +else + COND_FILTER_X86_TRUE='#' + COND_FILTER_X86_FALSE= +fi + + if test "x$enable_encoder_x86" = xyes; then + COND_ENCODER_X86_TRUE= + COND_ENCODER_X86_FALSE='#' +else + COND_ENCODER_X86_TRUE='#' + COND_ENCODER_X86_FALSE= +fi + + if test "x$enable_decoder_x86" = xyes; then + COND_DECODER_X86_TRUE= + COND_DECODER_X86_FALSE='#' +else + COND_DECODER_X86_TRUE='#' + COND_DECODER_X86_FALSE= +fi + + if test "x$enable_filter_powerpc" = xyes; then + COND_FILTER_POWERPC_TRUE= + COND_FILTER_POWERPC_FALSE='#' +else + COND_FILTER_POWERPC_TRUE='#' + COND_FILTER_POWERPC_FALSE= +fi + + if test "x$enable_encoder_powerpc" = xyes; then + COND_ENCODER_POWERPC_TRUE= + COND_ENCODER_POWERPC_FALSE='#' +else + COND_ENCODER_POWERPC_TRUE='#' + COND_ENCODER_POWERPC_FALSE= +fi + + if test "x$enable_decoder_powerpc" = xyes; then + COND_DECODER_POWERPC_TRUE= + COND_DECODER_POWERPC_FALSE='#' +else + COND_DECODER_POWERPC_TRUE='#' + COND_DECODER_POWERPC_FALSE= +fi + + if test "x$enable_filter_ia64" = xyes; then + COND_FILTER_IA64_TRUE= + COND_FILTER_IA64_FALSE='#' +else + COND_FILTER_IA64_TRUE='#' + COND_FILTER_IA64_FALSE= +fi + + if test "x$enable_encoder_ia64" = xyes; then + COND_ENCODER_IA64_TRUE= + COND_ENCODER_IA64_FALSE='#' +else + COND_ENCODER_IA64_TRUE='#' + COND_ENCODER_IA64_FALSE= +fi + + if test "x$enable_decoder_ia64" = xyes; then + COND_DECODER_IA64_TRUE= + COND_DECODER_IA64_FALSE='#' +else + COND_DECODER_IA64_TRUE='#' + COND_DECODER_IA64_FALSE= +fi + + if test "x$enable_filter_arm" = xyes; then + COND_FILTER_ARM_TRUE= + COND_FILTER_ARM_FALSE='#' +else + COND_FILTER_ARM_TRUE='#' + COND_FILTER_ARM_FALSE= +fi + + if test "x$enable_encoder_arm" = xyes; then + COND_ENCODER_ARM_TRUE= + COND_ENCODER_ARM_FALSE='#' +else + COND_ENCODER_ARM_TRUE='#' + COND_ENCODER_ARM_FALSE= +fi + + if test "x$enable_decoder_arm" = xyes; then + COND_DECODER_ARM_TRUE= + COND_DECODER_ARM_FALSE='#' +else + COND_DECODER_ARM_TRUE='#' + COND_DECODER_ARM_FALSE= +fi + + if test "x$enable_filter_armthumb" = xyes; then + COND_FILTER_ARMTHUMB_TRUE= + COND_FILTER_ARMTHUMB_FALSE='#' +else + COND_FILTER_ARMTHUMB_TRUE='#' + COND_FILTER_ARMTHUMB_FALSE= +fi + + if test "x$enable_encoder_armthumb" = xyes; then + COND_ENCODER_ARMTHUMB_TRUE= + COND_ENCODER_ARMTHUMB_FALSE='#' +else + COND_ENCODER_ARMTHUMB_TRUE='#' + COND_ENCODER_ARMTHUMB_FALSE= +fi + + if test "x$enable_decoder_armthumb" = xyes; then + COND_DECODER_ARMTHUMB_TRUE= + COND_DECODER_ARMTHUMB_FALSE='#' +else + COND_DECODER_ARMTHUMB_TRUE='#' + COND_DECODER_ARMTHUMB_FALSE= +fi + + if test "x$enable_filter_arm64" = xyes; then + COND_FILTER_ARM64_TRUE= + COND_FILTER_ARM64_FALSE='#' +else + COND_FILTER_ARM64_TRUE='#' + COND_FILTER_ARM64_FALSE= +fi + + if test "x$enable_encoder_arm64" = xyes; then + COND_ENCODER_ARM64_TRUE= + COND_ENCODER_ARM64_FALSE='#' +else + COND_ENCODER_ARM64_TRUE='#' + COND_ENCODER_ARM64_FALSE= +fi + + if test "x$enable_decoder_arm64" = xyes; then + COND_DECODER_ARM64_TRUE= + COND_DECODER_ARM64_FALSE='#' +else + COND_DECODER_ARM64_TRUE='#' + COND_DECODER_ARM64_FALSE= +fi + + if test "x$enable_filter_sparc" = xyes; then + COND_FILTER_SPARC_TRUE= + COND_FILTER_SPARC_FALSE='#' +else + COND_FILTER_SPARC_TRUE='#' + COND_FILTER_SPARC_FALSE= +fi + + if test "x$enable_encoder_sparc" = xyes; then + COND_ENCODER_SPARC_TRUE= + COND_ENCODER_SPARC_FALSE='#' +else + COND_ENCODER_SPARC_TRUE='#' + COND_ENCODER_SPARC_FALSE= +fi + + if test "x$enable_decoder_sparc" = xyes; then + COND_DECODER_SPARC_TRUE= + COND_DECODER_SPARC_FALSE='#' +else + COND_DECODER_SPARC_TRUE='#' + COND_DECODER_SPARC_FALSE= +fi + + +# The so called "simple filters" share common code. +enable_filter_simple=no +enable_encoder_simple=no +enable_decoder_simple=no +test "x$enable_filter_x86" = xyes && enable_filter_simple=yes +test "x$enable_encoder_x86" = xyes && enable_encoder_simple=yes +test "x$enable_decoder_x86" = xyes && enable_decoder_simple=yes +test "x$enable_filter_powerpc" = xyes && enable_filter_simple=yes +test "x$enable_encoder_powerpc" = xyes && enable_encoder_simple=yes +test "x$enable_decoder_powerpc" = xyes && enable_decoder_simple=yes +test "x$enable_filter_ia64" = xyes && enable_filter_simple=yes +test "x$enable_encoder_ia64" = xyes && enable_encoder_simple=yes +test "x$enable_decoder_ia64" = xyes && enable_decoder_simple=yes +test "x$enable_filter_arm" = xyes && enable_filter_simple=yes +test "x$enable_encoder_arm" = xyes && enable_encoder_simple=yes +test "x$enable_decoder_arm" = xyes && enable_decoder_simple=yes +test "x$enable_filter_armthumb" = xyes && enable_filter_simple=yes +test "x$enable_encoder_armthumb" = xyes && enable_encoder_simple=yes +test "x$enable_decoder_armthumb" = xyes && enable_decoder_simple=yes +test "x$enable_filter_arm64" = xyes && enable_filter_simple=yes +test "x$enable_encoder_arm64" = xyes && enable_encoder_simple=yes +test "x$enable_decoder_arm64" = xyes && enable_decoder_simple=yes +test "x$enable_filter_sparc" = xyes && enable_filter_simple=yes +test "x$enable_encoder_sparc" = xyes && enable_encoder_simple=yes +test "x$enable_decoder_sparc" = xyes && enable_decoder_simple=yes + if test "x$enable_filter_simple" = xyes; then + COND_FILTER_SIMPLE_TRUE= + COND_FILTER_SIMPLE_FALSE='#' +else + COND_FILTER_SIMPLE_TRUE='#' + COND_FILTER_SIMPLE_FALSE= +fi + + if test "x$enable_encoder_simple" = xyes; then + COND_ENCODER_SIMPLE_TRUE= + COND_ENCODER_SIMPLE_FALSE='#' +else + COND_ENCODER_SIMPLE_TRUE='#' + COND_ENCODER_SIMPLE_FALSE= +fi + + if test "x$enable_decoder_simple" = xyes; then + COND_DECODER_SIMPLE_TRUE= + COND_DECODER_SIMPLE_FALSE='#' +else + COND_DECODER_SIMPLE_TRUE='#' + COND_DECODER_SIMPLE_FALSE= +fi + + +# LZ-based filters share common code. +enable_filter_lz=no +enable_encoder_lz=no +enable_decoder_lz=no +test "x$enable_filter_lzma1" = xyes && enable_filter_lz=yes +test "x$enable_encoder_lzma1" = xyes && enable_encoder_lz=yes +test "x$enable_decoder_lzma1" = xyes && enable_decoder_lz=yes +test "x$enable_filter_lzma2" = xyes && enable_filter_lz=yes +test "x$enable_encoder_lzma2" = xyes && enable_encoder_lz=yes +test "x$enable_decoder_lzma2" = xyes && enable_decoder_lz=yes + if test "x$enable_filter_lz" = xyes; then + COND_FILTER_LZ_TRUE= + COND_FILTER_LZ_FALSE='#' +else + COND_FILTER_LZ_TRUE='#' + COND_FILTER_LZ_FALSE= +fi + + if test "x$enable_encoder_lz" = xyes; then + COND_ENCODER_LZ_TRUE= + COND_ENCODER_LZ_FALSE='#' +else + COND_ENCODER_LZ_TRUE='#' + COND_ENCODER_LZ_FALSE= +fi + + if test "x$enable_decoder_lz" = xyes; then + COND_DECODER_LZ_TRUE= + COND_DECODER_LZ_FALSE='#' +else + COND_DECODER_LZ_TRUE='#' + COND_DECODER_LZ_FALSE= +fi + + + +################# +# Match finders # +################# + + + +enable_match_finder_hc3=no +enable_match_finder_hc4=no +enable_match_finder_bt2=no +enable_match_finder_bt3=no +enable_match_finder_bt4=no + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which match finders to build" >&5 +printf %s "checking which match finders to build... " >&6; } +# Check whether --enable-match-finders was given. +if test ${enable_match_finders+y} +then : + enableval=$enable_match_finders; +else $as_nop + enable_match_finders=hc3,hc4,bt2,bt3,bt4 +fi + +enable_match_finders=`echo "$enable_match_finders" | sed 's/,/ /g'` +if test "x$enable_encoder_lz" = xyes ; then + if test -z "$enable_match_finders"; then + as_fn_error $? "At least one match finder is required for an LZ-based encoder." "$LINENO" 5 + fi + + for arg in $enable_match_finders + do + case $arg in + hc3) + enable_match_finder_hc3=yes + +printf "%s\n" "#define HAVE_MF_HC3 1" >>confdefs.h + + ;; + hc4) + enable_match_finder_hc4=yes + +printf "%s\n" "#define HAVE_MF_HC4 1" >>confdefs.h + + ;; + bt2) + enable_match_finder_bt2=yes + +printf "%s\n" "#define HAVE_MF_BT2 1" >>confdefs.h + + ;; + bt3) + enable_match_finder_bt3=yes + +printf "%s\n" "#define HAVE_MF_BT3 1" >>confdefs.h + + ;; + bt4) + enable_match_finder_bt4=yes + +printf "%s\n" "#define HAVE_MF_BT4 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "unknown match finder: $arg" "$LINENO" 5 + ;; + esac + done + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_match_finders" >&5 +printf "%s\n" "$enable_match_finders" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (none because not building any LZ-based encoder)" >&5 +printf "%s\n" "(none because not building any LZ-based encoder)" >&6; } +fi + + +#################### +# Integrity checks # +#################### + + + +enable_check_crc32=no +enable_check_crc64=no +enable_check_sha256=no + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which integrity checks to build" >&5 +printf %s "checking which integrity checks to build... " >&6; } +# Check whether --enable-checks was given. +if test ${enable_checks+y} +then : + enableval=$enable_checks; +else $as_nop + enable_checks=crc32,crc64,sha256 +fi + +enable_checks=`echo "$enable_checks" | sed 's/,/ /g'` +if test "x$enable_checks" = xno || test "x$enable_checks" = x; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (none)" >&5 +printf "%s\n" "(none)" >&6; } +else + for arg in $enable_checks + do + case $arg in + crc32) + enable_check_crc32=yes + +printf "%s\n" "#define HAVE_CHECK_CRC32 1" >>confdefs.h + + ;; + crc64) + enable_check_crc64=yes + +printf "%s\n" "#define HAVE_CHECK_CRC64 1" >>confdefs.h + + ;; + sha256) + enable_check_sha256=yes + +printf "%s\n" "#define HAVE_CHECK_SHA256 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "unknown integrity check: $arg" "$LINENO" 5 + ;; + esac + done + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_checks" >&5 +printf "%s\n" "$enable_checks" >&6; } +fi +if test "x$enable_check_crc32" = xno ; then + as_fn_error $? "For now, the CRC32 check must always be enabled." "$LINENO" 5 +fi + + if test "x$enable_check_crc32" = xyes; then + COND_CHECK_CRC32_TRUE= + COND_CHECK_CRC32_FALSE='#' +else + COND_CHECK_CRC32_TRUE='#' + COND_CHECK_CRC32_FALSE= +fi + + if test "x$enable_check_crc64" = xyes; then + COND_CHECK_CRC64_TRUE= + COND_CHECK_CRC64_FALSE='#' +else + COND_CHECK_CRC64_TRUE='#' + COND_CHECK_CRC64_FALSE= +fi + + if test "x$enable_check_sha256" = xyes; then + COND_CHECK_SHA256_TRUE= + COND_CHECK_SHA256_FALSE='#' +else + COND_CHECK_SHA256_TRUE='#' + COND_CHECK_SHA256_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external SHA-256 should be used" >&5 +printf %s "checking if external SHA-256 should be used... " >&6; } +# Check whether --enable-external-sha256 was given. +if test ${enable_external_sha256+y} +then : + enableval=$enable_external_sha256; +else $as_nop + enable_external_sha256=no +fi + +if test "x$enable_check_sha256" != "xyes"; then + enable_external_sha256=no +fi +if test "x$enable_external_sha256" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +############# +# MicroLZMA # +############# + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if MicroLZMA support should be built" >&5 +printf %s "checking if MicroLZMA support should be built... " >&6; } +# Check whether --enable-microlzma was given. +if test ${enable_microlzma+y} +then : + enableval=$enable_microlzma; +else $as_nop + enable_microlzma=yes +fi + +case $enable_microlzma in + yes | no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_microlzma" >&5 +printf "%s\n" "$enable_microlzma" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "--enable-microlzma accepts only \`yes' or \`no'." "$LINENO" 5 + ;; +esac + if test "x$enable_microlzma" = xyes; then + COND_MICROLZMA_TRUE= + COND_MICROLZMA_FALSE='#' +else + COND_MICROLZMA_TRUE='#' + COND_MICROLZMA_FALSE= +fi + + + +############################# +# .lz (lzip) format support # +############################# + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if .lz (lzip) decompression support should be built" >&5 +printf %s "checking if .lz (lzip) decompression support should be built... " >&6; } +# Check whether --enable-lzip-decoder was given. +if test ${enable_lzip_decoder+y} +then : + enableval=$enable_lzip_decoder; +else $as_nop + enable_lzip_decoder=yes +fi + +if test "x$enable_decoder_lzma1" != xyes; then + enable_lzip_decoder=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no because LZMA1 decoder is disabled" >&5 +printf "%s\n" "no because LZMA1 decoder is disabled" >&6; } +elif test "x$enable_lzip_decoder" = xyes; then + +printf "%s\n" "#define HAVE_LZIP_DECODER 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$enable_lzip_decoder" = xyes; then + COND_LZIP_DECODER_TRUE= + COND_LZIP_DECODER_FALSE='#' +else + COND_LZIP_DECODER_TRUE='#' + COND_LZIP_DECODER_FALSE= +fi + + + +########################### +# Assembler optimizations # +########################### + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if assembler optimizations should be used" >&5 +printf %s "checking if assembler optimizations should be used... " >&6; } +# Check whether --enable-assembler was given. +if test ${enable_assembler+y} +then : + enableval=$enable_assembler; +else $as_nop + enable_assembler=yes +fi + +if test "x$enable_assembler" = xyes; then + enable_assembler=no + case $host_os in + # Darwin should work too but only if not creating universal + # binaries. Solaris x86 could work too but I cannot test. + linux* | *bsd* | mingw* | cygwin | msys | *djgpp*) + case $host_cpu in + i?86) enable_assembler=x86 ;; + esac + ;; + esac +fi +case $enable_assembler in + x86 | no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_assembler" >&5 +printf "%s\n" "$enable_assembler" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "--enable-assembler accepts only \`yes', \`no', or \`x86' (32-bit)." "$LINENO" 5 + ;; +esac + if test "x$enable_assembler" = xx86; then + COND_ASM_X86_TRUE= + COND_ASM_X86_FALSE='#' +else + COND_ASM_X86_TRUE='#' + COND_ASM_X86_FALSE= +fi + + + +############# +# CLMUL CRC # +############# + +# Check whether --enable-clmul-crc was given. +if test ${enable_clmul_crc+y} +then : + enableval=$enable_clmul_crc; +else $as_nop + enable_clmul_crc=yes +fi + + + +##################### +# Size optimization # +##################### + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if small size is preferred over speed" >&5 +printf %s "checking if small size is preferred over speed... " >&6; } +# Check whether --enable-small was given. +if test ${enable_small+y} +then : + enableval=$enable_small; +else $as_nop + enable_small=no +fi + +if test "x$enable_small" = xyes; then + +printf "%s\n" "#define HAVE_SMALL 1" >>confdefs.h + +elif test "x$enable_small" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "--enable-small accepts only \`yes' or \`no'" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_small" >&5 +printf "%s\n" "$enable_small" >&6; } + if test "x$enable_small" = xyes; then + COND_SMALL_TRUE= + COND_SMALL_FALSE='#' +else + COND_SMALL_TRUE='#' + COND_SMALL_FALSE= +fi + + + +############# +# Threading # +############# + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if threading support is wanted" >&5 +printf %s "checking if threading support is wanted... " >&6; } +# Check whether --enable-threads was given. +if test ${enable_threads+y} +then : + enableval=$enable_threads; +else $as_nop + enable_threads=yes +fi + + +if test "x$enable_threads" = xyes; then + case $host_os in + mingw*) + case $host_cpu in + i?86) enable_threads=win95 ;; + *) enable_threads=vista ;; + esac + ;; + *) + enable_threads=posix + ;; + esac +fi + +case $enable_threads in + posix | win95 | vista) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes, $enable_threads" >&5 +printf "%s\n" "yes, $enable_threads" >&6; } + ;; + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "--enable-threads only accepts \`yes', \`no', \`posix', \`win95', or \`vista'" "$LINENO" 5 + ;; +esac + +# We use the actual result a little later. + + +######################### +# Assumed amount of RAM # +######################### + +# We use 128 MiB as default, because it will allow decompressing files +# created with "xz -9". It would be slightly safer to guess a lower value, +# but most systems, on which we don't have any way to determine the amount +# of RAM, will probably have at least 128 MiB of RAM. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how much RAM to assume if the real amount is unknown" >&5 +printf %s "checking how much RAM to assume if the real amount is unknown... " >&6; } +# Check whether --enable-assume-ram was given. +if test ${enable_assume_ram+y} +then : + enableval=$enable_assume_ram; +else $as_nop + enable_assume_ram=128 +fi + +assume_ram_check=`echo "$enable_assume_ram" | tr -d 0123456789` +if test -z "$enable_assume_ram" || test -n "$assume_ram_check"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "--enable-assume-ram accepts only an integer argument" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_assume_ram MiB" >&5 +printf "%s\n" "$enable_assume_ram MiB" >&6; } + +printf "%s\n" "#define ASSUME_RAM $enable_assume_ram" >>confdefs.h + + + +######################### +# Components to install # +######################### + +# Check whether --enable-xz was given. +if test ${enable_xz+y} +then : + enableval=$enable_xz; +else $as_nop + enable_xz=yes +fi + + if test x$enable_xz != xno; then + COND_XZ_TRUE= + COND_XZ_FALSE='#' +else + COND_XZ_TRUE='#' + COND_XZ_FALSE= +fi + + +# Check whether --enable-xzdec was given. +if test ${enable_xzdec+y} +then : + enableval=$enable_xzdec; +else $as_nop + enable_xzdec=yes +fi + +test "x$enable_decoders" = xno && enable_xzdec=no + if test x$enable_xzdec != xno; then + COND_XZDEC_TRUE= + COND_XZDEC_FALSE='#' +else + COND_XZDEC_TRUE='#' + COND_XZDEC_FALSE= +fi + + +# Check whether --enable-lzmadec was given. +if test ${enable_lzmadec+y} +then : + enableval=$enable_lzmadec; +else $as_nop + enable_lzmadec=yes +fi + +test "x$enable_decoder_lzma1" = xno && enable_lzmadec=no + if test x$enable_lzmadec != xno; then + COND_LZMADEC_TRUE= + COND_LZMADEC_FALSE='#' +else + COND_LZMADEC_TRUE='#' + COND_LZMADEC_FALSE= +fi + + +# Check whether --enable-lzmainfo was given. +if test ${enable_lzmainfo+y} +then : + enableval=$enable_lzmainfo; +else $as_nop + enable_lzmainfo=yes +fi + +test "x$enable_decoder_lzma1" = xno && enable_lzmainfo=no + if test x$enable_lzmainfo != xno; then + COND_LZMAINFO_TRUE= + COND_LZMAINFO_FALSE='#' +else + COND_LZMAINFO_TRUE='#' + COND_LZMAINFO_FALSE= +fi + + +# Check whether --enable-lzma-links was given. +if test ${enable_lzma_links+y} +then : + enableval=$enable_lzma_links; +else $as_nop + enable_lzma_links=yes +fi + + if test x$enable_lzma_links != xno; then + COND_LZMALINKS_TRUE= + COND_LZMALINKS_FALSE='#' +else + COND_LZMALINKS_TRUE='#' + COND_LZMALINKS_FALSE= +fi + + +# Check whether --enable-scripts was given. +if test ${enable_scripts+y} +then : + enableval=$enable_scripts; +else $as_nop + enable_scripts=yes +fi + + if test x$enable_scripts != xno; then + COND_SCRIPTS_TRUE= + COND_SCRIPTS_FALSE='#' +else + COND_SCRIPTS_TRUE='#' + COND_SCRIPTS_FALSE= +fi + + +# Check whether --enable-doc was given. +if test ${enable_doc+y} +then : + enableval=$enable_doc; +else $as_nop + enable_doc=yes +fi + + if test x$enable_doc != xno; then + COND_DOC_TRUE= + COND_DOC_FALSE='#' +else + COND_DOC_TRUE='#' + COND_DOC_FALSE= +fi + + + +############## +# Sandboxing # +############## + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sandboxing should be used" >&5 +printf %s "checking if sandboxing should be used... " >&6; } +# Check whether --enable-sandbox was given. +if test ${enable_sandbox+y} +then : + enableval=$enable_sandbox; +else $as_nop + enable_sandbox=auto +fi + +case $enable_sandbox in + auto) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: maybe (autodetect)" >&5 +printf "%s\n" "maybe (autodetect)" >&6; } + ;; + no | capsicum | pledge) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_sandbox" >&5 +printf "%s\n" "$enable_sandbox" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? "--enable-sandbox only accepts \`auto', \`no', \`capsicum', or \`pledge'." "$LINENO" 5 + ;; +esac + + +########################### +# PATH prefix for scripts # +########################### + +# The scripts can add a prefix to the search PATH so that POSIX tools +# or the xz binary is always in the PATH. +# Check whether --enable-path-for-scripts was given. +if test ${enable_path_for_scripts+y} +then : + enableval=$enable_path_for_scripts; +else $as_nop + + case $host_os in + solaris*) enable_path_for_scripts=/usr/xpg4/bin ;; + *) enable_path_for_scripts= ;; + esac + +fi + +if test -n "$enable_path_for_scripts" && test "x$enable_path_for_scripts" != xno ; then + enable_path_for_scripts="PATH=$enable_path_for_scripts:\$PATH" +else + enable_path_for_scripts= +fi + + + +############################################################################### +# Checks for programs. +############################################################################### + +echo +case $host_os in + solaris*) + # The gnulib POSIX shell macro below may pick a shell that + # doesn't work with xzgrep. Workaround by picking a shell + # that is known to work. + if test -z "$gl_cv_posix_shell" && test -x /usr/xpg4/bin/sh; then + gl_cv_posix_shell=/usr/xpg4/bin/sh + fi + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a shell that conforms to POSIX" >&5 +printf %s "checking for a shell that conforms to POSIX... " >&6; } +if test ${gl_cv_posix_shell+y} +then : + printf %s "(cached) " >&6 +else $as_nop + gl_test_posix_shell_script=' + func_return () { + (exit $1) + } + func_success () { + func_return 0 + } + func_failure () { + func_return 1 + } + func_ret_success () { + return 0 + } + func_ret_failure () { + return 1 + } + subshell_umask_sanity () { + (umask 22; (umask 0); test $(umask) -eq 22) + } + test "$(echo foo)" = foo && + func_success && + ! func_failure && + func_ret_success && + ! func_ret_failure && + (set x && func_ret_success y && test x = "$1") && + subshell_umask_sanity + ' + for gl_cv_posix_shell in \ + "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do + case $gl_cv_posix_shell in + /*) + "$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \ + && break;; + esac + done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_posix_shell" >&5 +printf "%s\n" "$gl_cv_posix_shell" >&6; } + + if test "$gl_cv_posix_shell" != no; then + POSIX_SHELL=$gl_cv_posix_shell + PREFERABLY_POSIX_SHELL=$POSIX_SHELL + else + POSIX_SHELL= + PREFERABLY_POSIX_SHELL=/bin/sh + fi + + + +if test -z "$POSIX_SHELL" && test "x$enable_scripts" = xyes ; then + as_fn_error $? "No POSIX conforming shell (sh) was found." "$LINENO" 5 +fi + +echo +echo "Initializing Automake:" + +# We don't use "subdir-objects" yet because it breaks "make distclean" when +# dependencies are enabled (as of Automake 1.14.1) due to this bug: +# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=17354 +# The -Wno-unsupported is used to silence warnings about missing +# "subdir-objects". +am__api_version='1.16' + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# 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. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + 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+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +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 + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + 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 + + +# Define the identity of the package. + PACKAGE='xz' + VERSION='5.4.5' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + + + + + + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +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 +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$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 | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +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' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +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 | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else $as_nop + ac_file='' +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +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 | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { 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:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +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:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +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 | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +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 + + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +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 + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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". + rm -rf conftest.dir + 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_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +if test x$ac_cv_prog_cc_c99 = xno ; then + as_fn_error $? "No C99 compiler was found." "$LINENO" 5 +fi + + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + +depcc="$CCAS" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CCAS_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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". + rm -rf conftest.dir + 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_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + 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 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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_CCAS_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CCAS_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' +else + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= +fi + + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else $as_nop + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_should_define__xopen_source=no + if test $ac_cv_header_wchar_h = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + + printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + if test $ac_cv_header_minix_config_h = yes +then : + MINIX=yes + printf "%s\n" "#define _MINIX 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + +else $as_nop + MINIX= +fi + if test $ac_cv_safe_to_define___extensions__ = yes +then : + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + +fi + if test $ac_cv_should_define__xopen_source = yes +then : + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + { ac_script=; unset 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + as_fn_executable_p "$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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + 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 + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "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+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + as_fn_executable_p "$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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + 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_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + as_fn_executable_p "$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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + 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_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +case $enable_threads in #( + posix) : + + echo + echo "POSIX threading support:" + + + + +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 + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + if test "x$PTHREAD_CC" != "x" +then : + CC="$PTHREAD_CC" +fi + if test "x$PTHREAD_CXX" != "x" +then : + CXX="$PTHREAD_CXX" +fi + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 +printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char pthread_join (); +int +main (void) +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 +printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} +fi +rm -rf conftest* + + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" + ;; +esac + +# Are we compiling with Clang? + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 +printf %s "checking whether $CC is Clang... " >&6; } +if test ${ax_cv_PTHREAD_CLANG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 +then : + ax_cv_PTHREAD_CLANG=yes +fi +rm -rf conftest* + + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 +printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC + +if test "x$GCC" = "xyes" +then : + ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" +fi + +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + +if test "x$ax_pthread_clang" = "xyes" +then : + ax_pthread_flags="-pthread,-lpthread -pthread" +fi + + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +if test "x$ax_pthread_check_macro" = "x--" +then : + ax_pthread_check_cond=0 +else $as_nop + ax_pthread_check_cond="!defined($ax_pthread_check_macro)" +fi + + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +printf %s "checking whether pthreads work without any flags... " >&6; } + ;; + + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5 +printf %s "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; } + ;; + + -*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 +printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ax_pthread_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +printf "%s\n" "$ax_pthread_config" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test "x$ax_pthread_config" = "xno" +then : + continue +fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 +printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } + static void *start_routine(void *a) { return a; } +int +main (void) +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xyes" +then : + break +fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 +printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } +if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`printf "%s\n" "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + if test "x$ax_pthread_try" = "xunknown" +then : + break +fi + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_link="$ax_pthread_2step_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + if test "x$ax_pthread_try" = "x" +then : + ax_pthread_try=no +fi + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 +printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + + + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +printf %s "checking for joinable pthread attribute... " >&6; } +if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int attr = $ax_pthread_attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 +printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } + if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes" +then : + +printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h + + ax_pthread_joinable_attr_defined=yes + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 +printf %s "checking whether more special flags are required for pthreads... " >&6; } +if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 +printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } + if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes" +then : + PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int i = PTHREAD_PRIO_INHERIT; + return i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_PTHREAD_PRIO_INHERIT=yes +else $as_nop + ax_cv_PTHREAD_PRIO_INHERIT=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes" +then : + +printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h + + ax_pthread_prio_inherit_defined=yes + +fi + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $host_os in + aix*) + case "x/$CC" in #( + x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : + #handle absolute path differently from PATH based program lookup + case "x$CC" in #( + x/*) : + + if as_fn_executable_p ${CC}_r +then : + PTHREAD_CC="${CC}_r" +fi + if test "x${CXX}" != "x" +then : + if as_fn_executable_p ${CXX}_r +then : + PTHREAD_CXX="${CXX}_r" +fi +fi + ;; #( + *) : + + for ac_prog in ${CC}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PTHREAD_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +printf "%s\n" "$PTHREAD_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + + if test "x${CXX}" != "x" +then : + for ac_prog in ${CXX}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PTHREAD_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PTHREAD_CXX"; then + ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX +if test -n "$PTHREAD_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 +printf "%s\n" "$PTHREAD_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$PTHREAD_CXX" && break +done +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" + +fi + + ;; +esac + ;; #( + *) : + ;; +esac + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" + + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + : + : +else + ax_pthread_ok=no + +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 + + LIBS="$LIBS $PTHREAD_LIBS" + AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" + + + +printf "%s\n" "#define MYTHREAD_POSIX 1" >>confdefs.h + + + # These are nice to have but not mandatory. + # + # FIXME: xz uses clock_gettime if it is available and can do + # it even when threading is disabled. Moving this outside + # of pthread detection may be undesirable because then + # liblzma may get linked against librt even when librt isn't + # needed by liblzma. + OLD_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +printf %s "checking for library containing clock_gettime... " >&6; } +if test ${ac_cv_search_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char clock_gettime (); +int +main (void) +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt +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 + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_clock_gettime+y} +then : + break +fi +done +if test ${ac_cv_search_clock_gettime+y} +then : + +else $as_nop + ac_cv_search_clock_gettime=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pthread_condattr_setclock" "ac_cv_func_pthread_condattr_setclock" +if test "x$ac_cv_func_pthread_condattr_setclock" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1" >>confdefs.h + +fi + + ac_fn_check_decl "$LINENO" "CLOCK_MONOTONIC" "ac_cv_have_decl_CLOCK_MONOTONIC" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_CLOCK_MONOTONIC" = xyes +then : + +printf "%s\n" "#define HAVE_CLOCK_MONOTONIC 1" >>confdefs.h + +fi + CFLAGS=$OLD_CFLAGS + ;; #( + win95) : + + +printf "%s\n" "#define MYTHREAD_WIN95 1" >>confdefs.h + + ;; #( + vista) : + + +printf "%s\n" "#define MYTHREAD_VISTA 1" >>confdefs.h + + + ;; #( + *) : + ;; +esac + if test "x$enable_threads" != xno; then + COND_THREADS_TRUE= + COND_THREADS_FALSE='#' +else + COND_THREADS_TRUE='#' + COND_THREADS_FALSE= +fi + + +echo +echo "Initializing Libtool:" + +case `pwd` in + *\ * | *\ *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.7.4-1ec8f-dirty' +macro_revision='2.4.7.4' + + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify 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' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + { ac_script=; unset 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + as_fn_executable_p "$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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + 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 + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + as_fn_executable_p "$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 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + 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 + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "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 yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + 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, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + 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/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$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`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +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 + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_reload_flag='-r' +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$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 + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; 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}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +# that 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='$FILECMD -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 + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + 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* | midnightbsd*) + 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=$FILECMD + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=$FILECMD + 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])(-bit)?( [LM]SB)? 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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | 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=$FILECMD + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +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}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + + + + + + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# 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"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$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"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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 + ;; +esac + +# 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++ or ICC, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,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 + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + 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 <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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 +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test ${with_sysroot+y} +then : + withval=$with_sysroot; +else $as_nop + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test ${enable_libtool_lock+y} +then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `$FILECMD 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* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `$FILECMD conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + 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" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + 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" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_cc_needs_belf=yes +else $as_nop + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + 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 + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_ld_exported_symbols_list=yes +else $as_nop + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&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*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi + + + + + +# Set options +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +printf "%s\n" "$AS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +printf "%s\n" "$ac_ct_AS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test ${enable_shared+y} +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 $as_nop + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test ${enable_static+y} +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 $as_nop + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test ${with_pic+y} +then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test ${enable_fast_install+y} +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 $as_nop + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# 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 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h + + + + +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 set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.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 "$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 + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +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 + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$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);}' + + + + + + + +# 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 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 +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* + +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 -r conftest* + + +## 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... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + 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* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + 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. + ;; + + 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=no + 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 + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + 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' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-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='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # 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' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # 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='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + 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' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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" ## exclude from sc_useless_quotes_in_assignment + # 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_pic_works=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$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 + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_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_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + 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= + # 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='_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= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; 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='$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= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + 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 + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + 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' + export_dynamic_flag_spec='$wl--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + 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, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + file_list_spec='@' + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$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='$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='$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' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + 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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # 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; func_echo_all \"$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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + 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; func_echo_all \"$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 yes = "$supports_anon_versioning"; 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 + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # 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='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; 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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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=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 +*** 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. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** 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 + ;; + *) + # 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 + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$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=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + 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='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; 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 + 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 + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + 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 + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # 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. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_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 "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; 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. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_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 "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$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=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + 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* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl* | icl*) + # Native MSVC or ICC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # 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='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC and ICC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=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='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + 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*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=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='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly* | midnightbsd*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$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 + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $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='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + 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, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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. + # This should be the same for all languages, so no per-tag cache variable. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_irix_exported_symbol=yes +else $as_nop + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -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 + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + 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 + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + 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__`"; 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 + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + file_list_spec='@' + ;; + + osf3*) + if test yes = "$GCC"; 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" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -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=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; 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 "-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='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $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 $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + 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 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 yes = "$GCC"; 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 + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + 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 + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + 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,$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 + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT 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='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + 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 yes = "$GCC"; then + 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,$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 + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds 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. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$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=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # 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` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + 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" + elif test -n "$lt_multi_os_dir"; then + 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; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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 # correct to gnu/linux during the next big refactor + 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' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; 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 + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.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' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # 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' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + 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~ + 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' + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl* | *,icl*) + # Native MSVC or ICC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC and ICC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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$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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + ;; + +freebsd* | dragonfly* | midnightbsd*) + # 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[23].*) 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$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + 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 + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + 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 + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # 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 + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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 + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + 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;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' + ;; + +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 # correct to gnu/linux during the next big refactor + 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=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=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + 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 + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + 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~ + 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' + ;; + +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 + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + 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 # correct to gnu/linux during the next big refactor + 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=sco + 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 + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + 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' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + 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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes +then : + lt_cv_dlopen=shl_load +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char shl_load (); +int +main (void) +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_shl_load=yes +else $as_nop + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else $as_nop + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes +then : + lt_cv_dlopen=dlopen +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_svld_dlopen=yes +else $as_nop + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char dld_link (); +int +main (void) +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_dld_link=yes +else $as_nop + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; 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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; 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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi +fi + + + + + + + + + + + + + # Report what library types will actually be built + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } + + + + +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 + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RC"; then + ac_cv_prog_RC="$RC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RC="${ac_tool_prefix}windres" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RC=$ac_cv_prog_RC +if test -n "$RC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 +printf "%s\n" "$RC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RC"; then + ac_ct_RC=$RC + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RC"; then + ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RC="windres" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RC=$ac_cv_prog_ac_ct_RC +if test -n "$ac_ct_RC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 +printf "%s\n" "$ac_ct_RC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RC" = x; then + RC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RC=$ac_ct_RC + fi +else + RC="$ac_cv_prog_RC" +fi + + + + +# 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 }' + +# 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 +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* + +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 -r conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +compiler_RC=$CC +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + +lt_cv_prog_compiler_c_o_RC=yes + +if test -n "$compiler"; then + : + + + +fi + +GCC=$lt_save_GCC +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 +CFLAGS=$lt_save_CFLAGS + + +# This is a bit wrong since it is possible to request that only some libs +# are built as shared. Using that feature isn't so common though, and this +# breaks only on Windows (at least for now) if the user enables only some +# libs as shared. + if test "x$enable_shared" != xno; then + COND_SHARED_TRUE= + COND_SHARED_FALSE='#' +else + COND_SHARED_TRUE='#' + COND_SHARED_FALSE= +fi + + +##################### +# Symbol versioning # +##################### + +# NOTE: This checks if we are building shared or static library +# and if --with-pic or --without-pic was used. Thus this check +# must be after Libtool initialization. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if library symbol versioning should be used" >&5 +printf %s "checking if library symbol versioning should be used... " >&6; } +# Check whether --enable-symbol-versions was given. +if test ${enable_symbol_versions+y} +then : + enableval=$enable_symbol_versions; +else $as_nop + enable_symbol_versions=auto +fi + +if test "x$enable_symbol_versions" = xauto; then + case $host_os in + # NOTE: Even if one omits -gnu on GNU/Linux (e.g. + # i486-slackware-linux), configure will (via config.sub) + # append -gnu (e.g. i486-slackware-linux-gnu), and this + # test will work correctly. + gnu* | *-gnu* | freebsd*) + enable_symbol_versions=yes + ;; + *) + enable_symbol_versions=no + ;; + esac +fi + +# There are two variants for symbol versioning. +# See src/liblzma/validate_map.sh for details. +# +# On GNU/Linux, extra symbols are added in the C code. These extra symbols +# must not be put into a static library as they can cause problems (and +# even if they didn't cause problems, they would be useless). On other +# systems symbol versioning may be used too but there is no problem as only +# a linker script is specified in src/liblzma/Makefile.am and that isn't +# used when creating a static library. +# +# Libtool always uses -DPIC when building shared libraries by default and +# doesn't use it for static libs by default. This can be overridden with +# --with-pic and --without-pic though. As long as neither --with-pic nor +# --without-pic is used then we can use #ifdef PIC to detect if the file is +# being built for a shared library. +if test "x$enable_symbol_versions" = xno ; then + enable_symbol_versions=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +elif test "x$enable_shared" = xno ; then + enable_symbol_versions=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (not building a shared library)" >&5 +printf "%s\n" "no (not building a shared library)" >&6; } +else + case "$host_cpu-$host_os" in + microblaze*) + # GCC 12 on MicroBlaze doesn't support __symver__ + # attribute. It's simplest and safest to use the + # generic version on that platform since then only + # the linker script is needed. The RHEL/CentOS 7 + # compatibility symbols don't matter on MicroBlaze. + enable_symbol_versions=generic + ;; + *-linux*) + case "$pic_mode-$enable_static" in + default-*) + # Use symvers if PIC is defined. + have_symbol_versions_linux=2 + ;; + *-no) + # Not building static library. + # Use symvers unconditionally. + have_symbol_versions_linux=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } + as_fn_error $? " + On GNU/Linux, building both shared and static library at the same time + is not supported if --with-pic or --without-pic is used. + Use either --disable-shared or --disable-static to build one type + of library at a time. If both types are needed, build one at a time, + possibly picking only src/liblzma/.libs/liblzma.a from the static build." "$LINENO" 5 + ;; + esac + enable_symbol_versions=linux + +printf "%s\n" "#define HAVE_SYMBOL_VERSIONS_LINUX $have_symbol_versions_linux" >>confdefs.h + + ;; + *) + enable_symbol_versions=generic + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ($enable_symbol_versions)" >&5 +printf "%s\n" "yes ($enable_symbol_versions)" >&6; } +fi + + if test "x$enable_symbol_versions" = xlinux; then + COND_SYMVERS_LINUX_TRUE= + COND_SYMVERS_LINUX_FALSE='#' +else + COND_SYMVERS_LINUX_TRUE='#' + COND_SYMVERS_LINUX_FALSE= +fi + + if test "x$enable_symbol_versions" = xgeneric; then + COND_SYMVERS_GENERIC_TRUE= + COND_SYMVERS_GENERIC_FALSE='#' +else + COND_SYMVERS_GENERIC_TRUE='#' + COND_SYMVERS_GENERIC_FALSE= +fi + + + +############################################################################### +# Checks for libraries. +############################################################################### + +echo +echo "Initializing gettext:" + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else $as_nop + USE_NLS=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.20 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + 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 + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + 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 + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + 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 + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' + else + if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' + else + MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' + fi + fi + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + 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 + +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +printf %s "checking for ld... " >&6; } +elif test "$GCC" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_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 `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + sparc64-*-netbsd*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # The compiler produces 32-bit code. Add option '-m elf32_sparc' + # so that the linker groks 32-bit object files. + case "$acl_cv_path_LD " in + *" -m elf32_sparc "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;; + esac + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + esac + +fi + + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else $as_nop + enable_rpath=yes +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5 +printf %s "checking 32-bit host C ABI... " >&6; } +if test ${gl_cv_host_cpu_c_abi_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$gl_cv_host_cpu_c_abi"; then + case "$gl_cv_host_cpu_c_abi" in + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + gl_cv_host_cpu_c_abi_32bit=yes ;; + x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) + gl_cv_host_cpu_c_abi_32bit=no ;; + *) + gl_cv_host_cpu_c_abi_32bit=unknown ;; + esac + else + case "$host_cpu" in + + # CPUs that only support a 32-bit ABI. + arc \ + | bfin \ + | cris* \ + | csky \ + | epiphany \ + | ft32 \ + | h8300 \ + | m68k \ + | microblaze | microblazeel \ + | nds32 | nds32le | nds32be \ + | nios2 | nios2eb | nios2el \ + | or1k* \ + | or32 \ + | sh | sh1234 | sh1234elb \ + | tic6x \ + | xtensa* ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + # CPUs that only support a 64-bit ABI. + alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ + | mmix ) + gl_cv_host_cpu_c_abi_32bit=no + ;; + + i[34567]86 ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + x86_64 ) + # On x86_64 systems, the C compiler may be generating code in one of + # these ABIs: + # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. + # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 + # with native Windows (mingw, MSVC). + # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if (defined __x86_64__ || defined __amd64__ \ + || defined _M_X64 || defined _M_AMD64) \ + && !(defined __ILP32__ || defined _ILP32) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + arm* | aarch64 ) + # Assume arm with EABI. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) + # On hppa, the C compiler may be generating 32-bit code or 64-bit + # code. In the latter case, it defines _LP64 and __LP64__. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + ia64* ) + # On ia64 on HP-UX, the C compiler may be generating 64-bit code or + # 32-bit code. In the latter case, it defines _ILP32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef _ILP32 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=yes +else $as_nop + gl_cv_host_cpu_c_abi_32bit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + mips* ) + # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this + # at 32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + powerpc* ) + # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. + # No need to distinguish them here; the caller may distinguish + # them based on the OS. + # On powerpc64 systems, the C compiler may still be generating + # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may + # be generating 64-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + rs6000 ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + riscv32 | riscv64 ) + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. + # Size of 'long' and 'void *': + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + s390* ) + # On s390x, the C compiler may be generating 64-bit (= s390x) code + # or 31-bit (= s390) code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __s390x__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + sparc | sparc64 ) + # UltraSPARCs running Linux have `uname -m` = "sparc64", but the + # C compiler still generates 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + *) + gl_cv_host_cpu_c_abi_32bit=unknown + ;; + esac + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5 +printf "%s\n" "$gl_cv_host_cpu_c_abi_32bit" >&6; } + + HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit" + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5 +printf %s "checking for ELF binary format... " >&6; } +if test ${gl_cv_elf+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __ELF__ || (defined __linux__ && defined __EDG__) + Extensible Linking Format + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Extensible Linking Format" >/dev/null 2>&1 +then : + gl_cv_elf=yes +else $as_nop + gl_cv_elf=no +fi +rm -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5 +printf "%s\n" "$gl_cv_elf" >&6; } + if test $gl_cv_elf = yes; then + # Extract the ELF class of a file (5th byte) in decimal. + # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header + if od -A x < /dev/null >/dev/null 2>/dev/null; then + # Use POSIX od. + func_elfclass () + { + od -A n -t d1 -j 4 -N 1 + } + else + # Use BSD hexdump. + func_elfclass () + { + dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' + echo + } + fi + # Use 'expr', not 'test', to compare the values of func_elfclass, because on + # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002, + # not 1 or 2. + case $HOST_CPU_C_ABI_32BIT in + yes) + # 32-bit ABI. + acl_is_expected_elfclass () + { + expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null + } + ;; + no) + # 64-bit ABI. + acl_is_expected_elfclass () + { + expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null + } + ;; + *) + # Unknown. + acl_is_expected_elfclass () + { + : + } + ;; + esac + else + acl_is_expected_elfclass () + { + : + } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +printf %s "checking for the common suffixes of directories in the library search path... " >&6; } +if test ${acl_cv_libdirstems+y} +then : + printf %s "(cached) " >&6 +else $as_nop + acl_libdirstem=lib + acl_libdirstem2= + acl_libdirstem3= + case "$host_os" in + solaris*) + if test $HOST_CPU_C_ABI_32BIT = no; then + acl_libdirstem2=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem3=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test $HOST_CPU_C_ABI_32BIT != no; then + # 32-bit or unknown ABI. + if test -d /usr/lib32; then + acl_libdirstem2=lib32 + fi + fi + if test $HOST_CPU_C_ABI_32BIT != yes; then + # 64-bit or unknown ABI. + if test -d /usr/lib64; then + acl_libdirstem3=lib64 + fi + fi + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; + */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib32 ) acl_libdirstem2=lib32 ;; + */lib64 ) acl_libdirstem3=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + if test $HOST_CPU_C_ABI_32BIT = yes; then + # 32-bit ABI. + acl_libdirstem3= + fi + if test $HOST_CPU_C_ABI_32BIT = no; then + # 64-bit ABI. + acl_libdirstem2= + fi + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +printf "%s\n" "$acl_cv_libdirstems" >&6; } + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` + acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test ${with_libiconv_prefix+y} +then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + additional_libdir2="$withval/$acl_libdirstem2" + additional_libdir3="$withval/$acl_libdirstem3" + fi + fi + +fi + + if test "X$additional_libdir2" = "X$additional_libdir"; then + additional_libdir2= + fi + if test "X$additional_libdir3" = "X$additional_libdir"; then + additional_libdir3= + fi + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do + if test "X$found_dir" = "X"; then + eval dir=\$$additional_libdir_variable + if test -n "$dir"; then + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + fi + done + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem3 | */$acl_libdirstem3/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then + haveit= + if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$dependency_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$dependency_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$dependency_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$dependency_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dep=`echo "X$dep" | sed -e 's/^X-l//'` + if test "X$dep" != Xc \ + || case $host_os in + linux* | gnu* | k*bsd*-gnu) false ;; + *) true ;; + esac; then + names_next_round="$names_next_round $dep" + fi + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(cached) " >&6 +else $as_nop + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else $as_nop + gt_cv_func_CFPreferencesCopyAppValue=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5 +printf %s "checking for CFLocaleCopyPreferredLanguages... " >&6; } +if test ${gt_cv_func_CFLocaleCopyPreferredLanguages+y} +then : + printf %s "(cached) " >&6 +else $as_nop + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFLocaleCopyPreferredLanguages(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFLocaleCopyPreferredLanguages=yes +else $as_nop + gt_cv_func_CFLocaleCopyPreferredLanguages=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; } + if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + +printf "%s\n" "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ + || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if eval test \${$gt_func_gnugettext_libc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libc=yes" +else $as_nop + eval "$gt_func_gnugettext_libc=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$gt_func_gnugettext_libc + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from + successful returns. This is even documented in + */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + { + /* Try standardized names. */ + iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); + /* Try IRIX, OSF/1 names. */ + iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); + /* Try AIX names. */ + iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); + /* Try HP-UX names. */ + iconv_t cd4 = iconv_open ("utf8", "eucJP"); + if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) + && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) + result |= 16; + if (cd1 != (iconv_t)(-1)) + iconv_close (cd1); + if (cd2 != (iconv_t)(-1)) + iconv_close (cd2); + if (cd3 != (iconv_t)(-1)) + iconv_close (cd3); + if (cd4 != (iconv_t)(-1)) + iconv_close (cd4); + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test ${with_libintl_prefix+y} +then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + additional_libdir2="$withval/$acl_libdirstem2" + additional_libdir3="$withval/$acl_libdirstem3" + fi + fi + +fi + + if test "X$additional_libdir2" = "X$additional_libdir"; then + additional_libdir2= + fi + if test "X$additional_libdir3" = "X$additional_libdir"; then + additional_libdir3= + fi + LIBINTL= + LTLIBINTL= + INCINTL= + LIBINTL_PREFIX= + HAVE_LIBINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do + if test "X$found_dir" = "X"; then + eval dir=\$$additional_libdir_variable + if test -n "$dir"; then + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + fi + done + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem3 | */$acl_libdirstem3/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then + haveit= + if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$dependency_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$dependency_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$dependency_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$dependency_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dep=`echo "X$dep" | sed -e 's/^X-l//'` + if test "X$dep" != Xc \ + || case $host_os in + linux* | gnu* | k*bsd*-gnu) false ;; + *) true ;; + esac; then + names_next_round="$names_next_round $dep" + fi + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if eval test \${$gt_func_gnugettext_libintl+y} +then : + printf %s "(cached) " >&6 +else $as_nop + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libintl=yes" +else $as_nop + eval "$gt_func_gnugettext_libintl=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +eval ac_res=\$$gt_func_gnugettext_libintl + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + fi + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + + +############################################################################### +# Checks for header files. +############################################################################### + +echo +echo "System headers and functions:" + +# There is currently no workarounds in this package if some of +# these headers are missing. + for ac_header in fcntl.h limits.h sys/time.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else $as_nop + as_fn_error $? "Required header file(s) are missing." "$LINENO" 5 +fi + +done + +# immintrin.h allows the use of the intrinsic functions if they are available. +# cpuid.h may be used for detecting x86 processor features at runtime. +ac_fn_c_check_header_compile "$LINENO" "immintrin.h" "ac_cv_header_immintrin_h" "$ac_includes_default" +if test "x$ac_cv_header_immintrin_h" = xyes +then : + printf "%s\n" "#define HAVE_IMMINTRIN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "cpuid.h" "ac_cv_header_cpuid_h" "$ac_includes_default" +if test "x$ac_cv_header_cpuid_h" = xyes +then : + printf "%s\n" "#define HAVE_CPUID_H 1" >>confdefs.h + +fi + + + +############################################################################### +# Checks for typedefs, structures, and compiler characteristics. +############################################################################### + +ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" + #endif + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ + + #if !true + #error "'true' is not true" + #endif + #if true != 1 + #error "'true' is not equal to 1" + #endif + char b[true == 1 ? 1 : -1]; + char c[true]; + + #if false + #error "'false' is not false" + #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; + + enum { e = false, f = true, g = false * true, h = true * 256 }; + + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; + + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; + + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + bool p = true; + bool *pp = &p; + + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif + + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; + + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; + + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif + +int +main (void) +{ + + bool ps = &s; + *pp |= p; + *pp |= ! p; + + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif + + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_stdbool_h=yes +else $as_nop + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } + +if test $ac_cv_header_stdbool_h = yes; then + +printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT8_T 1" >>confdefs.h + + +printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h +;; + esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h +;; +esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT32_T 1" >>confdefs.h + + +printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h +;; + esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h +;; +esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +printf "%s\n" "#define _UINT64_T 1" >>confdefs.h + + +printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h +;; + esac + + + ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes +then : + +printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h + +else $as_nop + for ac_type in 'unsigned int' 'unsigned long int' \ + 'unsigned long long int'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define uintptr_t $ac_type" >>confdefs.h + + ac_type= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test -z "$ac_type" && break + done +fi + + + +# 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. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +printf %s "checking size of size_t... " >&6; } +if test ${ac_cv_sizeof_size_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" +then : + +else $as_nop + if test "$ac_cv_type_size_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (size_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_size_t=0 + fi +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +printf "%s\n" "$ac_cv_sizeof_size_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t" >>confdefs.h + + + +# The command line tool can copy high resolution timestamps if such +# information is available in struct stat. Otherwise one second accuracy +# is used. +ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1" >>confdefs.h + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1" >>confdefs.h + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1" >>confdefs.h + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_uatime" "ac_cv_member_struct_stat_st_uatime" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_uatime" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_UATIME 1" >>confdefs.h + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1" >>confdefs.h + + +fi + + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main (void) +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else $as_nop + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +# __attribute__((__constructor__)) can be used for one-time initializations. +# Use -Werror because some compilers accept unknown attributes and just +# give a warning. +# +# FIXME? Unfortunately -Werror can cause trouble if CFLAGS contains options +# that produce warnings for unrelated reasons. For example, GCC and Clang +# support -Wunused-macros which will warn about "#define _GNU_SOURCE 1" +# which will be among the #defines that Autoconf inserts to the beginning of +# the test program. There seems to be no nice way to prevent Autoconf from +# inserting the any defines to the test program. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if __attribute__((__constructor__)) can be used" >&5 +printf %s "checking if __attribute__((__constructor__)) can be used... " >&6; } +have_func_attribute_constructor=no +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + __attribute__((__constructor__)) + static void my_constructor_func(void) { return; } + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + +printf "%s\n" "#define HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR 1" >>confdefs.h + + have_func_attribute_constructor=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +CFLAGS="$OLD_CFLAGS" + + +# The Win95 threading lacks a thread-safe one-time initialization function. +# The one-time initialization is needed for crc32_small.c and crc64_small.c +# create the CRC tables. So if small mode is enabled, the threading mode is +# win95, and the compiler does not support attribute constructor, then we +# would end up with a multithreaded build that is thread-unsafe. As a +# result this configuration is not allowed. +if test "x$enable_small$enable_threads$have_func_attribute_constructor" \ + = xyeswin95no; then + as_fn_error $? " + --enable-threads=win95 and --enable-small cannot be used + at the same time with a compiler that doesn't support + __attribute__((__constructor__))" "$LINENO" 5 +fi + +############################################################################### +# Checks for library functions. +############################################################################### + +# Gnulib replacements as needed + + if test -z "$GETOPT_H"; then + for ac_header in getopt.h +do : + ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h + +else $as_nop + GETOPT_H=getopt.h +fi + +done + fi + + if test -z "$GETOPT_H"; then + + for ac_func in getopt_long +do : + ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" +if test "x$ac_cv_func_getopt_long" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_LONG 1" >>confdefs.h + +else $as_nop + GETOPT_H=getopt.h +fi + +done + fi + + if test -z "$GETOPT_H"; then + ac_fn_check_decl "$LINENO" "optreset" "ac_cv_have_decl_optreset" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_optreset" = xyes +then : + +printf "%s\n" "#define HAVE_OPTRESET 1" >>confdefs.h + +fi + fi + + + + + if test -n "$GETOPT_H" +then : + + case " $LIBOBJS " in + *" getopt.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt.$ac_objext" + ;; +esac + + case " $LIBOBJS " in + *" getopt1.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt1.$ac_objext" + ;; +esac + + + GETOPT_H=getopt.h + +printf "%s\n" "#define __GETOPT_PREFIX rpl_" >>confdefs.h + + + + +fi + + +# Find the best function to set timestamps. + + for ac_func in futimens futimes futimesat utimes _futime utime +do : + as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + break +fi + +done + +# This is nice to have but not mandatory. +ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" +if test "x$ac_cv_func_posix_fadvise" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h + +fi + + + + + + + + + +ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes +then : + +printf "%s\n" "#define HAVE_PROGRAM_INVOCATION_NAME 1" >>confdefs.h + +fi + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if __builtin_bswap16/32/64 are supported" >&5 +printf %s "checking if __builtin_bswap16/32/64 are supported... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +__builtin_bswap16(1); + __builtin_bswap32(1); + __builtin_bswap64(1); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define HAVE___BUILTIN_BSWAPXX 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + # Look for other byteswapping methods. + for ac_header in byteswap.h sys/endian.h sys/byteorder.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + break +fi + +done + + # Even if we have byteswap.h we may lack the specific macros/functions. + if test x$ac_cv_header_byteswap_h = xyes ; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if bswap_16 is available" >&5 +printf %s "checking if bswap_16 is available... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main(void) +{ + bswap_16(42); + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define HAVE_BSWAP_16 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if bswap_32 is available" >&5 +printf %s "checking if bswap_32 is available... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main(void) +{ + bswap_32(42); + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define HAVE_BSWAP_32 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if bswap_64 is available" >&5 +printf %s "checking if bswap_64 is available... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main(void) +{ + bswap_64(42); + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define HAVE_BSWAP_64 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + fi + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if unaligned memory access should be used" >&5 +printf %s "checking if unaligned memory access should be used... " >&6; } +# Check whether --enable-unaligned-access was given. +if test ${enable_unaligned_access+y} +then : + enableval=$enable_unaligned_access; +else $as_nop + enable_unaligned_access=auto +fi + +if test "x$enable_unaligned_access" = xauto ; then + # TODO: There may be other architectures, on which unaligned access + # is OK. + case $host_cpu in + i?86|x86_64|powerpc|powerpc64) + enable_unaligned_access=yes + ;; + arm*|aarch64*) + # On 32-bit and 64-bit ARM, GCC and Clang + # #define __ARM_FEATURE_UNALIGNED if + # unaligned access is supported. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef __ARM_FEATURE_UNALIGNED +compile error +#endif +int main(void) { return 0; } + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + enable_unaligned_access=yes +else $as_nop + enable_unaligned_access=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + enable_unaligned_access=no + ;; + esac +fi +if test "x$enable_unaligned_access" = xyes ; then + +printf "%s\n" "#define TUKLIB_FAST_UNALIGNED_ACCESS 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if unsafe type punning should be used" >&5 +printf %s "checking if unsafe type punning should be used... " >&6; } +# Check whether --enable-unsafe-type-punning was given. +if test ${enable_unsafe_type_punning+y} +then : + enableval=$enable_unsafe_type_punning; +else $as_nop + enable_unsafe_type_punning=no +fi + +if test "x$enable_unsafe_type_punning" = xyes ; then + +printf "%s\n" "#define TUKLIB_USE_UNSAFE_TYPE_PUNNING 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if __builtin_assume_aligned is supported" >&5 +printf %s "checking if __builtin_assume_aligned is supported... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +__builtin_assume_aligned("", 1); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define HAVE___BUILTIN_ASSUME_ALIGNED 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + + + +# sys/param.h might be needed by sys/sysctl.h. +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to detect the amount of physical memory" >&5 +printf %s "checking how to detect the amount of physical memory... " >&6; } +if test ${tuklib_cv_physmem_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + +# Maybe checking $host_os would be enough but this matches what +# tuklib_physmem.c does. +# +# NOTE: IRIX has a compiler that doesn't error out with #error, so use +# a non-compilable text instead of #error to generate an error. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \ + || defined(__DJGPP__) || defined(__VMS) \ + || defined(AMIGA) || defined(__AROS__) || defined(__QNX__) +int main(void) { return 0; } +#else +compile error +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_physmem_method=special +else $as_nop + + +# Look for AIX-specific solution before sysconf(), because the test +# for sysconf() will pass on AIX but won't actually work +# (sysconf(_SC_PHYS_PAGES) compiles but always returns -1 on AIX). +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main(void) +{ + (void)_system_configuration.physmem; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_physmem_method=aix +else $as_nop + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main(void) +{ + long i; + i = sysconf(_SC_PAGESIZE); + i = sysconf(_SC_PHYS_PAGES); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_physmem_method=sysconf +else $as_nop + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#include +int +main(void) +{ + int name[2] = { CTL_HW, HW_PHYSMEM }; + unsigned long mem; + size_t mem_ptr_size = sizeof(mem); + sysctl(name, 2, &mem, &mem_ptr_size, NULL, 0); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_physmem_method=sysctl +else $as_nop + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main(void) +{ + int memkb; + int start = 0; + getsysinfo(GSI_PHYSMEM, (caddr_t)&memkb, sizeof(memkb), &start); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_physmem_method=getsysinfo +else $as_nop + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main(void) +{ + struct pst_static pst; + pstat_getstatic(&pst, sizeof(pst), 1, 0); + (void)pst.physical_memory; + (void)pst.page_size; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_physmem_method=pstat_getstatic +else $as_nop + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main(void) +{ + inv_state_t *st = NULL; + setinvent_r(&st); + getinvent_r(st); + endinvent_r(st); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_physmem_method=getinvent_r +else $as_nop + + +# This version of sysinfo() is Linux-specific. Some non-Linux systems have +# different sysinfo() so we must check $host_os. +case $host_os in + linux*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main(void) +{ + struct sysinfo si; + sysinfo(&si); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + tuklib_cv_physmem_method=sysinfo + +else $as_nop + + tuklib_cv_physmem_method=unknown + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + tuklib_cv_physmem_method=unknown + ;; +esac + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tuklib_cv_physmem_method" >&5 +printf "%s\n" "$tuklib_cv_physmem_method" >&6; } + +case $tuklib_cv_physmem_method in + aix) + +printf "%s\n" "#define TUKLIB_PHYSMEM_AIX 1" >>confdefs.h + + ;; + sysconf) + +printf "%s\n" "#define TUKLIB_PHYSMEM_SYSCONF 1" >>confdefs.h + + ;; + sysctl) + +printf "%s\n" "#define TUKLIB_PHYSMEM_SYSCTL 1" >>confdefs.h + + ;; + getsysinfo) + +printf "%s\n" "#define TUKLIB_PHYSMEM_GETSYSINFO 1" >>confdefs.h + + ;; + pstat_getstatic) + +printf "%s\n" "#define TUKLIB_PHYSMEM_PSTAT_GETSTATIC 1" >>confdefs.h + + ;; + getinvent_r) + +printf "%s\n" "#define TUKLIB_PHYSMEM_GETINVENT_R 1" >>confdefs.h + + ;; + sysinfo) + +printf "%s\n" "#define TUKLIB_PHYSMEM_SYSINFO 1" >>confdefs.h + + ;; +esac + + + + +# sys/param.h might be needed by sys/sysctl.h. +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to detect the number of available CPU cores" >&5 +printf %s "checking how to detect the number of available CPU cores... " >&6; } +if test ${tuklib_cv_cpucores_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + +# Maybe checking $host_os would be enough but this matches what +# tuklib_cpucores.c does. +# +# NOTE: IRIX has a compiler that doesn't error out with #error, so use +# a non-compilable text instead of #error to generate an error. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined(_WIN32) || defined(__CYGWIN__) +int main(void) { return 0; } +#else +compile error +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_cpucores_method=special +else $as_nop + + +# glibc-based systems (GNU/Linux and GNU/kFreeBSD) have sched_getaffinity(). +# The CPU_COUNT() macro was added in glibc 2.9 so we try to link the +# test program instead of merely compiling it. glibc 2.9 is old enough that +# if someone uses the code on older glibc, the fallback to sysconf() should +# be good enough. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main(void) +{ + cpu_set_t cpu_mask; + sched_getaffinity(0, sizeof(cpu_mask), &cpu_mask); + return CPU_COUNT(&cpu_mask); +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + tuklib_cv_cpucores_method=sched_getaffinity +else $as_nop + + +# FreeBSD has both cpuset and sysctl. Look for cpuset first because +# it's a better approach. +# +# This test would match on GNU/kFreeBSD too but it would require +# -lfreebsd-glue when linking and thus in the current form this would +# fail on GNU/kFreeBSD. The above test for sched_getaffinity() matches +# on GNU/kFreeBSD so the test below should never run on that OS. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main(void) +{ + cpuset_t set; + cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, + sizeof(set), &set); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_cpucores_method=cpuset +else $as_nop + + +# On OS/2, both sysconf() and sysctl() pass the tests in this file, +# but only sysctl() works. On QNX it's the opposite: only sysconf() works +# (although it assumes that _POSIX_SOURCE, _XOPEN_SOURCE, and _POSIX_C_SOURCE +# are undefined or alternatively _QNX_SOURCE is defined). +# +# We test sysctl() first and intentionally break the sysctl() test on QNX +# so that sysctl() is never used on QNX. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __QNX__ +compile error +#endif +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#include +int +main(void) +{ +#ifdef HW_NCPUONLINE + /* This is preferred on OpenBSD, see tuklib_cpucores.c. */ + int name[2] = { CTL_HW, HW_NCPUONLINE }; +#else + int name[2] = { CTL_HW, HW_NCPU }; +#endif + int cpus; + size_t cpus_size = sizeof(cpus); + sysctl(name, 2, &cpus, &cpus_size, NULL, 0); + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_cpucores_method=sysctl +else $as_nop + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main(void) +{ + long i; +#ifdef _SC_NPROCESSORS_ONLN + /* Many systems using sysconf() */ + i = sysconf(_SC_NPROCESSORS_ONLN); +#else + /* IRIX */ + i = sysconf(_SC_NPROC_ONLN); +#endif + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_cpucores_method=sysconf +else $as_nop + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main(void) +{ + struct pst_dynamic pst; + pstat_getdynamic(&pst, sizeof(pst), 1, 0); + (void)pst.psd_proc_cnt; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tuklib_cv_cpucores_method=pstat_getdynamic +else $as_nop + + + tuklib_cv_cpucores_method=unknown + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tuklib_cv_cpucores_method" >&5 +printf "%s\n" "$tuklib_cv_cpucores_method" >&6; } + +case $tuklib_cv_cpucores_method in + sched_getaffinity) + +printf "%s\n" "#define TUKLIB_CPUCORES_SCHED_GETAFFINITY 1" >>confdefs.h + + ;; + cpuset) + +printf "%s\n" "#define TUKLIB_CPUCORES_CPUSET 1" >>confdefs.h + + ;; + sysctl) + +printf "%s\n" "#define TUKLIB_CPUCORES_SYSCTL 1" >>confdefs.h + + ;; + sysconf) + +printf "%s\n" "#define TUKLIB_CPUCORES_SYSCONF 1" >>confdefs.h + + ;; + pstat_getdynamic) + +printf "%s\n" "#define TUKLIB_CPUCORES_PSTAT_GETDYNAMIC 1" >>confdefs.h + + ;; +esac + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc and mbstate_t are properly declared" >&5 +printf %s "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } +if test ${ac_cv_func_mbrtowc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +wchar_t wc; + char const s[] = ""; + size_t n = 1; + mbstate_t state; + return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_func_mbrtowc=yes +else $as_nop + ac_cv_func_mbrtowc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mbrtowc" >&5 +printf "%s\n" "$ac_cv_func_mbrtowc" >&6; } + if test $ac_cv_func_mbrtowc = yes; then + +printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h + + fi + +ac_fn_c_check_func "$LINENO" "wcwidth" "ac_cv_func_wcwidth" +if test "x$ac_cv_func_wcwidth" = xyes +then : + printf "%s\n" "#define HAVE_WCWIDTH 1" >>confdefs.h + +fi + + + +# If requested, check for system-provided SHA-256. At least the following +# implementations are supported: +# +# OS Headers Library Type Function +# FreeBSD sys/types.h + sha256.h libmd SHA256_CTX SHA256_Init +# NetBSD sys/types.h + sha2.h SHA256_CTX SHA256_Init +# OpenBSD sys/types.h + sha2.h SHA2_CTX SHA256Init +# Solaris sys/types.h + sha2.h libmd SHA256_CTX SHA256Init +# MINIX 3 sys/types.h + sha2.h SHA256_CTX SHA256_Init +# Darwin CommonCrypto/CommonDigest.h CC_SHA256_CTX CC_SHA256_Init +# +# Note that Darwin's CC_SHA256_Update takes buffer size as uint32_t instead +# of size_t. +# +sha256_header_found=no +sha256_type_found=no +sha256_func_found=no +if test "x$enable_external_sha256" = "xyes" +then : + + # Test for Common Crypto before others, because Darwin has sha256.h + # too and we don't want to use that, because on older versions it + # uses OpenSSL functions, whose SHA256_Init is not guaranteed to + # succeed. + for ac_header in CommonCrypto/CommonDigest.h sha256.h sha2.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + sha256_header_found=yes ; break +fi + +done + if test "x$sha256_header_found" = xyes; then + ac_fn_c_check_type "$LINENO" "CC_SHA256_CTX" "ac_cv_type_CC_SHA256_CTX" "#ifdef HAVE_SYS_TYPES_H + # include + #endif + #ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H + # include + #endif + #ifdef HAVE_SHA256_H + # include + #endif + #ifdef HAVE_SHA2_H + # include + #endif +" +if test "x$ac_cv_type_CC_SHA256_CTX" = xyes +then : + +printf "%s\n" "#define HAVE_CC_SHA256_CTX 1" >>confdefs.h + +sha256_type_found=yes +fi +ac_fn_c_check_type "$LINENO" "SHA256_CTX" "ac_cv_type_SHA256_CTX" "#ifdef HAVE_SYS_TYPES_H + # include + #endif + #ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H + # include + #endif + #ifdef HAVE_SHA256_H + # include + #endif + #ifdef HAVE_SHA2_H + # include + #endif +" +if test "x$ac_cv_type_SHA256_CTX" = xyes +then : + +printf "%s\n" "#define HAVE_SHA256_CTX 1" >>confdefs.h + +sha256_type_found=yes +fi +ac_fn_c_check_type "$LINENO" "SHA2_CTX" "ac_cv_type_SHA2_CTX" "#ifdef HAVE_SYS_TYPES_H + # include + #endif + #ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H + # include + #endif + #ifdef HAVE_SHA256_H + # include + #endif + #ifdef HAVE_SHA2_H + # include + #endif +" +if test "x$ac_cv_type_SHA2_CTX" = xyes +then : + +printf "%s\n" "#define HAVE_SHA2_CTX 1" >>confdefs.h + +sha256_type_found=yes +fi + + if test "x$sha256_type_found" = xyes ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing SHA256Init" >&5 +printf %s "checking for library containing SHA256Init... " >&6; } +if test ${ac_cv_search_SHA256Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char SHA256Init (); +int +main (void) +{ +return SHA256Init (); + ; + return 0; +} +_ACEOF +for ac_lib in '' md +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 + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_SHA256Init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_SHA256Init+y} +then : + break +fi +done +if test ${ac_cv_search_SHA256Init+y} +then : + +else $as_nop + ac_cv_search_SHA256Init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SHA256Init" >&5 +printf "%s\n" "$ac_cv_search_SHA256Init" >&6; } +ac_res=$ac_cv_search_SHA256Init +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing SHA256_Init" >&5 +printf %s "checking for library containing SHA256_Init... " >&6; } +if test ${ac_cv_search_SHA256_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char SHA256_Init (); +int +main (void) +{ +return SHA256_Init (); + ; + return 0; +} +_ACEOF +for ac_lib in '' md +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 + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_SHA256_Init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_SHA256_Init+y} +then : + break +fi +done +if test ${ac_cv_search_SHA256_Init+y} +then : + +else $as_nop + ac_cv_search_SHA256_Init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SHA256_Init" >&5 +printf "%s\n" "$ac_cv_search_SHA256_Init" >&6; } +ac_res=$ac_cv_search_SHA256_Init +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + + for ac_func in CC_SHA256_Init SHA256Init SHA256_Init +do : + as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + sha256_func_found=yes ; break +fi + +done + fi + fi + +fi + if test "x$sha256_func_found" = xno; then + COND_INTERNAL_SHA256_TRUE= + COND_INTERNAL_SHA256_FALSE='#' +else + COND_INTERNAL_SHA256_TRUE='#' + COND_INTERNAL_SHA256_FALSE= +fi + +if test "x$enable_external_sha256$sha256_func_found" = xyesno; then + as_fn_error $? "--enable-external-sha256 was specified but no supported external SHA-256 implementation was found" "$LINENO" 5 +fi + +# Check for SSE2 intrinsics. There is no run-time detection for SSE2 so if +# compiler options enable SSE2 then SSE2 support is required by the binaries. +# The compile-time check for SSE2 is done with #ifdefs because some compilers +# (ICC, MSVC) allow SSE2 intrinsics even when SSE2 isn't enabled. +ac_fn_check_decl "$LINENO" "_mm_movemask_epi8" "ac_cv_have_decl__mm_movemask_epi8" "#ifdef HAVE_IMMINTRIN_H +#include +#endif +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl__mm_movemask_epi8" = xyes +then : + +printf "%s\n" "#define HAVE__MM_MOVEMASK_EPI8 1" >>confdefs.h + +fi + +# For faster CRC on 32/64-bit x86 and E2K (see also crc64_fast.c): +# +# - Check for the CLMUL intrinsic _mm_clmulepi64_si128 in . +# Check also for _mm_set_epi64x for consistency with CMake build +# where it's needed to disable CLMUL with VS2013. +# +# - Check that __attribute__((__target__("ssse3,sse4.1,pclmul"))) works +# together with _mm_clmulepi64_si128 from . The attribute +# was added in GCC 4.4 but some GCC 4.x versions don't allow intrinsics +# with it. Exception: it must be not be used with EDG-based compilers +# like ICC and the compiler on E2K. +# +# If everything above is supported, runtime detection will be used to keep the +# binaries working on systems that don't support the required extensions. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _mm_clmulepi64_si128 is usable" >&5 +printf %s "checking if _mm_clmulepi64_si128 is usable... " >&6; } +if test "x$enable_clmul_crc" = xno +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, --disable-clmul-crc was used" >&5 +printf "%s\n" "no, --disable-clmul-crc was used" >&6; } + +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +// CLMUL works on older E2K instruction set but it is slow due to emulation. +#if defined(__e2k__) && __iset__ < 6 +# error +#endif + +// Intel's old compiler (ICC) can define __GNUC__ but the attribute must not +// be used with it. The new Clang-based ICX needs the attribute. +// Checking for !defined(__EDG__) catches ICC and other EDG-based compilers. +#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__) +__attribute__((__target__("ssse3,sse4.1,pclmul"))) +#endif +__m128i my_clmul(__m128i a) +{ + const __m128i b = _mm_set_epi64x(1, 2); + return _mm_clmulepi64_si128(a, b, 0); +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + +printf "%s\n" "#define HAVE_USABLE_CLMUL 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + +# Check for sandbox support. If one is found, set enable_sandbox=found. +case $enable_sandbox in #( + auto | capsicum) : + + +# On FreeBSD >= 11.x and Linux, Capsicum is uses . +# If this header is found, it is assumed to be the right one. +capsicum_header_found=no + for ac_header in sys/capsicum.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/capsicum.h" "ac_cv_header_sys_capsicum_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_capsicum_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_CAPSICUM_H 1" >>confdefs.h + capsicum_header_found=yes +fi + +done +if test "$capsicum_header_found" = no ; then + # On FreeBSD 10.x Capsicum uses . Such a header exists + # on Linux too but it describes POSIX.1e capabilities. Look for the + # declaration of cap_rights_limit to check if is + # a Capsicum header. + ac_fn_check_decl "$LINENO" "cap_rights_limit" "ac_cv_have_decl_cap_rights_limit" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_cap_rights_limit" = xyes +then : + capsicum_header_found=yes +fi +fi + +capsicum_lib_found=no +CAPSICUM_LIB= +if test "$capsicum_header_found" = yes ; then + 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 + + # FreeBSD >= 10.x has Capsicum functions in libc. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char cap_rights_limit (); +int +main (void) +{ +return cap_rights_limit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + capsicum_lib_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + # Linux has Capsicum functions in libcaprights. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cap_rights_limit in -lcaprights" >&5 +printf %s "checking for cap_rights_limit in -lcaprights... " >&6; } +if test ${ac_cv_lib_caprights_cap_rights_limit+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcaprights $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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. */ +char cap_rights_limit (); +int +main (void) +{ +return cap_rights_limit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_caprights_cap_rights_limit=yes +else $as_nop + ac_cv_lib_caprights_cap_rights_limit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caprights_cap_rights_limit" >&5 +printf "%s\n" "$ac_cv_lib_caprights_cap_rights_limit" >&6; } +if test "x$ac_cv_lib_caprights_cap_rights_limit" = xyes +then : + CAPSICUM_LIB=-lcaprights + capsicum_lib_found=yes +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 + +fi + + +if test "$capsicum_lib_found" = yes ; then + +printf "%s\n" "#define HAVE_CAPSICUM 1" >>confdefs.h + + enable_sandbox=found +else + : +fi + + ;; #( + *) : + ;; +esac +case $enable_sandbox in #( + auto | pledge) : + + + for ac_func in pledge +do : + ac_fn_c_check_func "$LINENO" "pledge" "ac_cv_func_pledge" +if test "x$ac_cv_func_pledge" = xyes +then : + printf "%s\n" "#define HAVE_PLEDGE 1" >>confdefs.h + enable_sandbox=found ; break +fi + +done + + ;; #( + *) : + ;; +esac + +# If a specific sandboxing method was explicitly requested and it wasn't +# found, give an error. +case $enable_sandbox in + auto | no | found) + ;; + *) + as_fn_error $? "$enable_sandbox support not found" "$LINENO" 5 + ;; +esac + + +############################################################################### +# If using GCC, set some additional AM_CFLAGS: +############################################################################### + +if test "$GCC" = yes ; then + echo + echo "GCC extensions:" +fi + +# Always do the visibility check but don't set AM_CFLAGS on Windows. +# This way things get set properly even on Windows. + + + CFLAG_VISIBILITY= + HAVE_VISIBILITY=0 + if test -n "$GCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5 +printf %s "checking whether the -Werror option is usable... " >&6; } +if test ${gl_cv_cc_vis_werror+y} +then : + printf %s "(cached) " >&6 +else $as_nop + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_vis_werror=yes +else $as_nop + gl_cv_cc_vis_werror=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5 +printf "%s\n" "$gl_cv_cc_vis_werror" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5 +printf %s "checking for simple visibility declarations... " >&6; } +if test ${gl_cv_cc_visibility+y} +then : + printf %s "(cached) " >&6 +else $as_nop + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fvisibility=hidden" + if test $gl_cv_cc_vis_werror = yes; then + CFLAGS="$CFLAGS -Werror" + fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern __attribute__((__visibility__("hidden"))) int hiddenvar; + extern __attribute__((__visibility__("default"))) int exportedvar; + extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); + extern __attribute__((__visibility__("default"))) int exportedfunc (void); + void dummyfunc (void); + int hiddenvar; + int exportedvar; + int hiddenfunc (void) { return 51; } + int exportedfunc (void) { return 1225736919; } + void dummyfunc (void) {} + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_cc_visibility=yes +else $as_nop + gl_cv_cc_visibility=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5 +printf "%s\n" "$gl_cv_cc_visibility" >&6; } + if test $gl_cv_cc_visibility = yes; then + CFLAG_VISIBILITY="-fvisibility=hidden" + HAVE_VISIBILITY=1 + fi + fi + + + +printf "%s\n" "#define HAVE_VISIBILITY $HAVE_VISIBILITY" >>confdefs.h + + +if test -n "$CFLAG_VISIBILITY" && test "$is_w32" = no; then + AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY" +fi + +if test "$GCC" = yes +then : + + # Enable as much warnings as possible. These commented warnings won't + # work for this package though: + # * -Wunreachable-code breaks several assert(0) cases, which are + # backed up with "return LZMA_PROG_ERROR". + # * -Wcast-qual would break various things where we need a non-const + # pointer although we don't modify anything through it. + # * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations + # don't seem so useful here; at least the last one gives some + # warnings which are not bugs. + # * -Wconversion still shows too many warnings. + # + # The flags before the empty line are for GCC and many of them + # are supported by Clang too. The flags after the empty line are + # for Clang. + for NEW_FLAG in \ + -Wall \ + -Wextra \ + -Wvla \ + -Wc99-c11-compat \ + -Wformat=2 \ + -Winit-self \ + -Wmissing-include-dirs \ + -Wshift-overflow=2 \ + -Wstrict-overflow=3 \ + -Walloc-zero \ + -Wduplicated-cond \ + -Wfloat-equal \ + -Wundef \ + -Wshadow \ + -Wpointer-arith \ + -Wbad-function-cast \ + -Wwrite-strings \ + -Wdate-time \ + -Wsign-conversion \ + -Wfloat-conversion \ + -Wlogical-op \ + -Waggregate-return \ + -Wstrict-prototypes \ + -Wold-style-definition \ + -Wmissing-prototypes \ + -Wmissing-declarations \ + -Wredundant-decls \ + \ + -Wc99-compat \ + -Wc11-extensions \ + -Wc2x-compat \ + -Wc2x-extensions \ + -Wpre-c2x-compat \ + -Warray-bounds-pointer-arithmetic \ + -Wassign-enum \ + -Wconditional-uninitialized \ + -Wdocumentation \ + -Wduplicate-enum \ + -Wempty-translation-unit \ + -Wflexible-array-extensions \ + -Wmissing-variable-declarations \ + -Wnewline-eof \ + -Wshift-sign-overflow \ + -Wstring-conversion + do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC accepts $NEW_FLAG" >&5 +printf %s "checking if $CC accepts $NEW_FLAG... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $NEW_FLAG -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +void foo(void); void foo(void) { } +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + AM_CFLAGS="$AM_CFLAGS $NEW_FLAG" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$OLD_CFLAGS" + done + + # Check whether --enable-werror was given. +if test ${enable_werror+y} +then : + enableval=$enable_werror; +else $as_nop + enable_werror=no +fi + + if test "x$enable_werror" = "xyes"; then + AM_CFLAGS="$AM_CFLAGS -Werror" + fi + +fi + + +############################################################################### +# Create the makefiles and config.h +############################################################################### + +echo + +# Don't build the lib directory at all if we don't need any replacement +# functions. + if test -n "$LIBOBJS"; then + COND_GNULIB_TRUE= + COND_GNULIB_FALSE='#' +else + COND_GNULIB_TRUE='#' + COND_GNULIB_FALSE= +fi + + +# Add default AM_CFLAGS. + + +# This is needed for src/scripts. +xz=`echo xz | sed "$program_transform_name"` + + +ac_config_files="$ac_config_files Makefile po/Makefile.in lib/Makefile src/Makefile src/liblzma/Makefile src/liblzma/api/Makefile src/xz/Makefile src/xzdec/Makefile src/lzmainfo/Makefile src/scripts/Makefile tests/Makefile debug/Makefile" + +ac_config_files="$ac_config_files src/scripts/xzdiff" + +ac_config_files="$ac_config_files src/scripts/xzgrep" + +ac_config_files="$ac_config_files src/scripts/xzmore" + +ac_config_files="$ac_config_files src/scripts/xzless" + + +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 +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$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= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +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=`printf "%s\n" "$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. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${COND_W32_TRUE}" && test -z "${COND_W32_FALSE}"; then + as_fn_error $? "conditional \"COND_W32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_MAIN_ENCODER_TRUE}" && test -z "${COND_MAIN_ENCODER_FALSE}"; then + as_fn_error $? "conditional \"COND_MAIN_ENCODER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_MAIN_DECODER_TRUE}" && test -z "${COND_MAIN_DECODER_FALSE}"; then + as_fn_error $? "conditional \"COND_MAIN_DECODER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_LZMA1_TRUE}" && test -z "${COND_FILTER_LZMA1_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_LZMA1\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_LZMA1_TRUE}" && test -z "${COND_ENCODER_LZMA1_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_LZMA1\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_LZMA1_TRUE}" && test -z "${COND_DECODER_LZMA1_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_LZMA1\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_LZMA2_TRUE}" && test -z "${COND_FILTER_LZMA2_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_LZMA2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_LZMA2_TRUE}" && test -z "${COND_ENCODER_LZMA2_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_LZMA2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_LZMA2_TRUE}" && test -z "${COND_DECODER_LZMA2_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_LZMA2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_DELTA_TRUE}" && test -z "${COND_FILTER_DELTA_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_DELTA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_DELTA_TRUE}" && test -z "${COND_ENCODER_DELTA_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_DELTA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_DELTA_TRUE}" && test -z "${COND_DECODER_DELTA_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_DELTA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_X86_TRUE}" && test -z "${COND_FILTER_X86_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_X86\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_X86_TRUE}" && test -z "${COND_ENCODER_X86_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_X86\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_X86_TRUE}" && test -z "${COND_DECODER_X86_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_X86\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_POWERPC_TRUE}" && test -z "${COND_FILTER_POWERPC_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_POWERPC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_POWERPC_TRUE}" && test -z "${COND_ENCODER_POWERPC_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_POWERPC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_POWERPC_TRUE}" && test -z "${COND_DECODER_POWERPC_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_POWERPC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_IA64_TRUE}" && test -z "${COND_FILTER_IA64_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_IA64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_IA64_TRUE}" && test -z "${COND_ENCODER_IA64_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_IA64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_IA64_TRUE}" && test -z "${COND_DECODER_IA64_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_IA64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_ARM_TRUE}" && test -z "${COND_FILTER_ARM_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_ARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_ARM_TRUE}" && test -z "${COND_ENCODER_ARM_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_ARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_ARM_TRUE}" && test -z "${COND_DECODER_ARM_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_ARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_ARMTHUMB_TRUE}" && test -z "${COND_FILTER_ARMTHUMB_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_ARMTHUMB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_ARMTHUMB_TRUE}" && test -z "${COND_ENCODER_ARMTHUMB_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_ARMTHUMB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_ARMTHUMB_TRUE}" && test -z "${COND_DECODER_ARMTHUMB_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_ARMTHUMB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_ARM64_TRUE}" && test -z "${COND_FILTER_ARM64_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_ARM64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_ARM64_TRUE}" && test -z "${COND_ENCODER_ARM64_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_ARM64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_ARM64_TRUE}" && test -z "${COND_DECODER_ARM64_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_ARM64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_SPARC_TRUE}" && test -z "${COND_FILTER_SPARC_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_SPARC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_SPARC_TRUE}" && test -z "${COND_ENCODER_SPARC_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_SPARC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_SPARC_TRUE}" && test -z "${COND_DECODER_SPARC_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_SPARC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_SIMPLE_TRUE}" && test -z "${COND_FILTER_SIMPLE_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_SIMPLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_SIMPLE_TRUE}" && test -z "${COND_ENCODER_SIMPLE_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_SIMPLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_SIMPLE_TRUE}" && test -z "${COND_DECODER_SIMPLE_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_SIMPLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_FILTER_LZ_TRUE}" && test -z "${COND_FILTER_LZ_FALSE}"; then + as_fn_error $? "conditional \"COND_FILTER_LZ\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ENCODER_LZ_TRUE}" && test -z "${COND_ENCODER_LZ_FALSE}"; then + as_fn_error $? "conditional \"COND_ENCODER_LZ\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DECODER_LZ_TRUE}" && test -z "${COND_DECODER_LZ_FALSE}"; then + as_fn_error $? "conditional \"COND_DECODER_LZ\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_CHECK_CRC32_TRUE}" && test -z "${COND_CHECK_CRC32_FALSE}"; then + as_fn_error $? "conditional \"COND_CHECK_CRC32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_CHECK_CRC64_TRUE}" && test -z "${COND_CHECK_CRC64_FALSE}"; then + as_fn_error $? "conditional \"COND_CHECK_CRC64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_CHECK_SHA256_TRUE}" && test -z "${COND_CHECK_SHA256_FALSE}"; then + as_fn_error $? "conditional \"COND_CHECK_SHA256\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_MICROLZMA_TRUE}" && test -z "${COND_MICROLZMA_FALSE}"; then + as_fn_error $? "conditional \"COND_MICROLZMA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_LZIP_DECODER_TRUE}" && test -z "${COND_LZIP_DECODER_FALSE}"; then + as_fn_error $? "conditional \"COND_LZIP_DECODER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_ASM_X86_TRUE}" && test -z "${COND_ASM_X86_FALSE}"; then + as_fn_error $? "conditional \"COND_ASM_X86\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_SMALL_TRUE}" && test -z "${COND_SMALL_FALSE}"; then + as_fn_error $? "conditional \"COND_SMALL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_XZ_TRUE}" && test -z "${COND_XZ_FALSE}"; then + as_fn_error $? "conditional \"COND_XZ\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_XZDEC_TRUE}" && test -z "${COND_XZDEC_FALSE}"; then + as_fn_error $? "conditional \"COND_XZDEC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_LZMADEC_TRUE}" && test -z "${COND_LZMADEC_FALSE}"; then + as_fn_error $? "conditional \"COND_LZMADEC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_LZMAINFO_TRUE}" && test -z "${COND_LZMAINFO_FALSE}"; then + as_fn_error $? "conditional \"COND_LZMAINFO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_LZMALINKS_TRUE}" && test -z "${COND_LZMALINKS_FALSE}"; then + as_fn_error $? "conditional \"COND_LZMALINKS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_SCRIPTS_TRUE}" && test -z "${COND_SCRIPTS_FALSE}"; then + as_fn_error $? "conditional \"COND_SCRIPTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_DOC_TRUE}" && test -z "${COND_DOC_FALSE}"; then + as_fn_error $? "conditional \"COND_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_THREADS_TRUE}" && test -z "${COND_THREADS_FALSE}"; then + as_fn_error $? "conditional \"COND_THREADS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_SHARED_TRUE}" && test -z "${COND_SHARED_FALSE}"; then + as_fn_error $? "conditional \"COND_SHARED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_SYMVERS_LINUX_TRUE}" && test -z "${COND_SYMVERS_LINUX_FALSE}"; then + as_fn_error $? "conditional \"COND_SYMVERS_LINUX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_SYMVERS_GENERIC_TRUE}" && test -z "${COND_SYMVERS_GENERIC_FALSE}"; then + as_fn_error $? "conditional \"COND_SYMVERS_GENERIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${COND_INTERNAL_SHA256_TRUE}" && test -z "${COND_INTERNAL_SHA256_FALSE}"; then + as_fn_error $? "conditional \"COND_INTERNAL_SHA256\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COND_GNULIB_TRUE}" && test -z "${COND_GNULIB_FALSE}"; then + as_fn_error $? "conditional \"COND_GNULIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # 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 +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; 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 + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + 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 -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by XZ Utils $as_me 5.4.5, which was +generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +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" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -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 + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to . +XZ Utils home page: ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +XZ Utils config.status 5.4.5 +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2021 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +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 + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$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. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_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 + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + +# 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' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +LD_RC='`$ECHO "$LD_RC" | $SED "$delay_single_quote_subst"`' +reload_flag_RC='`$ECHO "$reload_flag_RC" | $SED "$delay_single_quote_subst"`' +reload_cmds_RC='`$ECHO "$reload_cmds_RC" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_RC='`$ECHO "$old_archive_cmds_RC" | $SED "$delay_single_quote_subst"`' +compiler_RC='`$ECHO "$compiler_RC" | $SED "$delay_single_quote_subst"`' +GCC_RC='`$ECHO "$GCC_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_RC='`$ECHO "$lt_prog_compiler_no_builtin_flag_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_RC='`$ECHO "$lt_prog_compiler_pic_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_RC='`$ECHO "$lt_prog_compiler_wl_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_RC='`$ECHO "$lt_prog_compiler_static_RC" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_RC='`$ECHO "$lt_cv_prog_compiler_c_o_RC" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_RC='`$ECHO "$archive_cmds_need_lc_RC" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_RC='`$ECHO "$enable_shared_with_static_runtimes_RC" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_RC='`$ECHO "$export_dynamic_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_RC='`$ECHO "$whole_archive_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_RC='`$ECHO "$compiler_needs_object_RC" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_RC='`$ECHO "$old_archive_from_new_cmds_RC" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_RC='`$ECHO "$old_archive_from_expsyms_cmds_RC" | $SED "$delay_single_quote_subst"`' +archive_cmds_RC='`$ECHO "$archive_cmds_RC" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_RC='`$ECHO "$archive_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`' +module_cmds_RC='`$ECHO "$module_cmds_RC" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_RC='`$ECHO "$module_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_RC='`$ECHO "$with_gnu_ld_RC" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_RC='`$ECHO "$allow_undefined_flag_RC" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_RC='`$ECHO "$no_undefined_flag_RC" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_RC='`$ECHO "$hardcode_libdir_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_RC='`$ECHO "$hardcode_libdir_separator_RC" | $SED "$delay_single_quote_subst"`' +hardcode_direct_RC='`$ECHO "$hardcode_direct_RC" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_RC='`$ECHO "$hardcode_direct_absolute_RC" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_RC='`$ECHO "$hardcode_minus_L_RC" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_RC='`$ECHO "$hardcode_shlibpath_var_RC" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_RC='`$ECHO "$hardcode_automatic_RC" | $SED "$delay_single_quote_subst"`' +inherit_rpath_RC='`$ECHO "$inherit_rpath_RC" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_RC='`$ECHO "$link_all_deplibs_RC" | $SED "$delay_single_quote_subst"`' +always_export_symbols_RC='`$ECHO "$always_export_symbols_RC" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_RC='`$ECHO "$export_symbols_cmds_RC" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_RC='`$ECHO "$exclude_expsyms_RC" | $SED "$delay_single_quote_subst"`' +include_expsyms_RC='`$ECHO "$include_expsyms_RC" | $SED "$delay_single_quote_subst"`' +prelink_cmds_RC='`$ECHO "$prelink_cmds_RC" | $SED "$delay_single_quote_subst"`' +postlink_cmds_RC='`$ECHO "$postlink_cmds_RC" | $SED "$delay_single_quote_subst"`' +file_list_spec_RC='`$ECHO "$file_list_spec_RC" | $SED "$delay_single_quote_subst"`' +hardcode_action_RC='`$ECHO "$hardcode_action_RC" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +FILECMD \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +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_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +LD_RC \ +reload_flag_RC \ +compiler_RC \ +lt_prog_compiler_no_builtin_flag_RC \ +lt_prog_compiler_pic_RC \ +lt_prog_compiler_wl_RC \ +lt_prog_compiler_static_RC \ +lt_cv_prog_compiler_c_o_RC \ +export_dynamic_flag_spec_RC \ +whole_archive_flag_spec_RC \ +compiler_needs_object_RC \ +with_gnu_ld_RC \ +allow_undefined_flag_RC \ +no_undefined_flag_RC \ +hardcode_libdir_flag_spec_RC \ +hardcode_libdir_separator_RC \ +exclude_expsyms_RC \ +include_expsyms_RC \ +file_list_spec_RC; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + 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 \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_RC \ +old_archive_cmds_RC \ +old_archive_from_new_cmds_RC \ +old_archive_from_expsyms_cmds_RC \ +archive_cmds_RC \ +archive_expsym_cmds_RC \ +module_cmds_RC \ +module_expsym_cmds_RC \ +export_symbols_cmds_RC \ +prelink_cmds_RC \ +postlink_cmds_RC; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that 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' + RM='$RM' + ofile='$ofile' + + + + + +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. + OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/liblzma/Makefile") CONFIG_FILES="$CONFIG_FILES src/liblzma/Makefile" ;; + "src/liblzma/api/Makefile") CONFIG_FILES="$CONFIG_FILES src/liblzma/api/Makefile" ;; + "src/xz/Makefile") CONFIG_FILES="$CONFIG_FILES src/xz/Makefile" ;; + "src/xzdec/Makefile") CONFIG_FILES="$CONFIG_FILES src/xzdec/Makefile" ;; + "src/lzmainfo/Makefile") CONFIG_FILES="$CONFIG_FILES src/lzmainfo/Makefile" ;; + "src/scripts/Makefile") CONFIG_FILES="$CONFIG_FILES src/scripts/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "debug/Makefile") CONFIG_FILES="$CONFIG_FILES debug/Makefile" ;; + "src/scripts/xzdiff") CONFIG_FILES="$CONFIG_FILES src/scripts/xzdiff" ;; + "src/scripts/xzgrep") CONFIG_FILES="$CONFIG_FILES src/scripts/xzgrep" ;; + "src/scripts/xzmore") CONFIG_FILES="$CONFIG_FILES src/scripts/xzmore" ;; + "src/scripts/xzless") CONFIG_FILES="$CONFIG_FILES src/scripts/xzless" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# 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 + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /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 + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + 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 >>"\$ac_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 +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + 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 + } + + print line +} + +_ACAWK +_ACEOF +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 < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +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 >"$ac_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. + +# 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_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + 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 +' >$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] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + 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 "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +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*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append 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 '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$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 || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_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= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_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 || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +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 +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +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 +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$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 "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# 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 + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +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 || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that 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 +# Generated automatically by $as_me ($PACKAGE) $VERSION +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 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 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 this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='RC ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# 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 + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# 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 + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + +# 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 + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + +# Flags to create an archive. +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# 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 + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# 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 into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# 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 lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# 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 + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# 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 + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# 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 + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# 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 + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# 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 + +# 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 + +# 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 + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_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 + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_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 set != "${COLLECT_NAMES+set}"; 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 '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: RC + +# The linker used to build libraries. +LD=$lt_LD_RC + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_RC +reload_cmds=$lt_reload_cmds_RC + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_RC + +# A language specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU compiler? +with_gcc=$GCC_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_RC + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_RC + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# 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 + +# 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 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_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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_RC + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_RC + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_RC + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_RC + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# ### END LIBTOOL TAG CONFIG: RC +_LT_EOF + + ;; + "po-directories":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang" | "$presentlang"_* | "$presentlang".* | "$presentlang"@*) + useit=yes + ;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + "src/scripts/xzdiff":F) chmod +x src/scripts/xzdiff ;; + "src/scripts/xzgrep":F) chmod +x src/scripts/xzgrep ;; + "src/scripts/xzmore":F) chmod +x src/scripts/xzmore ;; + "src/scripts/xzless":F) chmod +x src/scripts/xzless ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +# Some warnings +if test x$tuklib_cv_physmem_method = xunknown; then + echo + echo "WARNING:" + echo "No supported method to detect the amount of RAM." + echo "Consider using --enable-assume-ram (if you didn't already)" + echo "or make a patch to add support for this operating system." +fi + +if test x$tuklib_cv_cpucores_method = xunknown; then + echo + echo "WARNING:" + echo "No supported method to detect the number of CPU cores." +fi + +if test "x$enable_threads$enable_small$have_func_attribute_constructor" \ + = xnoyesno; then + echo + echo "NOTE:" + echo "liblzma will be thread-unsafe due to the combination" + echo "of --disable-threads --enable-small when using a compiler" + echo "that doesn't support __attribute__((__constructor__))." +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..1d1c811 --- /dev/null +++ b/configure.ac @@ -0,0 +1,1191 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +############################################################################### +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +# NOTE: Don't add useless checks. autoscan detects this and that, but don't +# let it confuse you. For example, we don't care about checking for behavior +# of malloc(), stat(), or lstat(), since we don't use those functions in +# a way that would cause the problems the autoconf macros check. + +AC_PREREQ([2.69]) + +AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]), + [xz@tukaani.org], [xz], [https://tukaani.org/xz/]) +AC_CONFIG_SRCDIR([src/liblzma/common/common.h]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADERS([config.h]) + +echo +echo "$PACKAGE_STRING" + +echo +echo "System type:" +# This is needed to know if assembler optimizations can be used. +AC_CANONICAL_HOST + +# We do some special things on Windows (32-bit or 64-bit) builds. +case $host_os in + mingw* | cygwin | msys) is_w32=yes ;; + *) is_w32=no ;; +esac +AM_CONDITIONAL([COND_W32], [test "$is_w32" = yes]) + +# We need to use $EXEEXT with $(LN_S) when creating symlinks to +# executables. Cygwin is an exception to this, since it is recommended +# that symlinks don't have the .exe suffix. To make this work, we +# define LN_EXEEXT. +# +# MSYS2 is treated the same way as Cygwin. It uses plain "msys" like +# the original MSYS when building MSYS/MSYS2-binaries. Hopefully this +# doesn't break things for the original MSYS developers. Note that this +# doesn't affect normal MSYS/MSYS2 users building non-MSYS/MSYS2 binaries +# since in that case the $host_os is usually mingw32. +case $host_os in + cygwin | msys) LN_EXEEXT= ;; + *) LN_EXEEXT='$(EXEEXT)' ;; +esac +AC_SUBST([LN_EXEEXT]) + +echo +echo "Configure options:" +AM_CFLAGS= + + +############# +# Debugging # +############# + +AC_MSG_CHECKING([if debugging code should be compiled]) +AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debugging code.]), + [], enable_debug=no) +if test "x$enable_debug" = xyes; then + AC_MSG_RESULT([yes]) +else + AC_DEFINE([NDEBUG], [1], [Define to 1 to disable debugging code.]) + AC_MSG_RESULT([no]) +fi + + +########### +# Filters # +########### + +m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc])dnl +m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,arm64,sparc]) +m4_define([LZ_FILTERS], [lzma1,lzma2]) + +m4_foreach([NAME], [SUPPORTED_FILTERS], +[enable_filter_[]NAME=no +enable_encoder_[]NAME=no +enable_decoder_[]NAME=no +])dnl + +AC_MSG_CHECKING([which encoders to build]) +AC_ARG_ENABLE([encoders], AS_HELP_STRING([--enable-encoders=LIST], + [Comma-separated list of encoders to build. Default=all. + Available encoders:] + m4_translit(m4_defn([SUPPORTED_FILTERS]), [,], [ ])), + [], [enable_encoders=SUPPORTED_FILTERS]) +enable_encoders=`echo "$enable_encoders" | sed 's/,/ /g'` +if test "x$enable_encoders" = xno || test "x$enable_encoders" = x; then + enable_encoders=no + AC_MSG_RESULT([(none)]) +else + for arg in $enable_encoders + do + case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [ + NAME) + enable_filter_[]NAME=yes + enable_encoder_[]NAME=yes + AC_DEFINE(HAVE_ENCODER_[]m4_toupper(NAME), [1], + [Define to 1 if] NAME [encoder is enabled.]) + ;;]) + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([unknown filter: $arg]) + ;; + esac + done + AC_DEFINE([HAVE_ENCODERS], [1], + [Define to 1 if any of HAVE_ENCODER_foo have been defined.]) + AC_MSG_RESULT([$enable_encoders]) +fi + +AC_MSG_CHECKING([which decoders to build]) +AC_ARG_ENABLE([decoders], AS_HELP_STRING([--enable-decoders=LIST], + [Comma-separated list of decoders to build. Default=all. + Available decoders are the same as available encoders.]), + [], [enable_decoders=SUPPORTED_FILTERS]) +enable_decoders=`echo "$enable_decoders" | sed 's/,/ /g'` +if test "x$enable_decoders" = xno || test "x$enable_decoders" = x; then + enable_decoders=no + AC_MSG_RESULT([(none)]) +else + for arg in $enable_decoders + do + case $arg in m4_foreach([NAME], [SUPPORTED_FILTERS], [ + NAME) + enable_filter_[]NAME=yes + enable_decoder_[]NAME=yes + AC_DEFINE(HAVE_DECODER_[]m4_toupper(NAME), [1], + [Define to 1 if] NAME [decoder is enabled.]) + ;;]) + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([unknown filter: $arg]) + ;; + esac + done + AC_DEFINE([HAVE_DECODERS], [1], + [Define to 1 if any of HAVE_DECODER_foo have been defined.]) + AC_MSG_RESULT([$enable_decoders]) +fi + +if test "x$enable_encoder_lzma2$enable_encoder_lzma1" = xyesno \ + || test "x$enable_decoder_lzma2$enable_decoder_lzma1" = xyesno; then + AC_MSG_ERROR([LZMA2 requires that LZMA1 is also enabled.]) +fi + +AM_CONDITIONAL(COND_MAIN_ENCODER, test "x$enable_encoders" != xno) +AM_CONDITIONAL(COND_MAIN_DECODER, test "x$enable_decoders" != xno) + +m4_foreach([NAME], [SUPPORTED_FILTERS], +[AM_CONDITIONAL(COND_FILTER_[]m4_toupper(NAME), test "x$enable_filter_[]NAME" = xyes) +AM_CONDITIONAL(COND_ENCODER_[]m4_toupper(NAME), test "x$enable_encoder_[]NAME" = xyes) +AM_CONDITIONAL(COND_DECODER_[]m4_toupper(NAME), test "x$enable_decoder_[]NAME" = xyes) +])dnl + +# The so called "simple filters" share common code. +enable_filter_simple=no +enable_encoder_simple=no +enable_decoder_simple=no +m4_foreach([NAME], [SIMPLE_FILTERS], +[test "x$enable_filter_[]NAME" = xyes && enable_filter_simple=yes +test "x$enable_encoder_[]NAME" = xyes && enable_encoder_simple=yes +test "x$enable_decoder_[]NAME" = xyes && enable_decoder_simple=yes +])dnl +AM_CONDITIONAL(COND_FILTER_SIMPLE, test "x$enable_filter_simple" = xyes) +AM_CONDITIONAL(COND_ENCODER_SIMPLE, test "x$enable_encoder_simple" = xyes) +AM_CONDITIONAL(COND_DECODER_SIMPLE, test "x$enable_decoder_simple" = xyes) + +# LZ-based filters share common code. +enable_filter_lz=no +enable_encoder_lz=no +enable_decoder_lz=no +m4_foreach([NAME], [LZ_FILTERS], +[test "x$enable_filter_[]NAME" = xyes && enable_filter_lz=yes +test "x$enable_encoder_[]NAME" = xyes && enable_encoder_lz=yes +test "x$enable_decoder_[]NAME" = xyes && enable_decoder_lz=yes +])dnl +AM_CONDITIONAL(COND_FILTER_LZ, test "x$enable_filter_lz" = xyes) +AM_CONDITIONAL(COND_ENCODER_LZ, test "x$enable_encoder_lz" = xyes) +AM_CONDITIONAL(COND_DECODER_LZ, test "x$enable_decoder_lz" = xyes) + + +################# +# Match finders # +################# + +m4_define([SUPPORTED_MATCH_FINDERS], [hc3,hc4,bt2,bt3,bt4]) + +m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS], +[enable_match_finder_[]NAME=no +]) + +AC_MSG_CHECKING([which match finders to build]) +AC_ARG_ENABLE([match-finders], AS_HELP_STRING([--enable-match-finders=LIST], + [Comma-separated list of match finders to build. Default=all. + At least one match finder is required for encoding with + the LZMA1 and LZMA2 filters. Available match finders:] + m4_translit(m4_defn([SUPPORTED_MATCH_FINDERS]), [,], [ ])), [], + [enable_match_finders=SUPPORTED_MATCH_FINDERS]) +enable_match_finders=`echo "$enable_match_finders" | sed 's/,/ /g'` +if test "x$enable_encoder_lz" = xyes ; then + if test -z "$enable_match_finders"; then + AC_MSG_ERROR([At least one match finder is required for an LZ-based encoder.]) + fi + + for arg in $enable_match_finders + do + case $arg in m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS], [ + NAME) + enable_match_finder_[]NAME=yes + AC_DEFINE(HAVE_MF_[]m4_toupper(NAME), [1], + [Define to 1 to enable] NAME [match finder.]) + ;;]) + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([unknown match finder: $arg]) + ;; + esac + done + AC_MSG_RESULT([$enable_match_finders]) +else + AC_MSG_RESULT([(none because not building any LZ-based encoder)]) +fi + + +#################### +# Integrity checks # +#################### + +m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256]) + +m4_foreach([NAME], [SUPPORTED_CHECKS], +[enable_check_[]NAME=no +])dnl + +AC_MSG_CHECKING([which integrity checks to build]) +AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks=LIST], + [Comma-separated list of integrity checks to build. + Default=all. Available integrity checks:] + m4_translit(m4_defn([SUPPORTED_CHECKS]), [,], [ ])), + [], [enable_checks=SUPPORTED_CHECKS]) +enable_checks=`echo "$enable_checks" | sed 's/,/ /g'` +if test "x$enable_checks" = xno || test "x$enable_checks" = x; then + AC_MSG_RESULT([(none)]) +else + for arg in $enable_checks + do + case $arg in m4_foreach([NAME], [SUPPORTED_CHECKS], [ + NAME) + enable_check_[]NAME=yes + AC_DEFINE(HAVE_CHECK_[]m4_toupper(NAME), [1], + [Define to 1 if] NAME + [integrity check is enabled.]) + ;;]) + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([unknown integrity check: $arg]) + ;; + esac + done + AC_MSG_RESULT([$enable_checks]) +fi +if test "x$enable_check_crc32" = xno ; then + AC_MSG_ERROR([For now, the CRC32 check must always be enabled.]) +fi + +m4_foreach([NAME], [SUPPORTED_CHECKS], +[AM_CONDITIONAL(COND_CHECK_[]m4_toupper(NAME), test "x$enable_check_[]NAME" = xyes) +])dnl + +AC_MSG_CHECKING([if external SHA-256 should be used]) +AC_ARG_ENABLE([external-sha256], AS_HELP_STRING([--enable-external-sha256], + [Use SHA-256 code from the operating system. + See INSTALL for possible subtle problems.]), + [], [enable_external_sha256=no]) +if test "x$enable_check_sha256" != "xyes"; then + enable_external_sha256=no +fi +if test "x$enable_external_sha256" = xyes; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + + +############# +# MicroLZMA # +############# + +AC_MSG_CHECKING([if MicroLZMA support should be built]) +AC_ARG_ENABLE([microlzma], AS_HELP_STRING([--disable-microlzma], + [Do not build MicroLZMA encoder and decoder. + It is needed by specific applications only, + for example, erofs-utils.]), + [], [enable_microlzma=yes]) +case $enable_microlzma in + yes | no) + AC_MSG_RESULT([$enable_microlzma]) + ;; + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([--enable-microlzma accepts only `yes' or `no'.]) + ;; +esac +AM_CONDITIONAL(COND_MICROLZMA, test "x$enable_microlzma" = xyes) + + +############################# +# .lz (lzip) format support # +############################# + +AC_MSG_CHECKING([if .lz (lzip) decompression support should be built]) +AC_ARG_ENABLE([lzip-decoder], AS_HELP_STRING([--disable-lzip-decoder], + [Disable decompression support for .lz (lzip) files.]), + [], [enable_lzip_decoder=yes]) +if test "x$enable_decoder_lzma1" != xyes; then + enable_lzip_decoder=no + AC_MSG_RESULT([no because LZMA1 decoder is disabled]) +elif test "x$enable_lzip_decoder" = xyes; then + AC_DEFINE([HAVE_LZIP_DECODER], [1], + [Define to 1 if .lz (lzip) decompression support is enabled.]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi +AM_CONDITIONAL(COND_LZIP_DECODER, test "x$enable_lzip_decoder" = xyes) + + +########################### +# Assembler optimizations # +########################### + +AC_MSG_CHECKING([if assembler optimizations should be used]) +AC_ARG_ENABLE([assembler], AS_HELP_STRING([--disable-assembler], + [Do not use assembler optimizations even if such exist + for the architecture.]), + [], [enable_assembler=yes]) +if test "x$enable_assembler" = xyes; then + enable_assembler=no + case $host_os in + # Darwin should work too but only if not creating universal + # binaries. Solaris x86 could work too but I cannot test. + linux* | *bsd* | mingw* | cygwin | msys | *djgpp*) + case $host_cpu in + i?86) enable_assembler=x86 ;; + esac + ;; + esac +fi +case $enable_assembler in + x86 | no) + AC_MSG_RESULT([$enable_assembler]) + ;; + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([--enable-assembler accepts only `yes', `no', or `x86' (32-bit).]) + ;; +esac +AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86) + + +############# +# CLMUL CRC # +############# + +AC_ARG_ENABLE([clmul-crc], AS_HELP_STRING([--disable-clmul-crc], + [Do not use carryless multiplication for CRC calculation + even if support for it is detected.]), + [], [enable_clmul_crc=yes]) + + +##################### +# Size optimization # +##################### + +AC_MSG_CHECKING([if small size is preferred over speed]) +AC_ARG_ENABLE([small], AS_HELP_STRING([--enable-small], + [Make liblzma smaller and a little slower. + This is disabled by default to optimize for speed.]), + [], [enable_small=no]) +if test "x$enable_small" = xyes; then + AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.]) +elif test "x$enable_small" != xno; then + AC_MSG_RESULT([]) + AC_MSG_ERROR([--enable-small accepts only `yes' or `no']) +fi +AC_MSG_RESULT([$enable_small]) +AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes) + + +############# +# Threading # +############# + +AC_MSG_CHECKING([if threading support is wanted]) +AC_ARG_ENABLE([threads], AS_HELP_STRING([--enable-threads=METHOD], + [Supported METHODS are `yes', `no', `posix', `win95', and + `vista'. The default is `yes'. Using `no' together with + --enable-small makes liblzma thread unsafe.]), + [], [enable_threads=yes]) + +if test "x$enable_threads" = xyes; then + case $host_os in + mingw*) + case $host_cpu in + i?86) enable_threads=win95 ;; + *) enable_threads=vista ;; + esac + ;; + *) + enable_threads=posix + ;; + esac +fi + +case $enable_threads in + posix | win95 | vista) + AC_MSG_RESULT([yes, $enable_threads]) + ;; + no) + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([--enable-threads only accepts `yes', `no', `posix', `win95', or `vista']) + ;; +esac + +# We use the actual result a little later. + + +######################### +# Assumed amount of RAM # +######################### + +# We use 128 MiB as default, because it will allow decompressing files +# created with "xz -9". It would be slightly safer to guess a lower value, +# but most systems, on which we don't have any way to determine the amount +# of RAM, will probably have at least 128 MiB of RAM. +AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown]) +AC_ARG_ENABLE([assume-ram], AS_HELP_STRING([--enable-assume-ram=SIZE], + [If and only if the real amount of RAM cannot be determined, + assume SIZE MiB. The default is 128 MiB. This affects the + default memory usage limit.]), + [], [enable_assume_ram=128]) +assume_ram_check=`echo "$enable_assume_ram" | tr -d 0123456789` +if test -z "$enable_assume_ram" || test -n "$assume_ram_check"; then + AC_MSG_RESULT([]) + AC_MSG_ERROR([--enable-assume-ram accepts only an integer argument]) +fi +AC_MSG_RESULT([$enable_assume_ram MiB]) +AC_DEFINE_UNQUOTED([ASSUME_RAM], [$enable_assume_ram], + [How many MiB of RAM to assume if the real amount cannot + be determined.]) + + +######################### +# Components to install # +######################### + +AC_ARG_ENABLE([xz], [AS_HELP_STRING([--disable-xz], + [do not build the xz tool])], + [], [enable_xz=yes]) +AM_CONDITIONAL([COND_XZ], [test x$enable_xz != xno]) + +AC_ARG_ENABLE([xzdec], [AS_HELP_STRING([--disable-xzdec], + [do not build xzdec])], + [], [enable_xzdec=yes]) +test "x$enable_decoders" = xno && enable_xzdec=no +AM_CONDITIONAL([COND_XZDEC], [test x$enable_xzdec != xno]) + +AC_ARG_ENABLE([lzmadec], [AS_HELP_STRING([--disable-lzmadec], + [do not build lzmadec + (it exists primarily for LZMA Utils compatibility)])], + [], [enable_lzmadec=yes]) +test "x$enable_decoder_lzma1" = xno && enable_lzmadec=no +AM_CONDITIONAL([COND_LZMADEC], [test x$enable_lzmadec != xno]) + +AC_ARG_ENABLE([lzmainfo], [AS_HELP_STRING([--disable-lzmainfo], + [do not build lzmainfo + (it exists primarily for LZMA Utils compatibility)])], + [], [enable_lzmainfo=yes]) +test "x$enable_decoder_lzma1" = xno && enable_lzmainfo=no +AM_CONDITIONAL([COND_LZMAINFO], [test x$enable_lzmainfo != xno]) + +AC_ARG_ENABLE([lzma-links], [AS_HELP_STRING([--disable-lzma-links], + [do not create symlinks for LZMA Utils compatibility])], + [], [enable_lzma_links=yes]) +AM_CONDITIONAL([COND_LZMALINKS], [test x$enable_lzma_links != xno]) + +AC_ARG_ENABLE([scripts], [AS_HELP_STRING([--disable-scripts], + [do not install the scripts xzdiff, xzgrep, xzless, xzmore, + and their symlinks])], + [], [enable_scripts=yes]) +AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno]) + +AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc], + [do not install documentation files to docdir + (man pages will still be installed)])], + [], [enable_doc=yes]) +AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno]) + + +############## +# Sandboxing # +############## + +AC_MSG_CHECKING([if sandboxing should be used]) +AC_ARG_ENABLE([sandbox], [AS_HELP_STRING([--enable-sandbox=METHOD], + [Sandboxing METHOD can be + `auto', `no', `capsicum', or `pledge'. + The default is `auto' which enables sandboxing if + a supported sandboxing method is found.])], + [], [enable_sandbox=auto]) +case $enable_sandbox in + auto) + AC_MSG_RESULT([maybe (autodetect)]) + ;; + no | capsicum | pledge) + AC_MSG_RESULT([$enable_sandbox]) + ;; + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([--enable-sandbox only accepts `auto', `no', `capsicum', or `pledge'.]) + ;; +esac + + +########################### +# PATH prefix for scripts # +########################### + +# The scripts can add a prefix to the search PATH so that POSIX tools +# or the xz binary is always in the PATH. +AC_ARG_ENABLE([path-for-scripts], + [AS_HELP_STRING([--enable-path-for-scripts=PREFIX], + [If PREFIX isn't empty, PATH=PREFIX:$PATH will be set in + the beginning of the scripts (xzgrep and others). + The default is empty except on Solaris the default is + /usr/xpg4/bin.])], + [], [ + case $host_os in + solaris*) enable_path_for_scripts=/usr/xpg4/bin ;; + *) enable_path_for_scripts= ;; + esac + ]) +if test -n "$enable_path_for_scripts" && test "x$enable_path_for_scripts" != xno ; then + enable_path_for_scripts="PATH=$enable_path_for_scripts:\$PATH" +else + enable_path_for_scripts= +fi +AC_SUBST([enable_path_for_scripts]) + + +############################################################################### +# Checks for programs. +############################################################################### + +echo +case $host_os in + solaris*) + # The gnulib POSIX shell macro below may pick a shell that + # doesn't work with xzgrep. Workaround by picking a shell + # that is known to work. + if test -z "$gl_cv_posix_shell" && test -x /usr/xpg4/bin/sh; then + gl_cv_posix_shell=/usr/xpg4/bin/sh + fi + ;; +esac +gl_POSIX_SHELL +if test -z "$POSIX_SHELL" && test "x$enable_scripts" = xyes ; then + AC_MSG_ERROR([No POSIX conforming shell (sh) was found.]) +fi + +echo +echo "Initializing Automake:" + +# We don't use "subdir-objects" yet because it breaks "make distclean" when +# dependencies are enabled (as of Automake 1.14.1) due to this bug: +# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=17354 +# The -Wno-unsupported is used to silence warnings about missing +# "subdir-objects". +AM_INIT_AUTOMAKE([1.12 foreign tar-v7 filename-length-max=99 -Wno-unsupported]) +AC_PROG_LN_S + +dnl # Autoconf >= 2.70 warns that AC_PROG_CC_C99 is obsolete. However, +dnl # we have to keep using AC_PROG_CC_C99 instead of AC_PROG_CC +dnl # as long as we try to be compatible with Autoconf 2.69. +AC_PROG_CC_C99 +if test x$ac_cv_prog_cc_c99 = xno ; then + AC_MSG_ERROR([No C99 compiler was found.]) +fi + +AM_PROG_CC_C_O +AM_PROG_AS +AC_USE_SYSTEM_EXTENSIONS + +AS_CASE([$enable_threads], + [posix], [ + echo + echo "POSIX threading support:" + AX_PTHREAD([:]) dnl We don't need the HAVE_PTHREAD macro. + LIBS="$LIBS $PTHREAD_LIBS" + AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" + + dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX, + dnl but it's tricky to get it right together with + dnl AC_PROG_CC_C99. Thus, this is handled by telling the + dnl user in INSTALL to set the correct CC manually. + + AC_DEFINE([MYTHREAD_POSIX], [1], + [Define to 1 when using POSIX threads (pthreads).]) + + # These are nice to have but not mandatory. + # + # FIXME: xz uses clock_gettime if it is available and can do + # it even when threading is disabled. Moving this outside + # of pthread detection may be undesirable because then + # liblzma may get linked against librt even when librt isn't + # needed by liblzma. + OLD_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + AC_SEARCH_LIBS([clock_gettime], [rt]) + AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock]) + AC_CHECK_DECL([CLOCK_MONOTONIC], [AC_DEFINE( + [HAVE_CLOCK_MONOTONIC], [1], [Define to 1 if + `CLOCK_MONOTONIC' is declared in .])], [], + [[#include ]]) + CFLAGS=$OLD_CFLAGS + ], + [win95], [ + AC_DEFINE([MYTHREAD_WIN95], [1], [Define to 1 when using + Windows 95 (and thus XP) compatible threads. + This avoids use of features that were added in + Windows Vista.]) + ], + [vista], [ + AC_DEFINE([MYTHREAD_VISTA], [1], [Define to 1 when using + Windows Vista compatible threads. This uses + features that are not available on Windows XP.]) + ] +) +AM_CONDITIONAL([COND_THREADS], [test "x$enable_threads" != xno]) + +echo +echo "Initializing Libtool:" +LT_PREREQ([2.4]) +LT_INIT([win32-dll]) +LT_LANG([Windows Resource]) + +# This is a bit wrong since it is possible to request that only some libs +# are built as shared. Using that feature isn't so common though, and this +# breaks only on Windows (at least for now) if the user enables only some +# libs as shared. +AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno]) + +##################### +# Symbol versioning # +##################### + +# NOTE: This checks if we are building shared or static library +# and if --with-pic or --without-pic was used. Thus this check +# must be after Libtool initialization. +AC_MSG_CHECKING([if library symbol versioning should be used]) +AC_ARG_ENABLE([symbol-versions], [AS_HELP_STRING([--enable-symbol-versions], + [Use symbol versioning for liblzma. Enabled by default on + GNU/Linux, other GNU-based systems, and FreeBSD.])], + [], [enable_symbol_versions=auto]) +if test "x$enable_symbol_versions" = xauto; then + case $host_os in + # NOTE: Even if one omits -gnu on GNU/Linux (e.g. + # i486-slackware-linux), configure will (via config.sub) + # append -gnu (e.g. i486-slackware-linux-gnu), and this + # test will work correctly. + gnu* | *-gnu* | freebsd*) + enable_symbol_versions=yes + ;; + *) + enable_symbol_versions=no + ;; + esac +fi + +# There are two variants for symbol versioning. +# See src/liblzma/validate_map.sh for details. +# +# On GNU/Linux, extra symbols are added in the C code. These extra symbols +# must not be put into a static library as they can cause problems (and +# even if they didn't cause problems, they would be useless). On other +# systems symbol versioning may be used too but there is no problem as only +# a linker script is specified in src/liblzma/Makefile.am and that isn't +# used when creating a static library. +# +# Libtool always uses -DPIC when building shared libraries by default and +# doesn't use it for static libs by default. This can be overridden with +# --with-pic and --without-pic though. As long as neither --with-pic nor +# --without-pic is used then we can use #ifdef PIC to detect if the file is +# being built for a shared library. +if test "x$enable_symbol_versions" = xno ; then + enable_symbol_versions=no + AC_MSG_RESULT([no]) +elif test "x$enable_shared" = xno ; then + enable_symbol_versions=no + AC_MSG_RESULT([no (not building a shared library)]) +else + case "$host_cpu-$host_os" in + microblaze*) + # GCC 12 on MicroBlaze doesn't support __symver__ + # attribute. It's simplest and safest to use the + # generic version on that platform since then only + # the linker script is needed. The RHEL/CentOS 7 + # compatibility symbols don't matter on MicroBlaze. + enable_symbol_versions=generic + ;; + *-linux*) + case "$pic_mode-$enable_static" in + default-*) + # Use symvers if PIC is defined. + have_symbol_versions_linux=2 + ;; + *-no) + # Not building static library. + # Use symvers unconditionally. + have_symbol_versions_linux=1 + ;; + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([ + On GNU/Linux, building both shared and static library at the same time + is not supported if --with-pic or --without-pic is used. + Use either --disable-shared or --disable-static to build one type + of library at a time. If both types are needed, build one at a time, + possibly picking only src/liblzma/.libs/liblzma.a from the static build.]) + ;; + esac + enable_symbol_versions=linux + AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX], + [$have_symbol_versions_linux], + [Define to 1 to if GNU/Linux-specific details + are unconditionally wanted for symbol + versioning. Define to 2 to if these are wanted + only if also PIC is defined (allows building + both shared and static liblzma at the same + time with Libtool if neither --with-pic nor + --without-pic is used). This define must be + used together with liblzma_linux.map.]) + ;; + *) + enable_symbol_versions=generic + ;; + esac + AC_MSG_RESULT([yes ($enable_symbol_versions)]) +fi + +AM_CONDITIONAL([COND_SYMVERS_LINUX], + [test "x$enable_symbol_versions" = xlinux]) +AM_CONDITIONAL([COND_SYMVERS_GENERIC], + [test "x$enable_symbol_versions" = xgeneric]) + + +############################################################################### +# Checks for libraries. +############################################################################### + +dnl Support for _REQUIRE_VERSION was added in gettext 0.19.6. If both +dnl _REQUIRE_VERSION and _VERSION are present, the _VERSION is ignored. +dnl We use both for compatibility with other programs in the Autotools family. +echo +echo "Initializing gettext:" +AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6]) +AM_GNU_GETTEXT_VERSION([0.19.6]) +AM_GNU_GETTEXT([external]) + + +############################################################################### +# Checks for header files. +############################################################################### + +echo +echo "System headers and functions:" + +# There is currently no workarounds in this package if some of +# these headers are missing. +AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h], + [], + [AC_MSG_ERROR([Required header file(s) are missing.])]) + +# immintrin.h allows the use of the intrinsic functions if they are available. +# cpuid.h may be used for detecting x86 processor features at runtime. +AC_CHECK_HEADERS([immintrin.h cpuid.h]) + + +############################################################################### +# Checks for typedefs, structures, and compiler characteristics. +############################################################################### + +AC_HEADER_STDBOOL + +AC_TYPE_UINT8_T +AC_TYPE_UINT16_T +AC_TYPE_INT32_T +AC_TYPE_UINT32_T +AC_TYPE_INT64_T +AC_TYPE_UINT64_T +AC_TYPE_UINTPTR_T + +AC_CHECK_SIZEOF([size_t]) + +# The command line tool can copy high resolution timestamps if such +# information is available in struct stat. Otherwise one second accuracy +# is used. +AC_CHECK_MEMBERS([ + struct stat.st_atim.tv_nsec, + struct stat.st_atimespec.tv_nsec, + struct stat.st_atimensec, + struct stat.st_uatime, + struct stat.st_atim.st__tim.tv_nsec]) + +AC_SYS_LARGEFILE +AC_C_BIGENDIAN + +# __attribute__((__constructor__)) can be used for one-time initializations. +# Use -Werror because some compilers accept unknown attributes and just +# give a warning. +# +# FIXME? Unfortunately -Werror can cause trouble if CFLAGS contains options +# that produce warnings for unrelated reasons. For example, GCC and Clang +# support -Wunused-macros which will warn about "#define _GNU_SOURCE 1" +# which will be among the #defines that Autoconf inserts to the beginning of +# the test program. There seems to be no nice way to prevent Autoconf from +# inserting the any defines to the test program. +AC_MSG_CHECKING([if __attribute__((__constructor__)) can be used]) +have_func_attribute_constructor=no +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + __attribute__((__constructor__)) + static void my_constructor_func(void) { return; } +]])], [ + AC_DEFINE([HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR], [1], + [Define to 1 if __attribute__((__constructor__)) + is supported for functions.]) + have_func_attribute_constructor=yes + AC_MSG_RESULT([yes]) +], [ + AC_MSG_RESULT([no]) +]) +CFLAGS="$OLD_CFLAGS" + + +# The Win95 threading lacks a thread-safe one-time initialization function. +# The one-time initialization is needed for crc32_small.c and crc64_small.c +# create the CRC tables. So if small mode is enabled, the threading mode is +# win95, and the compiler does not support attribute constructor, then we +# would end up with a multithreaded build that is thread-unsafe. As a +# result this configuration is not allowed. +if test "x$enable_small$enable_threads$have_func_attribute_constructor" \ + = xyeswin95no; then + AC_MSG_ERROR([ + --enable-threads=win95 and --enable-small cannot be used + at the same time with a compiler that doesn't support + __attribute__((__constructor__))]) +fi + +############################################################################### +# Checks for library functions. +############################################################################### + +# Gnulib replacements as needed +gl_GETOPT + +# Find the best function to set timestamps. +AC_CHECK_FUNCS([futimens futimes futimesat utimes _futime utime], [break]) + +# This is nice to have but not mandatory. +AC_CHECK_FUNCS([posix_fadvise]) + +TUKLIB_PROGNAME +TUKLIB_INTEGER +TUKLIB_PHYSMEM +TUKLIB_CPUCORES +TUKLIB_MBSTR + +# If requested, check for system-provided SHA-256. At least the following +# implementations are supported: +# +# OS Headers Library Type Function +# FreeBSD sys/types.h + sha256.h libmd SHA256_CTX SHA256_Init +# NetBSD sys/types.h + sha2.h SHA256_CTX SHA256_Init +# OpenBSD sys/types.h + sha2.h SHA2_CTX SHA256Init +# Solaris sys/types.h + sha2.h libmd SHA256_CTX SHA256Init +# MINIX 3 sys/types.h + sha2.h SHA256_CTX SHA256_Init +# Darwin CommonCrypto/CommonDigest.h CC_SHA256_CTX CC_SHA256_Init +# +# Note that Darwin's CC_SHA256_Update takes buffer size as uint32_t instead +# of size_t. +# +sha256_header_found=no +sha256_type_found=no +sha256_func_found=no +AS_IF([test "x$enable_external_sha256" = "xyes"], [ + # Test for Common Crypto before others, because Darwin has sha256.h + # too and we don't want to use that, because on older versions it + # uses OpenSSL functions, whose SHA256_Init is not guaranteed to + # succeed. + AC_CHECK_HEADERS( + [CommonCrypto/CommonDigest.h sha256.h sha2.h], + [sha256_header_found=yes ; break]) + if test "x$sha256_header_found" = xyes; then + AC_CHECK_TYPES([CC_SHA256_CTX, SHA256_CTX, SHA2_CTX], + [sha256_type_found=yes], [], + [[#ifdef HAVE_SYS_TYPES_H + # include + #endif + #ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H + # include + #endif + #ifdef HAVE_SHA256_H + # include + #endif + #ifdef HAVE_SHA2_H + # include + #endif]]) + if test "x$sha256_type_found" = xyes ; then + AC_SEARCH_LIBS([SHA256Init], [md]) + AC_SEARCH_LIBS([SHA256_Init], [md]) + AC_CHECK_FUNCS([CC_SHA256_Init SHA256Init SHA256_Init], + [sha256_func_found=yes ; break]) + fi + fi +]) +AM_CONDITIONAL([COND_INTERNAL_SHA256], [test "x$sha256_func_found" = xno]) +if test "x$enable_external_sha256$sha256_func_found" = xyesno; then + AC_MSG_ERROR([--enable-external-sha256 was specified but no supported external SHA-256 implementation was found]) +fi + +# Check for SSE2 intrinsics. There is no run-time detection for SSE2 so if +# compiler options enable SSE2 then SSE2 support is required by the binaries. +# The compile-time check for SSE2 is done with #ifdefs because some compilers +# (ICC, MSVC) allow SSE2 intrinsics even when SSE2 isn't enabled. +AC_CHECK_DECL([_mm_movemask_epi8], + [AC_DEFINE([HAVE__MM_MOVEMASK_EPI8], [1], + [Define to 1 if _mm_movemask_epi8 is available.])], + [], +[#ifdef HAVE_IMMINTRIN_H +#include +#endif]) + +# For faster CRC on 32/64-bit x86 and E2K (see also crc64_fast.c): +# +# - Check for the CLMUL intrinsic _mm_clmulepi64_si128 in . +# Check also for _mm_set_epi64x for consistency with CMake build +# where it's needed to disable CLMUL with VS2013. +# +# - Check that __attribute__((__target__("ssse3,sse4.1,pclmul"))) works +# together with _mm_clmulepi64_si128 from . The attribute +# was added in GCC 4.4 but some GCC 4.x versions don't allow intrinsics +# with it. Exception: it must be not be used with EDG-based compilers +# like ICC and the compiler on E2K. +# +# If everything above is supported, runtime detection will be used to keep the +# binaries working on systems that don't support the required extensions. +AC_MSG_CHECKING([if _mm_clmulepi64_si128 is usable]) +AS_IF([test "x$enable_clmul_crc" = xno], [ + AC_MSG_RESULT([no, --disable-clmul-crc was used]) +], [ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include + +// CLMUL works on older E2K instruction set but it is slow due to emulation. +#if defined(__e2k__) && __iset__ < 6 +# error +#endif + +// Intel's old compiler (ICC) can define __GNUC__ but the attribute must not +// be used with it. The new Clang-based ICX needs the attribute. +// Checking for !defined(__EDG__) catches ICC and other EDG-based compilers. +#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__) +__attribute__((__target__("ssse3,sse4.1,pclmul"))) +#endif +__m128i my_clmul(__m128i a) +{ + const __m128i b = _mm_set_epi64x(1, 2); + return _mm_clmulepi64_si128(a, b, 0); +} + ]])], [ + AC_DEFINE([HAVE_USABLE_CLMUL], [1], + [Define to 1 if _mm_set_epi64x and + _mm_clmulepi64_si128 are usable. + See configure.ac for details.]) + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + ]) +]) + +# Check for sandbox support. If one is found, set enable_sandbox=found. +AS_CASE([$enable_sandbox], + [auto | capsicum], [ + AX_CHECK_CAPSICUM([enable_sandbox=found], [:]) + ] +) +AS_CASE([$enable_sandbox], + [auto | pledge], [ + AC_CHECK_FUNCS([pledge], [enable_sandbox=found ; break]) + ] +) + +# If a specific sandboxing method was explicitly requested and it wasn't +# found, give an error. +case $enable_sandbox in + auto | no | found) + ;; + *) + AC_MSG_ERROR([$enable_sandbox support not found]) + ;; +esac + + +############################################################################### +# If using GCC, set some additional AM_CFLAGS: +############################################################################### + +if test "$GCC" = yes ; then + echo + echo "GCC extensions:" +fi + +# Always do the visibility check but don't set AM_CFLAGS on Windows. +# This way things get set properly even on Windows. +gl_VISIBILITY +if test -n "$CFLAG_VISIBILITY" && test "$is_w32" = no; then + AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY" +fi + +AS_IF([test "$GCC" = yes], [ + # Enable as much warnings as possible. These commented warnings won't + # work for this package though: + # * -Wunreachable-code breaks several assert(0) cases, which are + # backed up with "return LZMA_PROG_ERROR". + # * -Wcast-qual would break various things where we need a non-const + # pointer although we don't modify anything through it. + # * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations + # don't seem so useful here; at least the last one gives some + # warnings which are not bugs. + # * -Wconversion still shows too many warnings. + # + # The flags before the empty line are for GCC and many of them + # are supported by Clang too. The flags after the empty line are + # for Clang. + for NEW_FLAG in \ + -Wall \ + -Wextra \ + -Wvla \ + -Wc99-c11-compat \ + -Wformat=2 \ + -Winit-self \ + -Wmissing-include-dirs \ + -Wshift-overflow=2 \ + -Wstrict-overflow=3 \ + -Walloc-zero \ + -Wduplicated-cond \ + -Wfloat-equal \ + -Wundef \ + -Wshadow \ + -Wpointer-arith \ + -Wbad-function-cast \ + -Wwrite-strings \ + -Wdate-time \ + -Wsign-conversion \ + -Wfloat-conversion \ + -Wlogical-op \ + -Waggregate-return \ + -Wstrict-prototypes \ + -Wold-style-definition \ + -Wmissing-prototypes \ + -Wmissing-declarations \ + -Wredundant-decls \ + \ + -Wc99-compat \ + -Wc11-extensions \ + -Wc2x-compat \ + -Wc2x-extensions \ + -Wpre-c2x-compat \ + -Warray-bounds-pointer-arithmetic \ + -Wassign-enum \ + -Wconditional-uninitialized \ + -Wdocumentation \ + -Wduplicate-enum \ + -Wempty-translation-unit \ + -Wflexible-array-extensions \ + -Wmissing-variable-declarations \ + -Wnewline-eof \ + -Wshift-sign-overflow \ + -Wstring-conversion + do + AC_MSG_CHECKING([if $CC accepts $NEW_FLAG]) + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $NEW_FLAG -Werror" + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [[void foo(void); void foo(void) { }]])], [ + AM_CFLAGS="$AM_CFLAGS $NEW_FLAG" + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + ]) + CFLAGS="$OLD_CFLAGS" + done + + AC_ARG_ENABLE([werror], + AS_HELP_STRING([--enable-werror], [Enable -Werror to abort + compilation on all compiler warnings.]), + [], [enable_werror=no]) + if test "x$enable_werror" = "xyes"; then + AM_CFLAGS="$AM_CFLAGS -Werror" + fi +]) + + +############################################################################### +# Create the makefiles and config.h +############################################################################### + +echo + +# Don't build the lib directory at all if we don't need any replacement +# functions. +AM_CONDITIONAL([COND_GNULIB], test -n "$LIBOBJS") + +# Add default AM_CFLAGS. +AC_SUBST([AM_CFLAGS]) + +# This is needed for src/scripts. +xz=`echo xz | sed "$program_transform_name"` +AC_SUBST([xz]) + +AC_CONFIG_FILES([ + Makefile + po/Makefile.in + lib/Makefile + src/Makefile + src/liblzma/Makefile + src/liblzma/api/Makefile + src/xz/Makefile + src/xzdec/Makefile + src/lzmainfo/Makefile + src/scripts/Makefile + tests/Makefile + debug/Makefile +]) +AC_CONFIG_FILES([src/scripts/xzdiff], [chmod +x src/scripts/xzdiff]) +AC_CONFIG_FILES([src/scripts/xzgrep], [chmod +x src/scripts/xzgrep]) +AC_CONFIG_FILES([src/scripts/xzmore], [chmod +x src/scripts/xzmore]) +AC_CONFIG_FILES([src/scripts/xzless], [chmod +x src/scripts/xzless]) + +AC_OUTPUT + +# Some warnings +if test x$tuklib_cv_physmem_method = xunknown; then + echo + echo "WARNING:" + echo "No supported method to detect the amount of RAM." + echo "Consider using --enable-assume-ram (if you didn't already)" + echo "or make a patch to add support for this operating system." +fi + +if test x$tuklib_cv_cpucores_method = xunknown; then + echo + echo "WARNING:" + echo "No supported method to detect the number of CPU cores." +fi + +if test "x$enable_threads$enable_small$have_func_attribute_constructor" \ + = xnoyesno; then + echo + echo "NOTE:" + echo "liblzma will be thread-unsafe due to the combination" + echo "of --disable-threads --enable-small when using a compiler" + echo "that doesn't support __attribute__((__constructor__))." +fi diff --git a/debug/Makefile.am b/debug/Makefile.am new file mode 100644 index 0000000..9026fd9 --- /dev/null +++ b/debug/Makefile.am @@ -0,0 +1,30 @@ +## +## Author: Lasse Collin +## +## This file has been put into the public domain. +## You can do whatever you want with this file. +## + +EXTRA_DIST = \ + translation.bash + +noinst_PROGRAMS = \ + repeat \ + sync_flush \ + full_flush \ + memusage \ + crc32 \ + known_sizes \ + hex2bin + +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/common \ + -I$(top_srcdir)/src/liblzma/api + +LDADD = $(top_builddir)/src/liblzma/liblzma.la + +if COND_GNULIB +LDADD += $(top_builddir)/lib/libgnu.a +endif + +LDADD += $(LTLIBINTL) diff --git a/debug/Makefile.in b/debug/Makefile.in new file mode 100644 index 0000000..256be27 --- /dev/null +++ b/debug/Makefile.in @@ -0,0 +1,735 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = repeat$(EXEEXT) sync_flush$(EXEEXT) \ + full_flush$(EXEEXT) memusage$(EXEEXT) crc32$(EXEEXT) \ + known_sizes$(EXEEXT) hex2bin$(EXEEXT) +@COND_GNULIB_TRUE@am__append_1 = $(top_builddir)/lib/libgnu.a +subdir = debug +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_capsicum.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/posix-shell.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/tuklib_common.m4 \ + $(top_srcdir)/m4/tuklib_cpucores.m4 \ + $(top_srcdir)/m4/tuklib_integer.m4 \ + $(top_srcdir)/m4/tuklib_mbstr.m4 \ + $(top_srcdir)/m4/tuklib_physmem.m4 \ + $(top_srcdir)/m4/tuklib_progname.m4 \ + $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +crc32_SOURCES = crc32.c +crc32_OBJECTS = crc32.$(OBJEXT) +crc32_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +crc32_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \ + $(am__append_1) $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +full_flush_SOURCES = full_flush.c +full_flush_OBJECTS = full_flush.$(OBJEXT) +full_flush_LDADD = $(LDADD) +full_flush_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \ + $(am__append_1) $(am__DEPENDENCIES_1) +hex2bin_SOURCES = hex2bin.c +hex2bin_OBJECTS = hex2bin.$(OBJEXT) +hex2bin_LDADD = $(LDADD) +hex2bin_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \ + $(am__append_1) $(am__DEPENDENCIES_1) +known_sizes_SOURCES = known_sizes.c +known_sizes_OBJECTS = known_sizes.$(OBJEXT) +known_sizes_LDADD = $(LDADD) +known_sizes_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \ + $(am__append_1) $(am__DEPENDENCIES_1) +memusage_SOURCES = memusage.c +memusage_OBJECTS = memusage.$(OBJEXT) +memusage_LDADD = $(LDADD) +memusage_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \ + $(am__append_1) $(am__DEPENDENCIES_1) +repeat_SOURCES = repeat.c +repeat_OBJECTS = repeat.$(OBJEXT) +repeat_LDADD = $(LDADD) +repeat_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \ + $(am__append_1) $(am__DEPENDENCIES_1) +sync_flush_SOURCES = sync_flush.c +sync_flush_OBJECTS = sync_flush.$(OBJEXT) +sync_flush_LDADD = $(LDADD) +sync_flush_DEPENDENCIES = $(top_builddir)/src/liblzma/liblzma.la \ + $(am__append_1) $(am__DEPENDENCIES_1) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/crc32.Po ./$(DEPDIR)/full_flush.Po \ + ./$(DEPDIR)/hex2bin.Po ./$(DEPDIR)/known_sizes.Po \ + ./$(DEPDIR)/memusage.Po ./$(DEPDIR)/repeat.Po \ + ./$(DEPDIR)/sync_flush.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = crc32.c full_flush.c hex2bin.c known_sizes.c memusage.c \ + repeat.c sync_flush.c +DIST_SOURCES = crc32.c full_flush.c hex2bin.c known_sizes.c memusage.c \ + repeat.c sync_flush.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp README +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAPSICUM_LIB = @CAPSICUM_LIB@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_EXEEXT = @LN_EXEEXT@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSIX_SHELL = @POSIX_SHELL@ +POSUB = @POSUB@ +PREFERABLY_POSIX_SHELL = @PREFERABLY_POSIX_SHELL@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +enable_path_for_scripts = @enable_path_for_scripts@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +xz = @xz@ +EXTRA_DIST = \ + translation.bash + +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/common \ + -I$(top_srcdir)/src/liblzma/api + +LDADD = $(top_builddir)/src/liblzma/liblzma.la $(am__append_1) \ + $(LTLIBINTL) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign debug/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign debug/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +crc32$(EXEEXT): $(crc32_OBJECTS) $(crc32_DEPENDENCIES) $(EXTRA_crc32_DEPENDENCIES) + @rm -f crc32$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(crc32_OBJECTS) $(crc32_LDADD) $(LIBS) + +full_flush$(EXEEXT): $(full_flush_OBJECTS) $(full_flush_DEPENDENCIES) $(EXTRA_full_flush_DEPENDENCIES) + @rm -f full_flush$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(full_flush_OBJECTS) $(full_flush_LDADD) $(LIBS) + +hex2bin$(EXEEXT): $(hex2bin_OBJECTS) $(hex2bin_DEPENDENCIES) $(EXTRA_hex2bin_DEPENDENCIES) + @rm -f hex2bin$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(hex2bin_OBJECTS) $(hex2bin_LDADD) $(LIBS) + +known_sizes$(EXEEXT): $(known_sizes_OBJECTS) $(known_sizes_DEPENDENCIES) $(EXTRA_known_sizes_DEPENDENCIES) + @rm -f known_sizes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(known_sizes_OBJECTS) $(known_sizes_LDADD) $(LIBS) + +memusage$(EXEEXT): $(memusage_OBJECTS) $(memusage_DEPENDENCIES) $(EXTRA_memusage_DEPENDENCIES) + @rm -f memusage$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memusage_OBJECTS) $(memusage_LDADD) $(LIBS) + +repeat$(EXEEXT): $(repeat_OBJECTS) $(repeat_DEPENDENCIES) $(EXTRA_repeat_DEPENDENCIES) + @rm -f repeat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(repeat_OBJECTS) $(repeat_LDADD) $(LIBS) + +sync_flush$(EXEEXT): $(sync_flush_OBJECTS) $(sync_flush_DEPENDENCIES) $(EXTRA_sync_flush_DEPENDENCIES) + @rm -f sync_flush$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sync_flush_OBJECTS) $(sync_flush_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full_flush.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hex2bin.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/known_sizes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memusage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repeat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_flush.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/crc32.Po + -rm -f ./$(DEPDIR)/full_flush.Po + -rm -f ./$(DEPDIR)/hex2bin.Po + -rm -f ./$(DEPDIR)/known_sizes.Po + -rm -f ./$(DEPDIR)/memusage.Po + -rm -f ./$(DEPDIR)/repeat.Po + -rm -f ./$(DEPDIR)/sync_flush.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/crc32.Po + -rm -f ./$(DEPDIR)/full_flush.Po + -rm -f ./$(DEPDIR)/hex2bin.Po + -rm -f ./$(DEPDIR)/known_sizes.Po + -rm -f ./$(DEPDIR)/memusage.Po + -rm -f ./$(DEPDIR)/repeat.Po + -rm -f ./$(DEPDIR)/sync_flush.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man 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 tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/debug/README b/debug/README new file mode 100644 index 0000000..d42b272 --- /dev/null +++ b/debug/README @@ -0,0 +1,17 @@ + +Debug tools +----------- + + This directory contains a few tiny programs that may be helpful when + debugging XZ Utils. + + These tools are not meant to be installed. Often one needs to edit + the source code a little to make the programs do the wanted things. + If you don't know how these programs could help you, it is likely + that they really are useless to you. + + These aren't intended to be used as example programs. They take some + shortcuts here and there, which correct programs should not do. Many + possible errors (especially I/O errors) are ignored. Don't report + bugs or send patches to fix this kind of bugs. + diff --git a/debug/crc32.c b/debug/crc32.c new file mode 100644 index 0000000..e545a3c --- /dev/null +++ b/debug/crc32.c @@ -0,0 +1,39 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32.c +/// \brief Primitive CRC32 calculation tool +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include + + +int +main(void) +{ + uint32_t crc = 0; + + do { + uint8_t buf[BUFSIZ]; + const size_t size = fread(buf, 1, sizeof(buf), stdin); + crc = lzma_crc32(buf, size, crc); + } while (!ferror(stdin) && !feof(stdin)); + + //printf("%08" PRIX32 "\n", crc); + + // I want it little endian so it's easy to work with hex editor. + printf("%02" PRIX32 " ", crc & 0xFF); + printf("%02" PRIX32 " ", (crc >> 8) & 0xFF); + printf("%02" PRIX32 " ", (crc >> 16) & 0xFF); + printf("%02" PRIX32 " ", crc >> 24); + printf("\n"); + + return 0; +} diff --git a/debug/full_flush.c b/debug/full_flush.c new file mode 100644 index 0000000..227f737 --- /dev/null +++ b/debug/full_flush.c @@ -0,0 +1,103 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file full_flush.c +/// \brief Encode files using LZMA_FULL_FLUSH +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include + +#define CHUNK 64 + + +static lzma_stream strm = LZMA_STREAM_INIT; +static FILE *file_in; + + +static void +encode(size_t size, lzma_action action) +{ + uint8_t in[CHUNK]; + uint8_t out[CHUNK]; + lzma_ret ret; + + do { + if (strm.avail_in == 0 && size > 0) { + const size_t amount = my_min(size, CHUNK); + strm.avail_in = fread(in, 1, amount, file_in); + strm.next_in = in; + size -= amount; // Intentionally not using avail_in. + } + + strm.next_out = out; + strm.avail_out = CHUNK; + + ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN); + + if (ret != LZMA_OK && ret != LZMA_STREAM_END) { + fprintf(stderr, "%s:%u: %s: ret == %d\n", + __FILE__, __LINE__, __func__, ret); + exit(1); + } + + fwrite(out, 1, CHUNK - strm.avail_out, stdout); + + } while (size > 0 || strm.avail_out == 0); + + if ((action == LZMA_RUN && ret != LZMA_OK) + || (action != LZMA_RUN && ret != LZMA_STREAM_END)) { + fprintf(stderr, "%s:%u: %s: ret == %d\n", + __FILE__, __LINE__, __func__, ret); + exit(1); + } +} + + +int +main(int argc, char **argv) +{ + file_in = argc > 1 ? fopen(argv[1], "rb") : stdin; + + + // Config + lzma_options_lzma opt_lzma; + if (lzma_lzma_preset(&opt_lzma, 1)) { + fprintf(stderr, "preset failed\n"); + exit(1); + } + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + filters[0].id = LZMA_FILTER_LZMA2; + filters[0].options = &opt_lzma; + filters[1].id = LZMA_VLI_UNKNOWN; + + // Init + if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) { + fprintf(stderr, "init failed\n"); + exit(1); + } + +// if (lzma_easy_encoder(&strm, 1)) { +// fprintf(stderr, "init failed\n"); +// exit(1); +// } + + // Encoding + encode(0, LZMA_FULL_FLUSH); + encode(6, LZMA_FULL_FLUSH); + encode(0, LZMA_FULL_FLUSH); + encode(7, LZMA_FULL_FLUSH); + encode(0, LZMA_FULL_FLUSH); + encode(0, LZMA_FINISH); + + // Clean up + lzma_end(&strm); + + return 0; +} diff --git a/debug/hex2bin.c b/debug/hex2bin.c new file mode 100644 index 0000000..7324624 --- /dev/null +++ b/debug/hex2bin.c @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file hex2bin.c +/// \brief Converts hexadecimal input strings to binary +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include +#include + + +static int +getbin(int x) +{ + if (x >= '0' && x <= '9') + return x - '0'; + + if (x >= 'A' && x <= 'F') + return x - 'A' + 10; + + return x - 'a' + 10; +} + + +int +main(void) +{ + while (true) { + int byte = getchar(); + if (byte == EOF) + return 0; + if (!isxdigit(byte)) + continue; + + const int digit = getchar(); + if (digit == EOF || !isxdigit(digit)) { + fprintf(stderr, "Invalid input\n"); + return 1; + } + + byte = (getbin(byte) << 4) | getbin(digit); + if (putchar(byte) == EOF) { + perror(NULL); + return 1; + } + } +} diff --git a/debug/known_sizes.c b/debug/known_sizes.c new file mode 100644 index 0000000..6c3641f --- /dev/null +++ b/debug/known_sizes.c @@ -0,0 +1,129 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file known_sizes.c +/// \brief Encodes .lzma Stream with sizes known in Block Header +/// +/// The input file is encoded in RAM, and the known Compressed Size +/// and/or Uncompressed Size values are stored in the Block Header. +/// As of writing there's no such Stream encoder in liblzma. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include +#include +#include +#include + + +// Support file sizes up to 1 MiB. We use this for output space too, so files +// close to 1 MiB had better compress at least a little or we have a buffer +// overflow. +#define BUFFER_SIZE (1U << 20) + + +int +main(void) +{ + // Allocate the buffers. + uint8_t *in = malloc(BUFFER_SIZE); + uint8_t *out = malloc(BUFFER_SIZE); + if (in == NULL || out == NULL) + return 1; + + // Fill the input buffer. + const size_t in_size = fread(in, 1, BUFFER_SIZE, stdin); + + // Filter setup + lzma_options_lzma opt_lzma; + if (lzma_lzma_preset(&opt_lzma, 1)) + return 1; + + lzma_filter filters[] = { + { + .id = LZMA_FILTER_LZMA2, + .options = &opt_lzma + }, + { + .id = LZMA_VLI_UNKNOWN + } + }; + + lzma_block block = { + .check = LZMA_CHECK_CRC32, + .compressed_size = BUFFER_SIZE, // Worst case reserve + .uncompressed_size = in_size, + .filters = filters, + }; + + lzma_stream strm = LZMA_STREAM_INIT; + if (lzma_block_encoder(&strm, &block) != LZMA_OK) + return 1; + + // Reserve space for Stream Header and Block Header. We need to + // calculate the size of the Block Header first. + if (lzma_block_header_size(&block) != LZMA_OK) + return 1; + + size_t out_size = LZMA_STREAM_HEADER_SIZE + block.header_size; + + strm.next_in = in; + strm.avail_in = in_size; + strm.next_out = out + out_size; + strm.avail_out = BUFFER_SIZE - out_size; + + if (lzma_code(&strm, LZMA_FINISH) != LZMA_STREAM_END) + return 1; + + out_size += strm.total_out; + + if (lzma_block_header_encode(&block, out + LZMA_STREAM_HEADER_SIZE) + != LZMA_OK) + return 1; + + lzma_index *idx = lzma_index_init(NULL); + if (idx == NULL) + return 1; + + if (lzma_index_append(idx, NULL, block.header_size + strm.total_out, + strm.total_in) != LZMA_OK) + return 1; + + if (lzma_index_encoder(&strm, idx) != LZMA_OK) + return 1; + + if (lzma_code(&strm, LZMA_RUN) != LZMA_STREAM_END) + return 1; + + out_size += strm.total_out; + + lzma_end(&strm); + + lzma_index_end(idx, NULL); + + // Encode the Stream Header and Stream Footer. backwards_size is + // needed only for the Stream Footer. + lzma_stream_flags sf = { + .backward_size = strm.total_out, + .check = block.check, + }; + + if (lzma_stream_header_encode(&sf, out) != LZMA_OK) + return 1; + + if (lzma_stream_footer_encode(&sf, out + out_size) != LZMA_OK) + return 1; + + out_size += LZMA_STREAM_HEADER_SIZE; + + // Write out the file. + fwrite(out, 1, out_size, stdout); + + return 0; +} diff --git a/debug/memusage.c b/debug/memusage.c new file mode 100644 index 0000000..bd72b5a --- /dev/null +++ b/debug/memusage.c @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file memusage.c +/// \brief Calculates memory usage using lzma_memory_usage() +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include + +int +main(void) +{ + lzma_options_lzma lzma = { + .dict_size = (1U << 30) + (1U << 29), + .lc = 3, + .lp = 0, + .pb = 2, + .preset_dict = NULL, + .preset_dict_size = 0, + .mode = LZMA_MODE_NORMAL, + .nice_len = 48, + .mf = LZMA_MF_BT4, + .depth = 0, + }; + +/* + lzma_options_filter filters[] = { + { LZMA_FILTER_LZMA1, + (lzma_options_lzma *)&lzma_preset_lzma[6 - 1] }, + { UINT64_MAX, NULL } + }; +*/ + lzma_filter filters[] = { + { LZMA_FILTER_LZMA1, &lzma }, + { UINT64_MAX, NULL } + }; + + printf("Encoder: %10" PRIu64 " B\n", + lzma_raw_encoder_memusage(filters)); + printf("Decoder: %10" PRIu64 " B\n", + lzma_raw_decoder_memusage(filters)); + + return 0; +} diff --git a/debug/repeat.c b/debug/repeat.c new file mode 100644 index 0000000..a00bde2 --- /dev/null +++ b/debug/repeat.c @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file repeat.c +/// \brief Repeats given string given times +/// +/// This program can be useful when debugging run-length encoder in +/// the Subblock filter, especially the condition when repeat count +/// doesn't fit into 28-bit integer. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include + + +int +main(int argc, char **argv) +{ + if (argc != 3) { + fprintf(stderr, "Usage: %s COUNT STRING\n", argv[0]); + exit(1); + } + + unsigned long long count = strtoull(argv[1], NULL, 10); + const size_t size = strlen(argv[2]); + + while (count-- != 0) + fwrite(argv[2], 1, size, stdout); + + return !!(ferror(stdout) || fclose(stdout)); +} diff --git a/debug/sync_flush.c b/debug/sync_flush.c new file mode 100644 index 0000000..2292333 --- /dev/null +++ b/debug/sync_flush.c @@ -0,0 +1,125 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file sync_flush.c +/// \brief Encode files using LZMA_SYNC_FLUSH +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include + +#define CHUNK 64 + + +static lzma_stream strm = LZMA_STREAM_INIT; +static FILE *file_in; + + +static void +encode(size_t size, lzma_action action) +{ + uint8_t in[CHUNK]; + uint8_t out[CHUNK]; + lzma_ret ret; + + do { + if (strm.avail_in == 0 && size > 0) { + const size_t amount = my_min(size, CHUNK); + strm.avail_in = fread(in, 1, amount, file_in); + strm.next_in = in; + size -= amount; // Intentionally not using avail_in. + } + + strm.next_out = out; + strm.avail_out = CHUNK; + + ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN); + + if (ret != LZMA_OK && ret != LZMA_STREAM_END) { + fprintf(stderr, "%s:%u: %s: ret == %d\n", + __FILE__, __LINE__, __func__, ret); + exit(1); + } + + fwrite(out, 1, CHUNK - strm.avail_out, stdout); + + } while (size > 0 || strm.avail_out == 0); + + if ((action == LZMA_RUN && ret != LZMA_OK) + || (action != LZMA_RUN && ret != LZMA_STREAM_END)) { + fprintf(stderr, "%s:%u: %s: ret == %d\n", + __FILE__, __LINE__, __func__, ret); + exit(1); + } +} + + +int +main(int argc, char **argv) +{ + file_in = argc > 1 ? fopen(argv[1], "rb") : stdin; + + // Config + lzma_options_lzma opt_lzma = { + .dict_size = 1U << 16, + .lc = LZMA_LC_DEFAULT, + .lp = LZMA_LP_DEFAULT, + .pb = LZMA_PB_DEFAULT, + .preset_dict = NULL, + .mode = LZMA_MODE_NORMAL, + .nice_len = 32, + .mf = LZMA_MF_HC3, + .depth = 0, + }; + + lzma_options_delta opt_delta = { + .dist = 16 + }; + + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + filters[0].id = LZMA_FILTER_LZMA2; + filters[0].options = &opt_lzma; + filters[1].id = LZMA_VLI_UNKNOWN; + + // Init + if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) { + fprintf(stderr, "init failed\n"); + exit(1); + } + + // Encoding + encode(0, LZMA_SYNC_FLUSH); + encode(6, LZMA_SYNC_FLUSH); + encode(0, LZMA_SYNC_FLUSH); + encode(7, LZMA_SYNC_FLUSH); + encode(0, LZMA_SYNC_FLUSH); + encode(0, LZMA_FINISH); + +/* + encode(53, LZMA_SYNC_FLUSH); + opt_lzma.lc = 2; + opt_lzma.lp = 1; + opt_lzma.pb = 0; + if (lzma_filters_update(&strm, filters) != LZMA_OK) { + fprintf(stderr, "update failed\n"); + exit(1); + } + encode(404, LZMA_FINISH); +*/ + + // Clean up + lzma_end(&strm); + + return 0; + + // Prevent useless warnings so we don't need to have special CFLAGS + // to disable -Werror. + (void)opt_lzma; + (void)opt_delta; +} diff --git a/debug/translation.bash b/debug/translation.bash new file mode 100644 index 0000000..df4210d --- /dev/null +++ b/debug/translation.bash @@ -0,0 +1,100 @@ +#!/bin/bash + +############################################################################### +# +# Script to check output of some translated messages +# +# This should be useful for translators to check that the translated strings +# look good. This doesn't make xz print all possible strings, but it should +# cover most of the cases where mistakes can easily happen. +# +# Give the path and filename of the xz executable as an argument. If no +# arguments are given, this script uses ../src/xz/xz (relative to the +# location of this script). +# +# You may want to pipe the output of this script to less -S to view the +# tables printed by xz --list on a 80-column terminal. On the other hand, +# viewing the other messages may be better without -S. +# +############################################################################### +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +set -e + +# If an argument was given, use it to set the location of the xz executable. +unset XZ +if [ -n "$1" ]; then + XZ=$1 + [ "x${XZ:0:1}" != "x/" ] && XZ="$PWD/$XZ" +fi + +# Locate top_srcdir and go there. +top_srcdir="$(cd -- "$(dirname -- "$0")" && cd .. && pwd)" +cd -- "$top_srcdir" + +# If XZ wasn't already set, use the default location. +XZ=${XZ-"$PWD/src/xz/xz"} +if [ "$(type -t "$XZ" || true)" != "file" ]; then + echo "Give the location of the xz executable as an argument" \ + "to this script." + exit 1 +fi +XZ=$(type -p -- "$XZ") + +# Print the xz version and locale information. +echo "$XZ --version" +"$XZ" --version +echo +if [ -d .git ] && type git > /dev/null 2>&1; then + echo "Source code version in $PWD:" + git describe --abbrev=4 +fi +echo +locale +echo + +# Make the test files directory the current directory. +cd tests/files + +# Put xz in PATH so that argv[0] stays short. +PATH=${XZ%/*}:$PATH + +# Some of the test commands are error messages and thus don't +# return successfully. +set +e + +for CMD in \ + "xz --foobarbaz" \ + "xz --memlimit=123abcd" \ + "xz --memlimit=40MiB -6 /dev/null" \ + "xz --memlimit=0 --info-memory" \ + "xz --memlimit-compress=1234MiB --memlimit-decompress=50MiB --info-memory" \ + "xz --verbose --verbose /dev/null | cat" \ + "xz --lzma2=foobarbaz" \ + "xz --lzma2=foobarbaz=abcd" \ + "xz --lzma2=mf=abcd" \ + "xz --lzma2=preset=foobarbaz" \ + "xz --lzma2=mf=bt4,nice=2" \ + "xz --lzma2=nice=50000" \ + "xz --help" \ + "xz --long-help" \ + "xz --list good-*lzma2*" \ + "xz --list good-1-check*" \ + "xz --list --verbose good-*lzma2*" \ + "xz --list --verbose good-1-check*" \ + "xz --list --verbose --verbose good-*lzma2*" \ + "xz --list --verbose --verbose good-1-check*" \ + "xz --list --verbose --verbose unsupported-check.xz" +do + echo "-----------------------------------------------------------" + echo + echo "\$ $CMD" + eval "$CMD" + echo +done 2>&1 diff --git a/doc/api/annotated.html b/doc/api/annotated.html new file mode 100644 index 0000000..4016c49 --- /dev/null +++ b/doc/api/annotated.html @@ -0,0 +1,68 @@ + + + + + + + +liblzma (XZ Utils): Data Structures + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+
Data Structures
+
+
+
Here are the data structures with brief descriptions:
+ + + + + + + + + + + +
 Clzma_allocatorCustom functions for memory handling
 Clzma_blockOptions for the Block and Block Header encoders and decoders
 Clzma_filterFilter options
 Clzma_index_iterIterator to get information about Blocks and Streams
 Clzma_mtMultithreading options
 Clzma_options_bcjOptions for BCJ filters
 Clzma_options_deltaOptions for the Delta filter
 Clzma_options_lzmaOptions specific to the LZMA1 and LZMA2 filters
 Clzma_streamPassing data to and from liblzma
 Clzma_stream_flagsOptions for encoding/decoding Stream Header and Stream Footer
+
+
+ + + + diff --git a/doc/api/base_8h.html b/doc/api/base_8h.html new file mode 100644 index 0000000..417ccef --- /dev/null +++ b/doc/api/base_8h.html @@ -0,0 +1,580 @@ + + + + + + + +liblzma (XZ Utils): lzma/base.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
base.h File Reference
+
+
+ +

Data types and functions used in many places in liblzma API. +More...

+ + + + + + + + +

+Data Structures

struct  lzma_allocator
 Custom functions for memory handling. More...
 
struct  lzma_stream
 Passing data to and from liblzma. More...
 
+ + + + +

+Macros

#define LZMA_STREAM_INIT
 Initialization for lzma_stream.
 
+ + + + + + + +

+Typedefs

typedef unsigned char lzma_bool
 Boolean.
 
typedef struct lzma_internal_s lzma_internal
 Internal data structure.
 
+ + + + + + + + + + +

+Enumerations

enum  lzma_reserved_enum { LZMA_RESERVED_ENUM = 0 + }
 Type of reserved enumeration variable in structures. More...
 
enum  lzma_ret {
+  LZMA_OK = 0 +, LZMA_STREAM_END = 1 +, LZMA_NO_CHECK = 2 +, LZMA_UNSUPPORTED_CHECK = 3 +,
+  LZMA_GET_CHECK = 4 +, LZMA_MEM_ERROR = 5 +, LZMA_MEMLIMIT_ERROR = 6 +, LZMA_FORMAT_ERROR = 7 +,
+  LZMA_OPTIONS_ERROR = 8 +, LZMA_DATA_ERROR = 9 +, LZMA_BUF_ERROR = 10 +, LZMA_PROG_ERROR = 11 +,
+  LZMA_SEEK_NEEDED = 12 +, LZMA_RET_INTERNAL1 = 101 +, LZMA_RET_INTERNAL2 = 102 +, LZMA_RET_INTERNAL3 = 103 +,
+  LZMA_RET_INTERNAL4 = 104 +, LZMA_RET_INTERNAL5 = 105 +, LZMA_RET_INTERNAL6 = 106 +, LZMA_RET_INTERNAL7 = 107 +,
+  LZMA_RET_INTERNAL8 = 108 +
+ }
 Return values used by several functions in liblzma. More...
 
enum  lzma_action {
+  LZMA_RUN = 0 +, LZMA_SYNC_FLUSH = 1 +, LZMA_FULL_FLUSH = 2 +, LZMA_FULL_BARRIER = 4 +,
+  LZMA_FINISH = 3 +
+ }
 The `action' argument for lzma_code() More...
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

lzma_ret lzma_code (lzma_stream *strm, lzma_action action) lzma_nothrow lzma_attr_warn_unused_result
 Encode or decode data.
 
void lzma_end (lzma_stream *strm) lzma_nothrow
 Free memory allocated for the coder data structures.
 
void lzma_get_progress (lzma_stream *strm, uint64_t *progress_in, uint64_t *progress_out) lzma_nothrow
 Get progress information.
 
uint64_t lzma_memusage (const lzma_stream *strm) lzma_nothrow lzma_attr_pure
 Get the memory usage of decoder filter chain.
 
uint64_t lzma_memlimit_get (const lzma_stream *strm) lzma_nothrow lzma_attr_pure
 Get the current memory usage limit.
 
lzma_ret lzma_memlimit_set (lzma_stream *strm, uint64_t memlimit) lzma_nothrow
 Set the memory usage limit.
 
+

Detailed Description

+

Data types and functions used in many places in liblzma API.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ LZMA_STREAM_INIT

+ +
+
+ + + + +
#define LZMA_STREAM_INIT
+
+Value:
{ NULL, 0, 0, NULL, 0, 0, NULL, NULL, \
+
NULL, NULL, NULL, NULL, 0, 0, 0, 0, \
+
LZMA_RESERVED_ENUM, LZMA_RESERVED_ENUM }
+
+

Initialization for lzma_stream.

+

When you declare an instance of lzma_stream, you can immediately initialize it so that initialization functions know that no memory has been allocated yet:

+

lzma_stream strm = LZMA_STREAM_INIT;

+

If you need to initialize a dynamically allocated lzma_stream, you can use memset(strm_pointer, 0, sizeof(lzma_stream)). Strictly speaking, this violates the C standard since NULL may have different internal representation than zero, but it should be portable enough in practice. Anyway, for maximum portability, you can use something like this:

+

lzma_stream tmp = LZMA_STREAM_INIT; *strm = tmp;

+ +
+
+

Typedef Documentation

+ +

◆ lzma_bool

+ +
+
+ + + + +
typedef unsigned char lzma_bool
+
+ +

Boolean.

+

This is here because C89 doesn't have stdbool.h. To set a value for variables having type lzma_bool, you can use

    +
  • C99's `true' and `false' from stdbool.h;
  • +
  • C++'s internal `true' and `false'; or
  • +
  • integers one (true) and zero (false).
  • +
+ +
+
+ +

◆ lzma_internal

+ +
+
+ + + + +
typedef struct lzma_internal_s lzma_internal
+
+ +

Internal data structure.

+

The contents of this structure is not visible outside the library.

+ +
+
+

Enumeration Type Documentation

+ +

◆ lzma_reserved_enum

+ +
+
+ + + + +
enum lzma_reserved_enum
+
+ +

Type of reserved enumeration variable in structures.

+

To avoid breaking library ABI when new features are added, several structures contain extra variables that may be used in future. Since sizeof(enum) can be different than sizeof(int), and sizeof(enum) may even vary depending on the range of enumeration constants, we specify a separate type to be used for reserved enumeration variables. All enumeration constants in liblzma API will be non-negative and less than 128, which should guarantee that the ABI won't break even when new constants are added to existing enumerations.

+ +
+
+ +

◆ lzma_ret

+ +
+
+ + + + +
enum lzma_ret
+
+ +

Return values used by several functions in liblzma.

+

Check the descriptions of specific functions to find out which return values they can return. With some functions the return values may have more specific meanings than described here; those differences are described per-function basis.

+ + + + + + + + + + + + + + +
Enumerator
LZMA_OK 

Operation completed successfully.

+
LZMA_STREAM_END 

End of stream was reached.

+

In encoder, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or LZMA_FINISH was finished. In decoder, this indicates that all the data was successfully decoded.

+

In all cases, when LZMA_STREAM_END is returned, the last output bytes should be picked from strm->next_out.

+
LZMA_NO_CHECK 

Input stream has no integrity check.

+

This return value can be returned only if the LZMA_TELL_NO_CHECK flag was used when initializing the decoder. LZMA_NO_CHECK is just a warning, and the decoding can be continued normally.

+

It is possible to call lzma_get_check() immediately after lzma_code has returned LZMA_NO_CHECK. The result will naturally be LZMA_CHECK_NONE, but the possibility to call lzma_get_check() may be convenient in some applications.

+
LZMA_UNSUPPORTED_CHECK 

Cannot calculate the integrity check.

+

The usage of this return value is different in encoders and decoders.

+

Encoders can return this value only from the initialization function. If initialization fails with this value, the encoding cannot be done, because there's no way to produce output with the correct integrity check.

+

Decoders can return this value only from lzma_code() and only if the LZMA_TELL_UNSUPPORTED_CHECK flag was used when initializing the decoder. The decoding can still be continued normally even if the check type is unsupported, but naturally the check will not be validated, and possible errors may go undetected.

+

With decoder, it is possible to call lzma_get_check() immediately after lzma_code() has returned LZMA_UNSUPPORTED_CHECK. This way it is possible to find out what the unsupported Check ID was.

+
LZMA_GET_CHECK 

Integrity check type is now available.

+

This value can be returned only by the lzma_code() function and only if the decoder was initialized with the LZMA_TELL_ANY_CHECK flag. LZMA_GET_CHECK tells the application that it may now call lzma_get_check() to find out the Check ID. This can be used, for example, to implement a decoder that accepts only files that have strong enough integrity check.

+
LZMA_MEM_ERROR 

Cannot allocate memory.

+

Memory allocation failed, or the size of the allocation would be greater than SIZE_MAX.

+

Due to internal implementation reasons, the coding cannot be continued even if more memory were made available after LZMA_MEM_ERROR.

+
LZMA_MEMLIMIT_ERROR 

Memory usage limit was reached.

+

Decoder would need more memory than allowed by the specified memory usage limit. To continue decoding, the memory usage limit has to be increased with lzma_memlimit_set().

+

liblzma 5.2.6 and earlier had a bug in single-threaded .xz decoder (lzma_stream_decoder()) which made it impossible to continue decoding after LZMA_MEMLIMIT_ERROR even if the limit was increased using lzma_memlimit_set(). Other decoders worked correctly.

+
LZMA_FORMAT_ERROR 

File format not recognized.

+

The decoder did not recognize the input as supported file format. This error can occur, for example, when trying to decode .lzma format file with lzma_stream_decoder, because lzma_stream_decoder accepts only the .xz format.

+
LZMA_OPTIONS_ERROR 

Invalid or unsupported options.

+

Invalid or unsupported options, for example

    +
  • unsupported filter(s) or filter options; or
  • +
  • reserved bits set in headers (decoder only).
  • +
+

Rebuilding liblzma with more features enabled, or upgrading to a newer version of liblzma may help.

+
LZMA_DATA_ERROR 

Data is corrupt.

+

The usage of this return value is different in encoders and decoders. In both encoder and decoder, the coding cannot continue after this error.

+

Encoders return this if size limits of the target file format would be exceeded. These limits are huge, thus getting this error from an encoder is mostly theoretical. For example, the maximum compressed and uncompressed size of a .xz Stream is roughly 8 EiB (2^63 bytes).

+

Decoders return this error if the input data is corrupt. This can mean, for example, invalid CRC32 in headers or invalid check of uncompressed data.

+
LZMA_BUF_ERROR 

No progress is possible.

+

This error code is returned when the coder cannot consume any new input and produce any new output. The most common reason for this error is that the input stream being decoded is truncated or corrupt.

+

This error is not fatal. Coding can be continued normally by providing more input and/or more output space, if possible.

+

Typically the first call to lzma_code() that can do no progress returns LZMA_OK instead of LZMA_BUF_ERROR. Only the second consecutive call doing no progress will return LZMA_BUF_ERROR. This is intentional.

+

With zlib, Z_BUF_ERROR may be returned even if the application is doing nothing wrong, so apps will need to handle Z_BUF_ERROR specially. The above hack guarantees that liblzma never returns LZMA_BUF_ERROR to properly written applications unless the input file is truncated or corrupt. This should simplify the applications a little.

+
LZMA_PROG_ERROR 

Programming error.

+

This indicates that the arguments given to the function are invalid or the internal state of the decoder is corrupt.

    +
  • Function arguments are invalid or the structures pointed by the argument pointers are invalid e.g. if strm->next_out has been set to NULL and strm->avail_out > 0 when calling lzma_code().
  • +
  • lzma_* functions have been called in wrong order e.g. lzma_code() was called right after lzma_end().
  • +
  • If errors occur randomly, the reason might be flaky hardware.
  • +
+

If you think that your code is correct, this error code can be a sign of a bug in liblzma. See the documentation how to report bugs.

+
LZMA_SEEK_NEEDED 

Request to change the input file position.

+

Some coders can do random access in the input file. The initialization functions of these coders take the file size as an argument. No other coders can return LZMA_SEEK_NEEDED.

+

When this value is returned, the application must seek to the file position given in lzma_stream.seek_pos. This value is guaranteed to never exceed the file size that was specified at the coder initialization.

+

After seeking the application should read new input and pass it normally via lzma_stream.next_in and .avail_in.

+
+ +
+
+ +

◆ lzma_action

+ +
+
+ + + + +
enum lzma_action
+
+ +

The `action' argument for lzma_code()

+

After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, LZMA_FULL_BARRIER, or LZMA_FINISH, the same `action' must be used until lzma_code() returns LZMA_STREAM_END. Also, the amount of input (that is, strm->avail_in) must not be modified by the application until lzma_code() returns LZMA_STREAM_END. Changing the `action' or modifying the amount of input will make lzma_code() return LZMA_PROG_ERROR.

+ + + + + + +
Enumerator
LZMA_RUN 

Continue coding.

+

Encoder: Encode as much input as possible. Some internal buffering will probably be done (depends on the filter chain in use), which causes latency: the input used won't usually be decodeable from the output of the same lzma_code() call.

+

Decoder: Decode as much input as possible and produce as much output as possible.

+
LZMA_SYNC_FLUSH 

Make all the input available at output.

+

Normally the encoder introduces some latency. LZMA_SYNC_FLUSH forces all the buffered data to be available at output without resetting the internal state of the encoder. This way it is possible to use compressed stream for example for communication over network.

+

Only some filters support LZMA_SYNC_FLUSH. Trying to use LZMA_SYNC_FLUSH with filters that don't support it will make lzma_code() return LZMA_OPTIONS_ERROR. For example, LZMA1 doesn't support LZMA_SYNC_FLUSH but LZMA2 does.

+

Using LZMA_SYNC_FLUSH very often can dramatically reduce the compression ratio. With some filters (for example, LZMA2), fine-tuning the compression options may help mitigate this problem significantly (for example, match finder with LZMA2).

+

Decoders don't support LZMA_SYNC_FLUSH.

+
LZMA_FULL_FLUSH 

Finish encoding of the current Block.

+

All the input data going to the current Block must have been given to the encoder (the last bytes can still be pending in *next_in). Call lzma_code() with LZMA_FULL_FLUSH until it returns LZMA_STREAM_END. Then continue normally with LZMA_RUN or finish the Stream with LZMA_FINISH.

+

This action is currently supported only by Stream encoder and easy encoder (which uses Stream encoder). If there is no unfinished Block, no empty Block is created.

+
LZMA_FULL_BARRIER 

Finish encoding of the current Block.

+

This is like LZMA_FULL_FLUSH except that this doesn't necessarily wait until all the input has been made available via the output buffer. That is, lzma_code() might return LZMA_STREAM_END as soon as all the input has been consumed (avail_in == 0).

+

LZMA_FULL_BARRIER is useful with a threaded encoder if one wants to split the .xz Stream into Blocks at specific offsets but doesn't care if the output isn't flushed immediately. Using LZMA_FULL_BARRIER allows keeping the threads busy while LZMA_FULL_FLUSH would make lzma_code() wait until all the threads have finished until more data could be passed to the encoder.

+

With a lzma_stream initialized with the single-threaded lzma_stream_encoder() or lzma_easy_encoder(), LZMA_FULL_BARRIER is an alias for LZMA_FULL_FLUSH.

+
LZMA_FINISH 

Finish the coding operation.

+

All the input data must have been given to the encoder (the last bytes can still be pending in next_in). Call lzma_code() with LZMA_FINISH until it returns LZMA_STREAM_END. Once LZMA_FINISH has been used, the amount of input must no longer be changed by the application.

+

When decoding, using LZMA_FINISH is optional unless the LZMA_CONCATENATED flag was used when the decoder was initialized. When LZMA_CONCATENATED was not used, the only effect of LZMA_FINISH is that the amount of input must not be changed just like in the encoder.

+
+ +
+
+

Function Documentation

+ +

◆ lzma_code()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_code (lzma_streamstrm,
lzma_action action 
)
+
+ +

Encode or decode data.

+

Once the lzma_stream has been successfully initialized (e.g. with lzma_stream_encoder()), the actual encoding or decoding is done using this function. The application has to update strm->next_in, strm->avail_in, strm->next_out, and strm->avail_out to pass input to and get output from liblzma.

+

See the description of the coder-specific initialization function to find out what `action' values are supported by the coder.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
actionAction for this function to take. Must be a valid lzma_action enum value.
+
+
+
Returns
Any valid lzma_ret. See the lzma_ret enum description for more information.
+ +
+
+ +

◆ lzma_end()

+ +
+
+ + + + + + + + +
void lzma_end (lzma_streamstrm)
+
+ +

Free memory allocated for the coder data structures.

+

After lzma_end(strm), strm->internal is guaranteed to be NULL. No other members of the lzma_stream structure are touched.

+
Note
zlib indicates an error if application end()s unfinished stream structure. liblzma doesn't do this, and assumes that application knows what it is doing.
+
Parameters
+ + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
+
+
+ +
+
+ +

◆ lzma_get_progress()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void lzma_get_progress (lzma_streamstrm,
uint64_t * progress_in,
uint64_t * progress_out 
)
+
+ +

Get progress information.

+

In single-threaded mode, applications can get progress information from strm->total_in and strm->total_out. In multi-threaded mode this is less useful because a significant amount of both input and output data gets buffered internally by liblzma. This makes total_in and total_out give misleading information and also makes the progress indicator updates non-smooth.

+

This function gives realistic progress information also in multi-threaded mode by taking into account the progress made by each thread. In single-threaded mode *progress_in and *progress_out are set to strm->total_in and strm->total_out, respectively.

+
Parameters
+ + + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
[out]progress_inPointer to the number of input bytes processed.
[out]progress_outPointer to the number of output bytes processed.
+
+
+ +
+
+ +

◆ lzma_memusage()

+ +
+
+ + + + + + + + +
uint64_t lzma_memusage (const lzma_streamstrm)
+
+ +

Get the memory usage of decoder filter chain.

+

This function is currently supported only when *strm has been initialized with a function that takes a memlimit argument. With other functions, you should use e.g. lzma_raw_encoder_memusage() or lzma_raw_decoder_memusage() to estimate the memory requirements.

+

This function is useful e.g. after LZMA_MEMLIMIT_ERROR to find out how big the memory usage limit should have been to decode the input. Note that this may give misleading information if decoding .xz Streams that have multiple Blocks, because each Block can have different memory requirements.

+
Parameters
+ + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
+
+
+
Returns
How much memory is currently allocated for the filter decoders. If no filter chain is currently allocated, some non-zero value is still returned, which is less than or equal to what any filter chain would indicate as its memory requirement.
+

If this function isn't supported by *strm or some other error occurs, zero is returned.

+ +
+
+ +

◆ lzma_memlimit_get()

+ +
+
+ + + + + + + + +
uint64_t lzma_memlimit_get (const lzma_streamstrm)
+
+ +

Get the current memory usage limit.

+

This function is supported only when *strm has been initialized with a function that takes a memlimit argument.

+
Parameters
+ + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
+
+
+
Returns
On success, the current memory usage limit is returned (always non-zero). On error, zero is returned.
+ +
+
+ +

◆ lzma_memlimit_set()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_memlimit_set (lzma_streamstrm,
uint64_t memlimit 
)
+
+ +

Set the memory usage limit.

+

This function is supported only when *strm has been initialized with a function that takes a memlimit argument.

+

liblzma 5.2.3 and earlier has a bug where memlimit value of 0 causes this function to do nothing (leaving the limit unchanged) and still return LZMA_OK. Later versions treat 0 as if 1 had been specified (so lzma_memlimit_get() will return 1 even if you specify 0 here).

+

liblzma 5.2.6 and earlier had a bug in single-threaded .xz decoder (lzma_stream_decoder()) which made it impossible to continue decoding after LZMA_MEMLIMIT_ERROR even if the limit was increased using lzma_memlimit_set(). Other decoders worked correctly.

+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: New memory usage limit successfully set.
  • +
  • LZMA_MEMLIMIT_ERROR: The new limit is too small. The limit was not changed.
  • +
  • LZMA_PROG_ERROR: Invalid arguments, e.g. *strm doesn't support memory usage limit.
  • +
+
+ +
+
+
+ + + + diff --git a/doc/api/bc_s.png b/doc/api/bc_s.png new file mode 100644 index 0000000..bb50b82 Binary files /dev/null and b/doc/api/bc_s.png differ diff --git a/doc/api/bc_sd.png b/doc/api/bc_sd.png new file mode 100644 index 0000000..8d8be4c Binary files /dev/null and b/doc/api/bc_sd.png differ diff --git a/doc/api/bcj_8h.html b/doc/api/bcj_8h.html new file mode 100644 index 0000000..1dabca4 --- /dev/null +++ b/doc/api/bcj_8h.html @@ -0,0 +1,105 @@ + + + + + + + +liblzma (XZ Utils): lzma/bcj.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
bcj.h File Reference
+
+
+ +

Branch/Call/Jump conversion filters. +More...

+ + + + + +

+Data Structures

struct  lzma_options_bcj
 Options for BCJ filters. More...
 
+ + + + + + + + + + + + + + + + + + + + + + +

+Macros

+#define LZMA_FILTER_X86   LZMA_VLI_C(0x04)
 Filter for x86 binaries.
 
+#define LZMA_FILTER_POWERPC   LZMA_VLI_C(0x05)
 Filter for Big endian PowerPC binaries.
 
+#define LZMA_FILTER_IA64   LZMA_VLI_C(0x06)
 Filter for IA-64 (Itanium) binaries.
 
+#define LZMA_FILTER_ARM   LZMA_VLI_C(0x07)
 Filter for ARM binaries.
 
+#define LZMA_FILTER_ARMTHUMB   LZMA_VLI_C(0x08)
 Filter for ARM-Thumb binaries.
 
+#define LZMA_FILTER_SPARC   LZMA_VLI_C(0x09)
 Filter for SPARC binaries.
 
+#define LZMA_FILTER_ARM64   LZMA_VLI_C(0x0A)
 Filter for ARM64 binaries.
 
+

Detailed Description

+

Branch/Call/Jump conversion filters.

+
Note
Never include this file directly. Use <lzma.h> instead.
+
+ + + + diff --git a/doc/api/block_8h.html b/doc/api/block_8h.html new file mode 100644 index 0000000..e2e1702 --- /dev/null +++ b/doc/api/block_8h.html @@ -0,0 +1,758 @@ + + + + + + + +liblzma (XZ Utils): lzma/block.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
block.h File Reference
+
+
+ +

.xz Block handling +More...

+ + + + + +

+Data Structures

struct  lzma_block
 Options for the Block and Block Header encoders and decoders. More...
 
+ + + + + + + + +

+Macros

+#define LZMA_BLOCK_HEADER_SIZE_MIN   8
 
+#define LZMA_BLOCK_HEADER_SIZE_MAX   1024
 
#define lzma_block_header_size_decode(b)   (((uint32_t)(b) + 1) * 4)
 Decode the Block Header Size field.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

lzma_ret lzma_block_header_size (lzma_block *block) lzma_nothrow lzma_attr_warn_unused_result
 Calculate Block Header Size.
 
lzma_ret lzma_block_header_encode (const lzma_block *block, uint8_t *out) lzma_nothrow lzma_attr_warn_unused_result
 Encode Block Header.
 
lzma_ret lzma_block_header_decode (lzma_block *block, const lzma_allocator *allocator, const uint8_t *in) lzma_nothrow lzma_attr_warn_unused_result
 Decode Block Header.
 
lzma_ret lzma_block_compressed_size (lzma_block *block, lzma_vli unpadded_size) lzma_nothrow lzma_attr_warn_unused_result
 Validate and set Compressed Size according to Unpadded Size.
 
lzma_vli lzma_block_unpadded_size (const lzma_block *block) lzma_nothrow lzma_attr_pure
 Calculate Unpadded Size.
 
lzma_vli lzma_block_total_size (const lzma_block *block) lzma_nothrow lzma_attr_pure
 Calculate the total encoded size of a Block.
 
lzma_ret lzma_block_encoder (lzma_stream *strm, lzma_block *block) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .xz Block encoder.
 
lzma_ret lzma_block_decoder (lzma_stream *strm, lzma_block *block) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .xz Block decoder.
 
size_t lzma_block_buffer_bound (size_t uncompressed_size) lzma_nothrow
 Calculate maximum output size for single-call Block encoding.
 
lzma_ret lzma_block_buffer_encode (lzma_block *block, const lzma_allocator *allocator, const uint8_t *in, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow lzma_attr_warn_unused_result
 Single-call .xz Block encoder.
 
lzma_ret lzma_block_uncomp_encode (lzma_block *block, const uint8_t *in, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow lzma_attr_warn_unused_result
 Single-call uncompressed .xz Block encoder.
 
lzma_ret lzma_block_buffer_decode (lzma_block *block, const lzma_allocator *allocator, const uint8_t *in, size_t *in_pos, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow
 Single-call .xz Block decoder.
 
+

Detailed Description

+

.xz Block handling

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ lzma_block_header_size_decode

+ +
+
+ + + + + + + + +
#define lzma_block_header_size_decode( b)   (((uint32_t)(b) + 1) * 4)
+
+ +

Decode the Block Header Size field.

+

To decode Block Header using lzma_block_header_decode(), the size of the Block Header has to be known and stored into lzma_block.header_size. The size can be calculated from the first byte of a Block using this macro. Note that if the first byte is 0x00, it indicates beginning of Index; use this macro only when the byte is not 0x00.

+

There is no encoding macro because lzma_block_header_size() and lzma_block_header_encode() should be used.

+ +
+
+

Function Documentation

+ +

◆ lzma_block_header_size()

+ +
+
+ + + + + + + + +
lzma_ret lzma_block_header_size (lzma_blockblock)
+
+ +

Calculate Block Header Size.

+

Calculate the minimum size needed for the Block Header field using the settings specified in the lzma_block structure. Note that it is OK to increase the calculated header_size value as long as it is a multiple of four and doesn't exceed LZMA_BLOCK_HEADER_SIZE_MAX. Increasing header_size just means that lzma_block_header_encode() will add Header Padding.

+
Note
This doesn't check that all the options are valid i.e. this may return LZMA_OK even if lzma_block_header_encode() or lzma_block_encoder() would fail. If you want to validate the filter chain, consider using lzma_memlimit_encoder() which as a side-effect validates the filter chain.
+
Parameters
+ + +
blockBlock options
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Size calculated successfully and stored to block->header_size.
  • +
  • LZMA_OPTIONS_ERROR: Unsupported version, filters or filter options.
  • +
  • LZMA_PROG_ERROR: Invalid values like compressed_size == 0.
  • +
+
+ +
+
+ +

◆ lzma_block_header_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_block_header_encode (const lzma_blockblock,
uint8_t * out 
)
+
+ +

Encode Block Header.

+

The caller must have calculated the size of the Block Header already with lzma_block_header_size(). If a value larger than the one calculated by lzma_block_header_size() is used, the Block Header will be padded to the specified size.

+
Parameters
+ + + +
blockBlock options to be encoded.
[out]outBeginning of the output buffer. This must be at least block->header_size bytes.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful. block->header_size bytes were written to output buffer.
  • +
  • LZMA_OPTIONS_ERROR: Invalid or unsupported options.
  • +
  • LZMA_PROG_ERROR: Invalid arguments, for example block->header_size is invalid or block->filters is NULL.
  • +
+
+ +
+
+ +

◆ lzma_block_header_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_block_header_decode (lzma_blockblock,
const lzma_allocatorallocator,
const uint8_t * in 
)
+
+ +

Decode Block Header.

+

block->version should (usually) be set to the highest value supported by the application. If the application sets block->version to a value higher than supported by the current liblzma version, this function will downgrade block->version to the highest value supported by it. Thus one should check the value of block->version after calling this function if block->version was set to a non-zero value and the application doesn't otherwise know that the liblzma version being used is new enough to support the specified block->version.

+

The size of the Block Header must have already been decoded with lzma_block_header_size_decode() macro and stored to block->header_size.

+

The integrity check type from Stream Header must have been stored to block->check.

+

block->filters must have been allocated, but they don't need to be initialized (possible existing filter options are not freed).

+
Parameters
+ + + + +
[out]blockDestination for Block options
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() (and also free() if an error occurs).
inBeginning of the input buffer. This must be at least block->header_size bytes.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Decoding was successful. block->header_size bytes were read from the input buffer.
  • +
  • LZMA_OPTIONS_ERROR: The Block Header specifies some unsupported options such as unsupported filters. This can happen also if block->version was set to a too low value compared to what would be required to properly represent the information stored in the Block Header.
  • +
  • LZMA_DATA_ERROR: Block Header is corrupt, for example, the CRC32 doesn't match.
  • +
  • LZMA_PROG_ERROR: Invalid arguments, for example block->header_size is invalid or block->filters is NULL.
  • +
+
+ +
+
+ +

◆ lzma_block_compressed_size()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_block_compressed_size (lzma_blockblock,
lzma_vli unpadded_size 
)
+
+ +

Validate and set Compressed Size according to Unpadded Size.

+

Block Header stores Compressed Size, but Index has Unpadded Size. If the application has already parsed the Index and is now decoding Blocks, it can calculate Compressed Size from Unpadded Size. This function does exactly that with error checking:

+
    +
  • Compressed Size calculated from Unpadded Size must be positive integer, that is, Unpadded Size must be big enough that after Block Header and Check fields there's still at least one byte for Compressed Size.
  • +
  • If Compressed Size was present in Block Header, the new value calculated from Unpadded Size is compared against the value from Block Header.
  • +
+
Note
This function must be called _after_ decoding the Block Header field so that it can properly validate Compressed Size if it was present in Block Header.
+
Parameters
+ + + +
blockBlock options: block->header_size must already be set with lzma_block_header_size().
unpadded_sizeUnpadded Size from the Index field in bytes
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: block->compressed_size was set successfully.
  • +
  • LZMA_DATA_ERROR: unpadded_size is too small compared to block->header_size and lzma_check_size(block->check).
  • +
  • LZMA_PROG_ERROR: Some values are invalid. For example, block->header_size must be a multiple of four and between 8 and 1024 inclusive.
  • +
+
+ +
+
+ +

◆ lzma_block_unpadded_size()

+ +
+
+ + + + + + + + +
lzma_vli lzma_block_unpadded_size (const lzma_blockblock)
+
+ +

Calculate Unpadded Size.

+

The Index field stores Unpadded Size and Uncompressed Size. The latter can be taken directly from the lzma_block structure after coding a Block, but Unpadded Size needs to be calculated from Block Header Size, Compressed Size, and size of the Check field. This is where this function is needed.

+
Parameters
+ + +
blockBlock options: block->header_size must already be set with lzma_block_header_size().
+
+
+
Returns
Unpadded Size on success, or zero on error.
+ +
+
+ +

◆ lzma_block_total_size()

+ +
+
+ + + + + + + + +
lzma_vli lzma_block_total_size (const lzma_blockblock)
+
+ +

Calculate the total encoded size of a Block.

+

This is equivalent to lzma_block_unpadded_size() except that the returned value includes the size of the Block Padding field.

+
Parameters
+ + +
blockBlock options: block->header_size must already be set with lzma_block_header_size().
+
+
+
Returns
On success, total encoded size of the Block. On error, zero is returned.
+ +
+
+ +

◆ lzma_block_encoder()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_block_encoder (lzma_streamstrm,
lzma_blockblock 
)
+
+ +

Initialize .xz Block encoder.

+

Valid actions for lzma_code() are LZMA_RUN, LZMA_SYNC_FLUSH (only if the filter chain supports it), and LZMA_FINISH.

+

The Block encoder encodes the Block Data, Block Padding, and Check value. It does NOT encode the Block Header which can be encoded with lzma_block_header_encode().

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
blockBlock options: block->version, block->check, and block->filters must have been initialized.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: All good, continue with lzma_code().
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_UNSUPPORTED_CHECK: block->check specifies a Check ID that is not supported by this build of liblzma. Initializing the encoder failed.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_block_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_block_decoder (lzma_streamstrm,
lzma_blockblock 
)
+
+ +

Initialize .xz Block decoder.

+

Valid actions for lzma_code() are LZMA_RUN and LZMA_FINISH. Using LZMA_FINISH is not required. It is supported only for convenience.

+

The Block decoder decodes the Block Data, Block Padding, and Check value. It does NOT decode the Block Header which can be decoded with lzma_block_header_decode().

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
blockBlock options
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: All good, continue with lzma_code().
  • +
  • LZMA_PROG_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
+
+ +
+
+ +

◆ lzma_block_buffer_bound()

+ +
+
+ + + + + + + + +
size_t lzma_block_buffer_bound (size_t uncompressed_size)
+
+ +

Calculate maximum output size for single-call Block encoding.

+

This is equivalent to lzma_stream_buffer_bound() but for .xz Blocks. See the documentation of lzma_stream_buffer_bound().

+
Parameters
+ + +
uncompressed_sizeSize of the data to be encoded with the single-call Block encoder.
+
+
+
Returns
Maximum output size in bytes for single-call Block encoding.
+ +
+
+ +

◆ lzma_block_buffer_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_block_buffer_encode (lzma_blockblock,
const lzma_allocatorallocator,
const uint8_t * in,
size_t in_size,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call .xz Block encoder.

+

In contrast to the multi-call encoder initialized with lzma_block_encoder(), this function encodes also the Block Header. This is required to make it possible to write appropriate Block Header also in case the data isn't compressible, and different filter chain has to be used to encode the data in uncompressed form using uncompressed chunks of the LZMA2 filter.

+

When the data isn't compressible, header_size, compressed_size, and uncompressed_size are set just like when the data was compressible, but it is possible that header_size is too small to hold the filter chain specified in block->filters, because that isn't necessarily the filter chain that was actually used to encode the data. lzma_block_unpadded_size() still works normally, because it doesn't read the filters array.

+
Parameters
+ + + + + + + + +
blockBlock options: block->version, block->check, and block->filters must have been initialized.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_sizeSize of the input buffer
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_BUF_ERROR: Not enough output buffer space.
  • +
  • LZMA_UNSUPPORTED_CHECK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_block_uncomp_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_block_uncomp_encode (lzma_blockblock,
const uint8_t * in,
size_t in_size,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call uncompressed .xz Block encoder.

+

This is like lzma_block_buffer_encode() except this doesn't try to compress the data and instead encodes the data using LZMA2 uncompressed chunks. The required output buffer size can be determined with lzma_block_buffer_bound().

+

Since the data won't be compressed, this function ignores block->filters. This function doesn't take lzma_allocator because this function doesn't allocate any memory from the heap.

+
Parameters
+ + + + + + + +
blockBlock options: block->version, block->check, and block->filters must have been initialized.
inBeginning of the input buffer
in_sizeSize of the input buffer
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_BUF_ERROR: Not enough output buffer space.
  • +
  • LZMA_UNSUPPORTED_CHECK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_block_buffer_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_block_buffer_decode (lzma_blockblock,
const lzma_allocatorallocator,
const uint8_t * in,
size_t * in_pos,
size_t in_size,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call .xz Block decoder.

+

This is single-call equivalent of lzma_block_decoder(), and requires that the caller has already decoded Block Header and checked its memory usage.

+
Parameters
+ + + + + + + + + +
blockBlock options
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_posThe next byte will be read from in[*in_pos]. *in_pos is updated only if decoding succeeds.
in_sizeSize of the input buffer; the first byte that won't be read is in[in_size].
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Decoding was successful.
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_BUF_ERROR: Output buffer was too small.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+
+ + + + diff --git a/doc/api/check_8h.html b/doc/api/check_8h.html new file mode 100644 index 0000000..2323c6c --- /dev/null +++ b/doc/api/check_8h.html @@ -0,0 +1,340 @@ + + + + + + + +liblzma (XZ Utils): lzma/check.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
check.h File Reference
+
+
+ +

Integrity checks. +More...

+ + + + + + + + +

+Macros

#define LZMA_CHECK_ID_MAX   15
 Maximum valid Check ID.
 
+#define LZMA_CHECK_SIZE_MAX   64
 Maximum size of a Check field.
 
+ + + + +

+Enumerations

enum  lzma_check { LZMA_CHECK_NONE = 0 +, LZMA_CHECK_CRC32 = 1 +, LZMA_CHECK_CRC64 = 4 +, LZMA_CHECK_SHA256 = 10 + }
 Type of the integrity check (Check ID) More...
 
+ + + + + + + + + + + + + + + + +

+Functions

lzma_bool lzma_check_is_supported (lzma_check check) lzma_nothrow lzma_attr_const
 Test if the given Check ID is supported.
 
uint32_t lzma_check_size (lzma_check check) lzma_nothrow lzma_attr_const
 Get the size of the Check field with the given Check ID.
 
uint32_t lzma_crc32 (const uint8_t *buf, size_t size, uint32_t crc) lzma_nothrow lzma_attr_pure
 Calculate CRC32.
 
uint64_t lzma_crc64 (const uint8_t *buf, size_t size, uint64_t crc) lzma_nothrow lzma_attr_pure
 Calculate CRC64.
 
lzma_check lzma_get_check (const lzma_stream *strm) lzma_nothrow
 Get the type of the integrity check.
 
+

Detailed Description

+

Integrity checks.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ LZMA_CHECK_ID_MAX

+ +
+
+ + + + +
#define LZMA_CHECK_ID_MAX   15
+
+ +

Maximum valid Check ID.

+

The .xz file format specification specifies 16 Check IDs (0-15). Some of them are only reserved, that is, no actual Check algorithm has been assigned. When decoding, liblzma still accepts unknown Check IDs for future compatibility. If a valid but unsupported Check ID is detected, liblzma can indicate a warning; see the flags LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, and LZMA_TELL_ANY_CHECK in container.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ lzma_check

+ +
+
+ + + + +
enum lzma_check
+
+ +

Type of the integrity check (Check ID)

+

The .xz format supports multiple types of checks that are calculated from the uncompressed data. They vary in both speed and ability to detect errors.

+ + + + + +
Enumerator
LZMA_CHECK_NONE 

No Check is calculated.

+

Size of the Check field: 0 bytes

+
LZMA_CHECK_CRC32 

CRC32 using the polynomial from the IEEE 802.3 standard

+

Size of the Check field: 4 bytes

+
LZMA_CHECK_CRC64 

CRC64 using the polynomial from the ECMA-182 standard

+

Size of the Check field: 8 bytes

+
LZMA_CHECK_SHA256 

SHA-256

+

Size of the Check field: 32 bytes

+
+ +
+
+

Function Documentation

+ +

◆ lzma_check_is_supported()

+ +
+
+ + + + + + + + +
lzma_bool lzma_check_is_supported (lzma_check check) const
+
+ +

Test if the given Check ID is supported.

+

LZMA_CHECK_NONE and LZMA_CHECK_CRC32 are always supported (even if liblzma is built with limited features).

+
Note
It is safe to call this with a value that is not in the range [0, 15]; in that case the return value is always false.
+
Parameters
+ + +
checkCheck ID
+
+
+
Returns
lzma_bool:
    +
  • true if Check ID is supported by this liblzma build.
  • +
  • false otherwise.
  • +
+
+ +
+
+ +

◆ lzma_check_size()

+ +
+
+ + + + + + + + +
uint32_t lzma_check_size (lzma_check check) const
+
+ +

Get the size of the Check field with the given Check ID.

+

Although not all Check IDs have a check algorithm associated, the size of every Check is already frozen. This function returns the size (in bytes) of the Check field with the specified Check ID. The values are: { 0, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64 }

+
Parameters
+ + +
checkCheck ID
+
+
+
Returns
Size of the Check field in bytes. If the argument is not in the range [0, 15], UINT32_MAX is returned.
+ +
+
+ +

◆ lzma_crc32()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
uint32_t lzma_crc32 (const uint8_t * buf,
size_t size,
uint32_t crc 
)
+
+ +

Calculate CRC32.

+

Calculate CRC32 using the polynomial from the IEEE 802.3 standard.

+
Parameters
+ + + + +
bufPointer to the input buffer
sizeSize of the input buffer
crcPreviously returned CRC value. This is used to calculate the CRC of a big buffer in smaller chunks. Set to zero when starting a new calculation.
+
+
+
Returns
Updated CRC value, which can be passed to this function again to continue CRC calculation.
+ +
+
+ +

◆ lzma_crc64()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
uint64_t lzma_crc64 (const uint8_t * buf,
size_t size,
uint64_t crc 
)
+
+ +

Calculate CRC64.

+

Calculate CRC64 using the polynomial from the ECMA-182 standard.

+

This function is used similarly to lzma_crc32().

+
Parameters
+ + + + +
bufPointer to the input buffer
sizeSize of the input buffer
crcPreviously returned CRC value. This is used to calculate the CRC of a big buffer in smaller chunks. Set to zero when starting a new calculation.
+
+
+
Returns
Updated CRC value, which can be passed to this function again to continue CRC calculation.
+ +
+
+ +

◆ lzma_get_check()

+ +
+
+ + + + + + + + +
lzma_check lzma_get_check (const lzma_streamstrm)
+
+ +

Get the type of the integrity check.

+

This function can be called only immediately after lzma_code() has returned LZMA_NO_CHECK, LZMA_UNSUPPORTED_CHECK, or LZMA_GET_CHECK. Calling this function in any other situation has undefined behavior.

+
Parameters
+ + +
strmPointer to lzma_stream meeting the above conditions.
+
+
+
Returns
Check ID in the lzma_stream, or undefined if called improperly.
+ +
+
+
+ + + + diff --git a/doc/api/classes.html b/doc/api/classes.html new file mode 100644 index 0000000..a010270 --- /dev/null +++ b/doc/api/classes.html @@ -0,0 +1,60 @@ + + + + + + + +liblzma (XZ Utils): Data Structure Index + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+
Data Structure Index
+
+ + + + + diff --git a/doc/api/closed.png b/doc/api/closed.png new file mode 100644 index 0000000..91f4888 Binary files /dev/null and b/doc/api/closed.png differ diff --git a/doc/api/container_8h.html b/doc/api/container_8h.html new file mode 100644 index 0000000..332b2b1 --- /dev/null +++ b/doc/api/container_8h.html @@ -0,0 +1,1279 @@ + + + + + + + +liblzma (XZ Utils): lzma/container.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
container.h File Reference
+
+
+ +

File formats. +More...

+ + + + + +

+Data Structures

struct  lzma_mt
 Multithreading options. More...
 
+ + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define LZMA_PRESET_DEFAULT   UINT32_C(6)
 Default compression preset.
 
#define LZMA_PRESET_LEVEL_MASK   UINT32_C(0x1F)
 Mask for preset level.
 
#define LZMA_PRESET_EXTREME   (UINT32_C(1) << 31)
 Extreme compression preset.
 
#define LZMA_TELL_NO_CHECK   UINT32_C(0x01)
 
#define LZMA_TELL_UNSUPPORTED_CHECK   UINT32_C(0x02)
 
#define LZMA_TELL_ANY_CHECK   UINT32_C(0x04)
 
#define LZMA_IGNORE_CHECK   UINT32_C(0x10)
 
#define LZMA_CONCATENATED   UINT32_C(0x08)
 
#define LZMA_FAIL_FAST   UINT32_C(0x20)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

uint64_t lzma_easy_encoder_memusage (uint32_t preset) lzma_nothrow lzma_attr_pure
 Calculate approximate memory usage of easy encoder.
 
uint64_t lzma_easy_decoder_memusage (uint32_t preset) lzma_nothrow lzma_attr_pure
 Calculate approximate decoder memory usage of a preset.
 
lzma_ret lzma_easy_encoder (lzma_stream *strm, uint32_t preset, lzma_check check) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .xz Stream encoder using a preset number.
 
lzma_ret lzma_easy_buffer_encode (uint32_t preset, lzma_check check, const lzma_allocator *allocator, const uint8_t *in, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow
 Single-call .xz Stream encoding using a preset number.
 
lzma_ret lzma_stream_encoder (lzma_stream *strm, const lzma_filter *filters, lzma_check check) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .xz Stream encoder using a custom filter chain.
 
uint64_t lzma_stream_encoder_mt_memusage (const lzma_mt *options) lzma_nothrow lzma_attr_pure
 Calculate approximate memory usage of multithreaded .xz encoder.
 
lzma_ret lzma_stream_encoder_mt (lzma_stream *strm, const lzma_mt *options) lzma_nothrow lzma_attr_warn_unused_result
 Initialize multithreaded .xz Stream encoder.
 
lzma_ret lzma_alone_encoder (lzma_stream *strm, const lzma_options_lzma *options) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .lzma encoder (legacy file format)
 
size_t lzma_stream_buffer_bound (size_t uncompressed_size) lzma_nothrow
 Calculate output buffer size for single-call Stream encoder.
 
lzma_ret lzma_stream_buffer_encode (lzma_filter *filters, lzma_check check, const lzma_allocator *allocator, const uint8_t *in, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow lzma_attr_warn_unused_result
 Single-call .xz Stream encoder.
 
lzma_ret lzma_microlzma_encoder (lzma_stream *strm, const lzma_options_lzma *options) lzma_nothrow
 MicroLZMA encoder.
 
lzma_ret lzma_stream_decoder (lzma_stream *strm, uint64_t memlimit, uint32_t flags) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .xz Stream decoder.
 
lzma_ret lzma_stream_decoder_mt (lzma_stream *strm, const lzma_mt *options) lzma_nothrow lzma_attr_warn_unused_result
 Initialize multithreaded .xz Stream decoder.
 
lzma_ret lzma_auto_decoder (lzma_stream *strm, uint64_t memlimit, uint32_t flags) lzma_nothrow lzma_attr_warn_unused_result
 Decode .xz, .lzma, and .lz (lzip) files with autodetection.
 
lzma_ret lzma_alone_decoder (lzma_stream *strm, uint64_t memlimit) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .lzma decoder (legacy file format)
 
lzma_ret lzma_lzip_decoder (lzma_stream *strm, uint64_t memlimit, uint32_t flags) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .lz (lzip) decoder (a foreign file format)
 
lzma_ret lzma_stream_buffer_decode (uint64_t *memlimit, uint32_t flags, const lzma_allocator *allocator, const uint8_t *in, size_t *in_pos, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow lzma_attr_warn_unused_result
 Single-call .xz Stream decoder.
 
lzma_ret lzma_microlzma_decoder (lzma_stream *strm, uint64_t comp_size, uint64_t uncomp_size, lzma_bool uncomp_size_is_exact, uint32_t dict_size) lzma_nothrow
 MicroLZMA decoder.
 
+

Detailed Description

+

File formats.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ LZMA_PRESET_DEFAULT

+ +
+
+ + + + +
#define LZMA_PRESET_DEFAULT   UINT32_C(6)
+
+ +

Default compression preset.

+

It's not straightforward to recommend a default preset, because in some cases keeping the resource usage relatively low is more important that getting the maximum compression ratio.

+ +
+
+ +

◆ LZMA_PRESET_LEVEL_MASK

+ +
+
+ + + + +
#define LZMA_PRESET_LEVEL_MASK   UINT32_C(0x1F)
+
+ +

Mask for preset level.

+

This is useful only if you need to extract the level from the preset variable. That should be rare.

+ +
+
+ +

◆ LZMA_PRESET_EXTREME

+ +
+
+ + + + +
#define LZMA_PRESET_EXTREME   (UINT32_C(1) << 31)
+
+ +

Extreme compression preset.

+

This flag modifies the preset to make the encoding significantly slower while improving the compression ratio only marginally. This is useful when you don't mind spending time to get as small result as possible.

+

This flag doesn't affect the memory usage requirements of the decoder (at least not significantly). The memory usage of the encoder may be increased a little but only at the lowest preset levels (0-3).

+ +
+
+ +

◆ LZMA_TELL_NO_CHECK

+ +
+
+ + + + +
#define LZMA_TELL_NO_CHECK   UINT32_C(0x01)
+
+

This flag makes lzma_code() return LZMA_NO_CHECK if the input stream being decoded has no integrity check. Note that when used with lzma_auto_decoder(), all .lzma files will trigger LZMA_NO_CHECK if LZMA_TELL_NO_CHECK is used.

+ +
+
+ +

◆ LZMA_TELL_UNSUPPORTED_CHECK

+ +
+
+ + + + +
#define LZMA_TELL_UNSUPPORTED_CHECK   UINT32_C(0x02)
+
+

This flag makes lzma_code() return LZMA_UNSUPPORTED_CHECK if the input stream has an integrity check, but the type of the integrity check is not supported by this liblzma version or build. Such files can still be decoded, but the integrity check cannot be verified.

+ +
+
+ +

◆ LZMA_TELL_ANY_CHECK

+ +
+
+ + + + +
#define LZMA_TELL_ANY_CHECK   UINT32_C(0x04)
+
+

This flag makes lzma_code() return LZMA_GET_CHECK as soon as the type of the integrity check is known. The type can then be got with lzma_get_check().

+ +
+
+ +

◆ LZMA_IGNORE_CHECK

+ +
+
+ + + + +
#define LZMA_IGNORE_CHECK   UINT32_C(0x10)
+
+

This flag makes lzma_code() not calculate and verify the integrity check of the compressed data in .xz files. This means that invalid integrity check values won't be detected and LZMA_DATA_ERROR won't be returned in such cases.

+

This flag only affects the checks of the compressed data itself; the CRC32 values in the .xz headers will still be verified normally.

+

Don't use this flag unless you know what you are doing. Possible reasons to use this flag:

+
    +
  • Trying to recover data from a corrupt .xz file.
  • +
  • Speeding up decompression, which matters mostly with SHA-256 or with files that have compressed extremely well. It's recommended to not use this flag for this purpose unless the file integrity is verified externally in some other way.
  • +
+

Support for this flag was added in liblzma 5.1.4beta.

+ +
+
+ +

◆ LZMA_CONCATENATED

+ +
+
+ + + + +
#define LZMA_CONCATENATED   UINT32_C(0x08)
+
+

This flag enables decoding of concatenated files with file formats that allow concatenating compressed files as is. From the formats currently supported by liblzma, only the .xz and .lz formats allow concatenated files. Concatenated files are not allowed with the legacy .lzma format.

+

This flag also affects the usage of the `action' argument for lzma_code(). When LZMA_CONCATENATED is used, lzma_code() won't return LZMA_STREAM_END unless LZMA_FINISH is used as `action'. Thus, the application has to set LZMA_FINISH in the same way as it does when encoding.

+

If LZMA_CONCATENATED is not used, the decoders still accept LZMA_FINISH as `action' for lzma_code(), but the usage of LZMA_FINISH isn't required.

+ +
+
+ +

◆ LZMA_FAIL_FAST

+ +
+
+ + + + +
#define LZMA_FAIL_FAST   UINT32_C(0x20)
+
+

This flag makes the threaded decoder report errors (like LZMA_DATA_ERROR) as soon as they are detected. This saves time when the application has no interest in a partially decompressed truncated or corrupt file. Note that due to timing randomness, if the same truncated or corrupt input is decompressed multiple times with this flag, a different amount of output may be produced by different runs, and even the error code might vary.

+

When using LZMA_FAIL_FAST, it is recommended to use LZMA_FINISH to tell the decoder when no more input will be coming because it can help fast detection and reporting of truncated files. Note that in this situation truncated files might be diagnosed with LZMA_DATA_ERROR instead of LZMA_OK or LZMA_BUF_ERROR!

+

Without this flag the threaded decoder will provide as much output as possible at first and then report the pending error. This default behavior matches the single-threaded decoder and provides repeatable behavior with truncated or corrupt input. There are a few special cases where the behavior can still differ like memory allocation failures (LZMA_MEM_ERROR).

+

Single-threaded decoders currently ignore this flag.

+

Support for this flag was added in liblzma 5.3.3alpha. Note that in older versions this flag isn't supported (LZMA_OPTIONS_ERROR) even by functions that ignore this flag in newer liblzma versions.

+ +
+
+

Function Documentation

+ +

◆ lzma_easy_encoder_memusage()

+ +
+
+ + + + + + + + +
uint64_t lzma_easy_encoder_memusage (uint32_t preset)
+
+ +

Calculate approximate memory usage of easy encoder.

+

This function is a wrapper for lzma_raw_encoder_memusage().

+
Parameters
+ + +
presetCompression preset (level and possible flags)
+
+
+
Returns
Number of bytes of memory required for the given preset when encoding or UINT64_MAX on error.
+ +
+
+ +

◆ lzma_easy_decoder_memusage()

+ +
+
+ + + + + + + + +
uint64_t lzma_easy_decoder_memusage (uint32_t preset)
+
+ +

Calculate approximate decoder memory usage of a preset.

+

This function is a wrapper for lzma_raw_decoder_memusage().

+
Parameters
+ + +
presetCompression preset (level and possible flags)
+
+
+
Returns
Number of bytes of memory required to decompress a file that was compressed using the given preset or UINT64_MAX on error.
+ +
+
+ +

◆ lzma_easy_encoder()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_easy_encoder (lzma_streamstrm,
uint32_t preset,
lzma_check check 
)
+
+ +

Initialize .xz Stream encoder using a preset number.

+

This function is intended for those who just want to use the basic features of liblzma (that is, most developers out there).

+

If initialization fails (return value is not LZMA_OK), all the memory allocated for *strm by liblzma is always freed. Thus, there is no need to call lzma_end() after failed initialization.

+

If initialization succeeds, use lzma_code() to do the actual encoding. Valid values for `action' (the second argument of lzma_code()) are LZMA_RUN, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, and LZMA_FINISH. In future, there may be compression levels or flags that don't support LZMA_SYNC_FLUSH.

+
Parameters
+ + + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
presetCompression preset to use. A preset consist of level number and zero or more flags. Usually flags aren't used, so preset is simply a number [0, 9] which match the options -0 ... -9 of the xz command line tool. Additional flags can be be set using bitwise-or with the preset level number, e.g. 6 | LZMA_PRESET_EXTREME.
checkIntegrity check type to use. See check.h for available checks. The xz command line tool defaults to LZMA_CHECK_CRC64, which is a good choice if you are unsure. LZMA_CHECK_CRC32 is good too as long as the uncompressed file is not many gigabytes.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Initialization succeeded. Use lzma_code() to encode your data.
  • +
  • LZMA_MEM_ERROR: Memory allocation failed.
  • +
  • LZMA_OPTIONS_ERROR: The given compression preset is not supported by this build of liblzma.
  • +
  • LZMA_UNSUPPORTED_CHECK: The given check type is not supported by this liblzma build.
  • +
  • LZMA_PROG_ERROR: One or more of the parameters have values that will never be valid. For example, strm == NULL.
  • +
+
+ +
+
+ +

◆ lzma_easy_buffer_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_easy_buffer_encode (uint32_t preset,
lzma_check check,
const lzma_allocatorallocator,
const uint8_t * in,
size_t in_size,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call .xz Stream encoding using a preset number.

+

The maximum required output buffer size can be calculated with lzma_stream_buffer_bound().

+
Parameters
+ + + + + + + + + +
presetCompression preset to use. See the description in lzma_easy_encoder().
checkType of the integrity check to calculate from uncompressed data.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_sizeSize of the input buffer
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_BUF_ERROR: Not enough output buffer space.
  • +
  • LZMA_UNSUPPORTED_CHECK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_stream_encoder()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_encoder (lzma_streamstrm,
const lzma_filterfilters,
lzma_check check 
)
+
+ +

Initialize .xz Stream encoder using a custom filter chain.

+
Parameters
+ + + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN. See filters.h for more information.
checkType of the integrity check to calculate from uncompressed data.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Initialization was successful.
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_UNSUPPORTED_CHECK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_stream_encoder_mt_memusage()

+ +
+
+ + + + + + + + +
uint64_t lzma_stream_encoder_mt_memusage (const lzma_mtoptions)
+
+ +

Calculate approximate memory usage of multithreaded .xz encoder.

+

Since doing the encoding in threaded mode doesn't affect the memory requirements of single-threaded decompressor, you can use lzma_easy_decoder_memusage(options->preset) or lzma_raw_decoder_memusage(options->filters) to calculate the decompressor memory requirements.

+
Parameters
+ + +
optionsCompression options
+
+
+
Returns
Number of bytes of memory required for encoding with the given options. If an error occurs, for example due to unsupported preset or filter chain, UINT64_MAX is returned.
+ +
+
+ +

◆ lzma_stream_encoder_mt()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_encoder_mt (lzma_streamstrm,
const lzma_mtoptions 
)
+
+ +

Initialize multithreaded .xz Stream encoder.

+

This provides the functionality of lzma_easy_encoder() and lzma_stream_encoder() as a single function for multithreaded use.

+

The supported actions for lzma_code() are LZMA_RUN, LZMA_FULL_FLUSH, LZMA_FULL_BARRIER, and LZMA_FINISH. Support for LZMA_SYNC_FLUSH might be added in the future.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
optionsPointer to multithreaded compression options
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_UNSUPPORTED_CHECK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_alone_encoder()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_alone_encoder (lzma_streamstrm,
const lzma_options_lzmaoptions 
)
+
+ +

Initialize .lzma encoder (legacy file format)

+

The .lzma format is sometimes called the LZMA_Alone format, which is the reason for the name of this function. The .lzma format supports only the LZMA1 filter. There is no support for integrity checks like CRC32.

+

Use this function if and only if you need to create files readable by legacy LZMA tools such as LZMA Utils 4.32.x. Moving to the .xz format is strongly recommended.

+

The valid action values for lzma_code() are LZMA_RUN and LZMA_FINISH. No kind of flushing is supported, because the file format doesn't make it possible.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
optionsPointer to encoder options
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_stream_buffer_bound()

+ +
+
+ + + + + + + + +
size_t lzma_stream_buffer_bound (size_t uncompressed_size)
+
+ +

Calculate output buffer size for single-call Stream encoder.

+

When trying to compress incompressible data, the encoded size will be slightly bigger than the input data. This function calculates how much output buffer space is required to be sure that lzma_stream_buffer_encode() doesn't return LZMA_BUF_ERROR.

+

The calculated value is not exact, but it is guaranteed to be big enough. The actual maximum output space required may be slightly smaller (up to about 100 bytes). This should not be a problem in practice.

+

If the calculated maximum size doesn't fit into size_t or would make the Stream grow past LZMA_VLI_MAX (which should never happen in practice), zero is returned to indicate the error.

+
Note
The limit calculated by this function applies only to single-call encoding. Multi-call encoding may (and probably will) have larger maximum expansion when encoding incompressible data. Currently there is no function to calculate the maximum expansion of multi-call encoding.
+
Parameters
+ + +
uncompressed_sizeSize in bytes of the uncompressed input data
+
+
+
Returns
Maximum number of bytes needed to store the compressed data.
+ +
+
+ +

◆ lzma_stream_buffer_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_buffer_encode (lzma_filterfilters,
lzma_check check,
const lzma_allocatorallocator,
const uint8_t * in,
size_t in_size,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call .xz Stream encoder.

+
Parameters
+ + + + + + + + + +
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN. See filters.h for more information.
checkType of the integrity check to calculate from uncompressed data.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_sizeSize of the input buffer
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_BUF_ERROR: Not enough output buffer space.
  • +
  • LZMA_UNSUPPORTED_CHECK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_microlzma_encoder()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_microlzma_encoder (lzma_streamstrm,
const lzma_options_lzmaoptions 
)
+
+ +

MicroLZMA encoder.

+

The MicroLZMA format is a raw LZMA stream whose first byte (always 0x00) has been replaced with bitwise-negation of the LZMA properties (lc/lp/pb). This encoding ensures that the first byte of MicroLZMA stream is never 0x00. There is no end of payload marker and thus the uncompressed size must be stored separately. For the best error detection the dictionary size should be stored separately as well but alternatively one may use the uncompressed size as the dictionary size when decoding.

+

With the MicroLZMA encoder, lzma_code() behaves slightly unusually. The action argument must be LZMA_FINISH and the return value will never be LZMA_OK. Thus the encoding is always done with a single lzma_code() after the initialization. The benefit of the combination of initialization function and lzma_code() is that memory allocations can be re-used for better performance.

+

lzma_code() will try to encode as much input as is possible to fit into the given output buffer. If not all input can be encoded, the stream will be finished without encoding all the input. The caller must check both input and output buffer usage after lzma_code() (total_in and total_out in lzma_stream can be convenient). Often lzma_code() can fill the output buffer completely if there is a lot of input, but sometimes a few bytes may remain unused because the next LZMA symbol would require more space.

+

lzma_stream.avail_out must be at least 6. Otherwise LZMA_PROG_ERROR will be returned.

+

The LZMA dictionary should be reasonably low to speed up the encoder re-initialization. A good value is bigger than the resulting uncompressed size of most of the output chunks. For example, if output size is 4 KiB, dictionary size of 32 KiB or 64 KiB is good. If the data compresses extremely well, even 128 KiB may be useful.

+

The MicroLZMA format and this encoder variant were made with the EROFS file system in mind. This format may be convenient in other embedded uses too where many small streams are needed. XZ Embedded includes a decoder for this format.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
optionsPointer to encoder options
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_STREAM_END: All good. Check the amounts of input used and output produced. Store the amount of input used (uncompressed size) as it needs to be known to decompress the data.
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_PROG_ERROR: In addition to the generic reasons for this error code, this may also be returned if there isn't enough output space (6 bytes) to create a valid MicroLZMA stream.
  • +
+
+ +
+
+ +

◆ lzma_stream_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_decoder (lzma_streamstrm,
uint64_t memlimit,
uint32_t flags 
)
+
+ +

Initialize .xz Stream decoder.

+
Parameters
+ + + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
memlimitMemory usage limit as bytes. Use UINT64_MAX to effectively disable the limiter. liblzma 5.2.3 and earlier don't allow 0 here and return LZMA_PROG_ERROR; later versions treat 0 as if 1 had been specified.
flagsBitwise-or of zero or more of the decoder flags: LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, LZMA_TELL_ANY_CHECK, LZMA_IGNORE_CHECK, LZMA_CONCATENATED, LZMA_FAIL_FAST
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Initialization was successful.
  • +
  • LZMA_MEM_ERROR: Cannot allocate memory.
  • +
  • LZMA_OPTIONS_ERROR: Unsupported flags
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_stream_decoder_mt()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_decoder_mt (lzma_streamstrm,
const lzma_mtoptions 
)
+
+ +

Initialize multithreaded .xz Stream decoder.

+

The decoder can decode multiple Blocks in parallel. This requires that each Block Header contains the Compressed Size and Uncompressed size fields which are added by the multi-threaded encoder, see lzma_stream_encoder_mt().

+

A Stream with one Block will only utilize one thread. A Stream with multiple Blocks but without size information in Block Headers will be processed in single-threaded mode in the same way as done by lzma_stream_decoder(). Concatenated Streams are processed one Stream at a time; no inter-Stream parallelization is done.

+

This function behaves like lzma_stream_decoder() when options->threads == 1 and options->memlimit_threading <= 1.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
optionsPointer to multithreaded compression options
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Initialization was successful.
  • +
  • LZMA_MEM_ERROR: Cannot allocate memory.
  • +
  • LZMA_MEMLIMIT_ERROR: Memory usage limit was reached.
  • +
  • LZMA_OPTIONS_ERROR: Unsupported flags.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_auto_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_auto_decoder (lzma_streamstrm,
uint64_t memlimit,
uint32_t flags 
)
+
+ +

Decode .xz, .lzma, and .lz (lzip) files with autodetection.

+

This decoder autodetects between the .xz, .lzma, and .lz file formats, and calls lzma_stream_decoder(), lzma_alone_decoder(), or lzma_lzip_decoder() once the type of the input file has been detected.

+

Support for .lz was added in 5.4.0.

+

If the flag LZMA_CONCATENATED is used and the input is a .lzma file: For historical reasons concatenated .lzma files aren't supported. If there is trailing data after one .lzma stream, lzma_code() will return LZMA_DATA_ERROR. (lzma_alone_decoder() doesn't have such a check as it doesn't support any decoder flags. It will return LZMA_STREAM_END after one .lzma stream.)

+
Parameters
+ + + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
memlimitMemory usage limit as bytes. Use UINT64_MAX to effectively disable the limiter. liblzma 5.2.3 and earlier don't allow 0 here and return LZMA_PROG_ERROR; later versions treat 0 as if 1 had been specified.
flagsBitwise-or of zero or more of the decoder flags: LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, LZMA_TELL_ANY_CHECK, LZMA_IGNORE_CHECK, LZMA_CONCATENATED, LZMA_FAIL_FAST
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Initialization was successful.
  • +
  • LZMA_MEM_ERROR: Cannot allocate memory.
  • +
  • LZMA_OPTIONS_ERROR: Unsupported flags
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_alone_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_alone_decoder (lzma_streamstrm,
uint64_t memlimit 
)
+
+ +

Initialize .lzma decoder (legacy file format)

+

Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH. There is no need to use LZMA_FINISH, but it's allowed because it may simplify certain types of applications.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
memlimitMemory usage limit as bytes. Use UINT64_MAX to effectively disable the limiter. liblzma 5.2.3 and earlier don't allow 0 here and return LZMA_PROG_ERROR; later versions treat 0 as if 1 had been specified.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_lzip_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_lzip_decoder (lzma_streamstrm,
uint64_t memlimit,
uint32_t flags 
)
+
+ +

Initialize .lz (lzip) decoder (a foreign file format)

+

This decoder supports the .lz format version 0 and the unextended .lz format version 1:

+
    +
  • Files in the format version 0 were produced by lzip 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in lzip 1.18.
  • +
  • lzip 1.3 added decompression support for .lz format version 1 files. Compression support was added in lzip 1.4. In lzip 1.6 the .lz format version 1 was extended to support the Sync Flush marker. This extension is not supported by liblzma. lzma_code() will return LZMA_DATA_ERROR at the location of the Sync Flush marker. In practice files with the Sync Flush marker are very rare and thus liblzma can decompress almost all .lz files.
  • +
+

Just like with lzma_stream_decoder() for .xz files, LZMA_CONCATENATED should be used when decompressing normal standalone .lz files.

+

The .lz format allows putting non-.lz data at the end of a file after at least one valid .lz member. That is, one can append custom data at the end of a .lz file and the decoder is required to ignore it. In liblzma this is relevant only when LZMA_CONCATENATED is used. In that case lzma_code() will return LZMA_STREAM_END and leave lzma_stream.next_in pointing to the first byte of the non-.lz data. An exception to this is if the first 1-3 bytes of the non-.lz data are identical to the .lz magic bytes (0x4C, 0x5A, 0x49, 0x50; "LZIP" in US-ASCII). In such a case the 1-3 bytes will have been ignored by lzma_code(). If one wishes to locate the non-.lz data reliably, one must ensure that the first byte isn't 0x4C. Actually one should ensure that none of the first four bytes of trailing data are equal to the magic bytes because lzip >= 1.20 requires it by default.

+
Parameters
+ + + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
memlimitMemory usage limit as bytes. Use UINT64_MAX to effectively disable the limiter.
flagsBitwise-or of flags, or zero for no flags. All decoder flags listed above are supported although only LZMA_CONCATENATED and (in very rare cases) LZMA_IGNORE_CHECK are actually useful. LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, and LZMA_FAIL_FAST do nothing. LZMA_TELL_ANY_CHECK is supported for consistency only as CRC32 is always used in the .lz format.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Initialization was successful.
  • +
  • LZMA_MEM_ERROR: Cannot allocate memory.
  • +
  • LZMA_OPTIONS_ERROR: Unsupported flags
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_stream_buffer_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_buffer_decode (uint64_t * memlimit,
uint32_t flags,
const lzma_allocatorallocator,
const uint8_t * in,
size_t * in_pos,
size_t in_size,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call .xz Stream decoder.

+
Parameters
+ + + + + + + + + + +
memlimitPointer to how much memory the decoder is allowed to allocate. The value pointed by this pointer is modified if and only if LZMA_MEMLIMIT_ERROR is returned.
flagsBitwise-or of zero or more of the decoder flags: LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, LZMA_IGNORE_CHECK, LZMA_CONCATENATED, LZMA_FAIL_FAST. Note that LZMA_TELL_ANY_CHECK is not allowed and will return LZMA_PROG_ERROR.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_posThe next byte will be read from in[*in_pos]. *in_pos is updated only if decoding succeeds.
in_sizeSize of the input buffer; the first byte that won't be read is in[in_size].
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if decoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Decoding was successful.
  • +
  • LZMA_FORMAT_ERROR
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_NO_CHECK: This can be returned only if using the LZMA_TELL_NO_CHECK flag.
  • +
  • LZMA_UNSUPPORTED_CHECK: This can be returned only if using the LZMA_TELL_UNSUPPORTED_CHECK flag.
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. The minimum required memlimit value was stored to *memlimit.
  • +
  • LZMA_BUF_ERROR: Output buffer was too small.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_microlzma_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_microlzma_decoder (lzma_streamstrm,
uint64_t comp_size,
uint64_t uncomp_size,
lzma_bool uncomp_size_is_exact,
uint32_t dict_size 
)
+
+ +

MicroLZMA decoder.

+

See lzma_microlzma_encoder() for more information.

+

The lzma_code() usage with this decoder is completely normal. The special behavior of lzma_code() applies to lzma_microlzma_encoder() only.

+
Parameters
+ + + + + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
comp_sizeCompressed size of the MicroLZMA stream. The caller must somehow know this exactly.
uncomp_sizeUncompressed size of the MicroLZMA stream. If the exact uncompressed size isn't known, this can be set to a value that is at most as big as the exact uncompressed size would be, but then the next argument uncomp_size_is_exact must be false.
uncomp_size_is_exactIf true, uncomp_size must be exactly correct. This will improve error detection at the end of the stream. If the exact uncompressed size isn't known, this must be false. uncomp_size must still be at most as big as the exact uncompressed size is. Setting this to false when the exact size is known will work but error detection at the end of the stream will be weaker.
dict_sizeLZMA dictionary size that was used when compressing the data. It is OK to use a bigger value too but liblzma will then allocate more memory than would actually be required and error detection will be slightly worse. (Note that with the implementation in XZ Embedded it doesn't affect the memory usage if one specifies bigger dictionary than actually required.)
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+
+ + + + diff --git a/doc/api/delta_8h.html b/doc/api/delta_8h.html new file mode 100644 index 0000000..dd64be2 --- /dev/null +++ b/doc/api/delta_8h.html @@ -0,0 +1,132 @@ + + + + + + + +liblzma (XZ Utils): lzma/delta.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
delta.h File Reference
+
+
+ +

Delta filter. +More...

+ + + + + +

+Data Structures

struct  lzma_options_delta
 Options for the Delta filter. More...
 
+ + + + + + + + + + +

+Macros

#define LZMA_FILTER_DELTA   LZMA_VLI_C(0x03)
 Filter ID.
 
+#define LZMA_DELTA_DIST_MIN   1
 Minimum value for lzma_options_delta.dist.
 
+#define LZMA_DELTA_DIST_MAX   256
 Maximum value for lzma_options_delta.dist.
 
+ + + + +

+Enumerations

enum  lzma_delta_type { LZMA_DELTA_TYPE_BYTE + }
 Type of the delta calculation. More...
 
+

Detailed Description

+

Delta filter.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ LZMA_FILTER_DELTA

+ +
+
+ + + + +
#define LZMA_FILTER_DELTA   LZMA_VLI_C(0x03)
+
+ +

Filter ID.

+

Filter ID of the Delta filter. This is used as lzma_filter.id.

+ +
+
+

Enumeration Type Documentation

+ +

◆ lzma_delta_type

+ +
+
+ + + + +
enum lzma_delta_type
+
+ +

Type of the delta calculation.

+

Currently only byte-wise delta is supported. Other possible types could be, for example, delta of 16/32/64-bit little/big endian integers, but these are not currently planned since byte-wise delta is almost as good.

+ +
+
+
+ + + + diff --git a/doc/api/dir_b17a1d403082bd69a703ed987cf158fb.html b/doc/api/dir_b17a1d403082bd69a703ed987cf158fb.html new file mode 100644 index 0000000..ff360ae --- /dev/null +++ b/doc/api/dir_b17a1d403082bd69a703ed987cf158fb.html @@ -0,0 +1,104 @@ + + + + + + + +liblzma (XZ Utils): lzma Directory Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+
lzma Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

 base.h
 Data types and functions used in many places in liblzma API.
 
 bcj.h
 Branch/Call/Jump conversion filters.
 
 block.h
 .xz Block handling
 
 check.h
 Integrity checks.
 
 container.h
 File formats.
 
 delta.h
 Delta filter.
 
 filter.h
 Common filter related types and functions.
 
 hardware.h
 Hardware information.
 
 index.h
 Handling of .xz Index and related information.
 
 index_hash.h
 Validate Index by using a hash function.
 
 lzma12.h
 LZMA1 and LZMA2 filters.
 
 stream_flags.h
 .xz Stream Header and Stream Footer encoder and decoder
 
 version.h
 Version number.
 
 vli.h
 Variable-length integer handling.
 
+
+ + + + diff --git a/doc/api/doc.svg b/doc/api/doc.svg new file mode 100644 index 0000000..296728b --- /dev/null +++ b/doc/api/doc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/doc/api/docd.svg b/doc/api/docd.svg new file mode 100644 index 0000000..65cf4b5 --- /dev/null +++ b/doc/api/docd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/doc/api/doxygen.css b/doc/api/doxygen.css new file mode 100644 index 0000000..6ce2813 --- /dev/null +++ b/doc/api/doxygen.css @@ -0,0 +1,2017 @@ +/* The standard CSS for doxygen 1.9.7*/ + +html { +/* page base colors */ +--page-background-color: white; +--page-foreground-color: black; +--page-link-color: #144779; +--page-visited-link-color: #195794; + +/* index */ +--index-odd-item-bg-color: #F3F8FD; +--index-even-item-bg-color: white; +--index-header-color: black; +--index-separator-color: #A0A0A0; + +/* header */ +--header-background-color: #F5F9FD; +--header-separator-color: #A0C7EE; +--header-gradient-image: url('nav_h.png'); +--group-header-separator-color: #4491DE; +--group-header-color: #113B65; +--inherit-header-color: gray; + +--footer-foreground-color: #0C2B4A; +--footer-logo-width: 104px; +--citation-label-color: #10375F; +--glow-color: cyan; + +--title-background-color: white; +--title-separator-color: #1E67AF; +--directory-separator-color: #62A3E4; +--separator-color: #1B5D9E; + +--blockquote-background-color: #F1F7FC; +--blockquote-border-color: #62A3E4; + +--scrollbar-thumb-color: #62A3E4; +--scrollbar-background-color: #F5F9FD; + +--icon-background-color: #257FD9; +--icon-foreground-color: white; +--icon-doc-image: url('doc.svg'); +--icon-folder-open-image: url('folderopen.svg'); +--icon-folder-closed-image: url('folderclosed.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #F5F9FD; +--memdecl-separator-color: #C8DFF5; +--memdecl-foreground-color: #555; +--memdecl-template-color: #195794; + +/* detailed member list */ +--memdef-border-color: #74ADE7; +--memdef-title-background-color: #D0E3F6; +--memdef-title-gradient-image: url('nav_f.png'); +--memdef-proto-background-color: #CAE0F5; +--memdef-proto-text-color: #0A233D; +--memdef-proto-text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--memdef-doc-background-color: white; +--memdef-param-name-color: #602020; +--memdef-template-color: #195794; + +/* tables */ +--table-cell-border-color: #0D2F50; +--table-header-background-color: #123E6A; +--table-header-foreground-color: #FFFFFF; + +/* labels */ +--label-background-color: #257FD9; +--label-left-top-border-color: #1E67AF; +--label-right-bottom-border-color: #A0C7EE; +--label-foreground-color: white; + +/** navigation bar/tree/menu */ +--nav-background-color: #F5F9FD; +--nav-foreground-color: #113C67; +--nav-gradient-image: url('tab_b.png'); +--nav-gradient-hover-image: url('tab_h.png'); +--nav-gradient-active-image: url('tab_a.png'); +--nav-gradient-active-image-parent: url("../tab_a.png"); +--nav-separator-image: url('tab_s.png'); +--nav-breadcrumb-image: url('bc_s.png'); +--nav-breadcrumb-border-color: #9CC5EE; +--nav-splitbar-image: url('splitbar.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #0B2845; +--nav-text-hover-color: white; +--nav-text-active-color: white; +--nav-text-normal-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #113C67; +--nav-menu-background-color: white; +--nav-menu-foreground-color: #555555; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.5); +--nav-arrow-color: #62A3E4; +--nav-arrow-selected-color: #62A3E4; + +/* table of contents */ +--toc-background-color: #EEF5FC; +--toc-border-color: #BFD9F4; +--toc-header-color: #195794; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: white; +--search-foreground-color: #909090; +--search-magnification-image: url('mag.svg'); +--search-magnification-select-image: url('mag_sel.svg'); +--search-active-color: black; +--search-filter-background-color: #F5F9FD; +--search-filter-foreground-color: black; +--search-filter-border-color: #5098E0; +--search-filter-highlight-text-color: white; +--search-filter-highlight-bg-color: #144779; +--search-results-foreground-color: #174F86; +--search-results-background-color: #E2EEFA; +--search-results-border-color: black; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #555; + +/** code fragments */ +--code-keyword-color: #008000; +--code-type-keyword-color: #604020; +--code-flow-keyword-color: #E08000; +--code-comment-color: #800000; +--code-preprocessor-color: #806020; +--code-string-literal-color: #002080; +--code-char-literal-color: #008080; +--code-xml-cdata-color: black; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #195794; +--code-external-link-color: #195794; +--fragment-foreground-color: black; +--fragment-background-color: #F9FBFE; +--fragment-border-color: #A0C7EE; +--fragment-lineno-border-color: #00FF00; +--fragment-lineno-background-color: #E8E8E8; +--fragment-lineno-foreground-color: black; +--fragment-lineno-link-fg-color: #195794; +--fragment-lineno-link-bg-color: #D8D8D8; +--fragment-lineno-link-hover-fg-color: #195794; +--fragment-lineno-link-hover-bg-color: #C8C8C8; +--tooltip-foreground-color: black; +--tooltip-background-color: white; +--tooltip-border-color: gray; +--tooltip-doc-color: grey; +--tooltip-declaration-color: #006318; +--tooltip-link-color: #195794; +--tooltip-shadow: 1px 1px 7px gray; + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +} + +@media (prefers-color-scheme: dark) { + html:not(.dark-mode) { + color-scheme: dark; + +/* page base colors */ +--page-background-color: black; +--page-foreground-color: #C9D1D9; +--page-link-color: #5098E0; +--page-visited-link-color: #6DA9E5; + +/* index */ +--index-odd-item-bg-color: #02070C; +--index-even-item-bg-color: black; +--index-header-color: #A0C7EE; +--index-separator-color: #10375F; + +/* header */ +--header-background-color: #010407; +--header-separator-color: #040F1A; +--header-gradient-image: url('nav_hd.png'); +--group-header-separator-color: #0B2845; +--group-header-color: #5098E0; +--inherit-header-color: #A0A0A0; + +--footer-foreground-color: #206DBA; +--footer-logo-width: 60px; +--citation-label-color: #5098E0; +--glow-color: cyan; + +--title-background-color: #010509; +--title-separator-color: #113A63; +--directory-separator-color: #0B2845; +--separator-color: #0B2845; + +--blockquote-background-color: #030C14; +--blockquote-border-color: #0B2845; + +--scrollbar-thumb-color: #0B2845; +--scrollbar-background-color: #010407; + +--icon-background-color: #10375F; +--icon-foreground-color: #A0C7EE; +--icon-doc-image: url('docd.svg'); +--icon-folder-open-image: url('folderopend.svg'); +--icon-folder-closed-image: url('folderclosedd.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #02070C; +--memdecl-separator-color: #0D2D4D; +--memdecl-foreground-color: #BBB; +--memdecl-template-color: #3488DC; + +/* detailed member list */ +--memdef-border-color: #092138; +--memdef-title-background-color: #071829; +--memdef-title-gradient-image: url('nav_fd.png'); +--memdef-proto-background-color: #061524; +--memdef-proto-text-color: #64A4E4; +--memdef-proto-text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); +--memdef-doc-background-color: black; +--memdef-param-name-color: #D28757; +--memdef-template-color: #3488DC; + +/* tables */ +--table-cell-border-color: #0B2845; +--table-header-background-color: #0B2845; +--table-header-foreground-color: #A0C7EE; + +/* labels */ +--label-background-color: #113B65; +--label-left-top-border-color: #195794; +--label-right-bottom-border-color: #0B2845; +--label-foreground-color: #CCCCCC; + +/** navigation bar/tree/menu */ +--nav-background-color: #030C14; +--nav-foreground-color: #113C67; +--nav-gradient-image: url('tab_bd.png'); +--nav-gradient-hover-image: url('tab_hd.png'); +--nav-gradient-active-image: url('tab_ad.png'); +--nav-gradient-active-image-parent: url("../tab_ad.png"); +--nav-separator-image: url('tab_sd.png'); +--nav-breadcrumb-image: url('bc_sd.png'); +--nav-breadcrumb-border-color: #0C2B4A; +--nav-splitbar-image: url('splitbard.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #8ABAEA; +--nav-text-hover-color: #C5DDF5; +--nav-text-active-color: #C5DDF5; +--nav-text-normal-shadow: 0px 1px 1px black; +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #8ABAEA; +--nav-menu-background-color: #000204; +--nav-menu-foreground-color: #BBBBBB; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.2); +--nav-arrow-color: #10375F; +--nav-arrow-selected-color: #5098E0; + +/* table of contents */ +--toc-background-color: #04101B; +--toc-border-color: #081D32; +--toc-header-color: #6DA9E5; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: black; +--search-foreground-color: #C5C5C5; +--search-magnification-image: url('mag_d.svg'); +--search-magnification-select-image: url('mag_seld.svg'); +--search-active-color: #C5C5C5; +--search-filter-background-color: #030C14; +--search-filter-foreground-color: #5098E0; +--search-filter-border-color: #3488DC; +--search-filter-highlight-text-color: #93BFEC; +--search-filter-highlight-bg-color: #0B2845; +--search-results-background-color: #030C14; +--search-results-foreground-color: #5098E0; +--search-results-border-color: #3488DC; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #0E3255; + +/** code fragments */ +--code-keyword-color: #CC99CD; +--code-type-keyword-color: #AB99CD; +--code-flow-keyword-color: #E08000; +--code-comment-color: #717790; +--code-preprocessor-color: #65CABE; +--code-string-literal-color: #7EC699; +--code-char-literal-color: #00E0F0; +--code-xml-cdata-color: #C9D1D9; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #79C0FF; +--code-external-link-color: #79C0FF; +--fragment-foreground-color: #C9D1D9; +--fragment-background-color: black; +--fragment-border-color: #30363D; +--fragment-lineno-border-color: #30363D; +--fragment-lineno-background-color: black; +--fragment-lineno-foreground-color: #6E7681; +--fragment-lineno-link-fg-color: #6E7681; +--fragment-lineno-link-bg-color: #303030; +--fragment-lineno-link-hover-fg-color: #8E96A1; +--fragment-lineno-link-hover-bg-color: #505050; +--tooltip-foreground-color: #C9D1D9; +--tooltip-background-color: #202020; +--tooltip-border-color: #C9D1D9; +--tooltip-doc-color: #D9E1E9; +--tooltip-declaration-color: #20C348; +--tooltip-link-color: #79C0FF; +--tooltip-shadow: none; + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +}} +body { + background-color: var(--page-background-color); + color: var(--page-foreground-color); +} + +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 22px; +} + +/* @group Heading Levels */ + +.title { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 28px; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h1.groupheader { + font-size: 150%; +} + +h2.groupheader { + border-bottom: 1px solid var(--group-header-separator-color); + color: var(--group-header-color); + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--glow-color); +} + +dt { + font-weight: bold; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL { + background-image: var(--nav-gradient-active-image); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: var(--index-separator-color); +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: var(--index-header-color); +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.even { + background-color: var(--index-even-item-bg-color); +} + +.classindex dl.odd { + background-color: var(--index-odd-item-bg-color); +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: var(--page-link-color); + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: var(--page-visited-link-color); +} + +a:hover { + text-decoration: underline; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: var(--code-link-color); +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: var(--code-external-link-color); +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul { + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + +pre.fragment { + border: 1px solid var(--fragment-border-color); + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: var(--font-family-monospace); + font-size: 105%; +} + +div.fragment { + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + color: var(--fragment-foreground-color); + background-color: var(--fragment-background-color); + border: 1px solid var(--fragment-border-color); +} + +div.line { + font-family: var(--font-family-monospace); + font-size: 13px; + min-height: 13px; + line-height: 1.2; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: var(--glow-color); + box-shadow: 0 0 10px var(--glow-color); +} + + +span.lineno { + padding-right: 4px; + margin-right: 9px; + text-align: right; + border-right: 2px solid var(--fragment-lineno-border-color); + color: var(--fragment-lineno-foreground-color); + background-color: var(--fragment-lineno-background-color); + white-space: pre; +} +span.lineno a, span.lineno a:visited { + color: var(--fragment-lineno-link-fg-color); + background-color: var(--fragment-lineno-link-bg-color); +} + +span.lineno a:hover { + color: var(--fragment-lineno-link-hover-fg-color); + background-color: var(--fragment-lineno-link-hover-bg-color); +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + color: var(--page-foreground-color); + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +p.formulaDsp { + text-align: center; +} + +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; +} + +img.formulaDsp { + +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; + width: var(--footer-logo-width); +} + +.compoundTemplParams { + color: var(--memdecl-template-color); + font-size: 80%; + line-height: 120%; +} + +/* @group Code Colorization */ + +span.keyword { + color: var(--code-keyword-color); +} + +span.keywordtype { + color: var(--code-type-keyword-color); +} + +span.keywordflow { + color: var(--code-flow-keyword-color); +} + +span.comment { + color: var(--code-comment-color); +} + +span.preprocessor { + color: var(--code-preprocessor-color); +} + +span.stringliteral { + color: var(--code-string-literal-color); +} + +span.charliteral { + color: var(--code-char-literal-color); +} + +span.xmlcdata { + color: var(--code-xml-cdata-color); +} + +span.vhdldigit { + color: var(--code-vhdl-digit-color); +} + +span.vhdlchar { + color: var(--code-vhdl-char-color); +} + +span.vhdlkeyword { + color: var(--code-vhdl-keyword-color); +} + +span.vhdllogic { + color: var(--code-vhdl-logic-color); +} + +blockquote { + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid var(--table-cell-border-color); +} + +th.dirtab { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid var(--separator-color); +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: var(--memdecl-background-color); + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: var(--memdecl-foreground-color); +} + +.memSeparator { + border-bottom: 1px solid var(--memdecl-separator-color); + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: var(--memdecl-template-color); + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: var(--memdef-title-gradient-image); + background-repeat: repeat-x; + background-color: var(--memdef-title-background-color); + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: var(--memdef-template-color); + font-weight: normal; + margin-left: 9px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px var(--glow-color); +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 0px 6px 0px; + color: var(--memdef-proto-text-color); + font-weight: bold; + text-shadow: var(--memdef-proto-text-shadow); + background-color: var(--memdef-proto-background-color); + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; +} + +.overload { + font-family: var(--font-family-monospace); + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 10px 2px 10px; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: var(--memdef-doc-background-color); + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: var(--memdef-param-name-color); + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: var(--font-family-monospace); + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); + text-shadow: none; + color: var(--label-foreground-color); + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid var(--directory-separator-color); + border-bottom: 1px solid var(--directory-separator-color); + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.odd { + padding-left: 6px; + background-color: var(--index-odd-item-bg-color); +} + +.directory tr.even { + padding-left: 6px; + background-color: var(--index-even-item-bg-color); +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: var(--page-link-color); +} + +.arrow { + color: var(--nav-arrow-color); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: var(--font-family-icon); + line-height: normal; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-folder-open-image); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-folder-closed-image); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-doc-image); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: var(--footer-foreground-color); +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + margin-bottom: 10px; + border: 1px solid var(--memdef-border-color); + border-spacing: 0px; + border-radius: 4px; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid var(--memdef-border-color); +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image: var(--memdef-title-gradient-image); + background-repeat:repeat-x; + background-color: var(--memdef-title-background-color); + font-size: 90%; + color: var(--memdef-proto-text-color); + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid var(--memdef-border-color); +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: var(--nav-gradient-image); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image: var(--nav-gradient-image); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:var(--nav-text-normal-color); + border:solid 1px var(--nav-breadcrumb-border-color); + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:var(--nav-breadcrumb-image); + background-repeat:no-repeat; + background-position:right; + color: var(--nav-foreground-color); +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: var(--nav-text-normal-color); + font-family: var(--font-family-nav); + text-shadow: var(--nav-text-normal-shadow); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color: var(--footer-foreground-color); + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image: var(--header-gradient-image); + background-repeat:repeat-x; + background-color: var(--header-background-color); + margin: 0px; + border-bottom: 1px solid var(--header-separator-color); +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectrow +{ + height: 56px; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; + padding-left: 0.5em; +} + +#projectname +{ + font-size: 200%; + font-family: var(--font-family-title); + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font-size: 90%; + font-family: var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font-size: 50%; + font-family: 50% var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid var(--title-separator-color); + background-color: var(--title-background-color); +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:var(--citation-label-color); + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 var(--font-family-toc); + color: var(--toc-header-color); + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 15px; +} + +div.toc li.level4 { + margin-left: 15px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +span.obfuscator { + display: none; +} + +.inherit_header { + font-weight: bold; + color: var(--inherit-header-color); + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + /*white-space: nowrap;*/ + color: var(--tooltip-foreground-color); + background-color: var(--tooltip-background-color); + border: 1px solid var(--tooltip-border-color); + border-radius: 4px 4px 4px 4px; + box-shadow: var(--tooltip-shadow); + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: var(--tooltip-doc-color); + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip a { + color: var(--tooltip-link-color); +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: var(--tooltip-declaration-color); +} + +#powerTip div { + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: var(--font-family-tooltip); + line-height: 16px; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: var(--tooltip-background-color); + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: var(--tooltip-background-color); + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +tt, code, kbd, samp +{ + display: inline-block; +} +/* @end */ + +u { + text-decoration: underline; +} + +details>summary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + +body { + scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); +} + +::-webkit-scrollbar { + background-color: var(--scrollbar-background-color); + height: 12px; + width: 12px; +} +::-webkit-scrollbar-thumb { + border-radius: 6px; + box-shadow: inset 0 0 12px 12px var(--scrollbar-thumb-color); + border: solid 2px transparent; +} +::-webkit-scrollbar-corner { + background-color: var(--scrollbar-background-color); +} + diff --git a/doc/api/doxygen.svg b/doc/api/doxygen.svg new file mode 100644 index 0000000..363aa45 --- /dev/null +++ b/doc/api/doxygen.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/api/files.html b/doc/api/files.html new file mode 100644 index 0000000..459665c --- /dev/null +++ b/doc/api/files.html @@ -0,0 +1,74 @@ + + + + + + + +liblzma (XZ Utils): File List + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+
[detail level 12]
+ + + + + + + + + + + + + + + + +
  lzma
 base.hData types and functions used in many places in liblzma API
 bcj.hBranch/Call/Jump conversion filters
 block.h.xz Block handling
 check.hIntegrity checks
 container.hFile formats
 delta.hDelta filter
 filter.hCommon filter related types and functions
 hardware.hHardware information
 index.hHandling of .xz Index and related information
 index_hash.hValidate Index by using a hash function
 lzma12.hLZMA1 and LZMA2 filters
 stream_flags.h.xz Stream Header and Stream Footer encoder and decoder
 version.hVersion number
 vli.hVariable-length integer handling
 lzma.hThe public API of liblzma data compression library
+
+
+ + + + diff --git a/doc/api/filter_8h.html b/doc/api/filter_8h.html new file mode 100644 index 0000000..7f2ffaa --- /dev/null +++ b/doc/api/filter_8h.html @@ -0,0 +1,1342 @@ + + + + + + + +liblzma (XZ Utils): lzma/filter.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
filter.h File Reference
+
+
+ +

Common filter related types and functions. +More...

+ + + + + +

+Data Structures

struct  lzma_filter
 Filter options. More...
 
+ + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define LZMA_FILTERS_MAX   4
 Maximum number of filters in a chain.
 
#define LZMA_STR_ALL_FILTERS   UINT32_C(0x01)
 Allow or show all filters.
 
#define LZMA_STR_NO_VALIDATION   UINT32_C(0x02)
 Do not validate the filter chain in lzma_str_to_filters()
 
#define LZMA_STR_ENCODER   UINT32_C(0x10)
 Stringify encoder options.
 
#define LZMA_STR_DECODER   UINT32_C(0x20)
 Stringify decoder options.
 
#define LZMA_STR_GETOPT_LONG   UINT32_C(0x40)
 Produce xz-compatible getopt_long() syntax.
 
#define LZMA_STR_NO_SPACES   UINT32_C(0x80)
 Use two dashes "--" instead of a space to separate filters.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

lzma_bool lzma_filter_encoder_is_supported (lzma_vli id) lzma_nothrow lzma_attr_const
 Test if the given Filter ID is supported for encoding.
 
lzma_bool lzma_filter_decoder_is_supported (lzma_vli id) lzma_nothrow lzma_attr_const
 Test if the given Filter ID is supported for decoding.
 
lzma_ret lzma_filters_copy (const lzma_filter *src, lzma_filter *dest, const lzma_allocator *allocator) lzma_nothrow lzma_attr_warn_unused_result
 Copy the filters array.
 
void lzma_filters_free (lzma_filter *filters, const lzma_allocator *allocator) lzma_nothrow
 Free the options in the array of lzma_filter structures.
 
uint64_t lzma_raw_encoder_memusage (const lzma_filter *filters) lzma_nothrow lzma_attr_pure
 Calculate approximate memory requirements for raw encoder.
 
uint64_t lzma_raw_decoder_memusage (const lzma_filter *filters) lzma_nothrow lzma_attr_pure
 Calculate approximate memory requirements for raw decoder.
 
lzma_ret lzma_raw_encoder (lzma_stream *strm, const lzma_filter *filters) lzma_nothrow lzma_attr_warn_unused_result
 Initialize raw encoder.
 
lzma_ret lzma_raw_decoder (lzma_stream *strm, const lzma_filter *filters) lzma_nothrow lzma_attr_warn_unused_result
 Initialize raw decoder.
 
lzma_ret lzma_filters_update (lzma_stream *strm, const lzma_filter *filters) lzma_nothrow
 Update the filter chain in the encoder.
 
lzma_ret lzma_raw_buffer_encode (const lzma_filter *filters, const lzma_allocator *allocator, const uint8_t *in, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow
 Single-call raw encoder.
 
lzma_ret lzma_raw_buffer_decode (const lzma_filter *filters, const lzma_allocator *allocator, const uint8_t *in, size_t *in_pos, size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow
 Single-call raw decoder.
 
lzma_ret lzma_properties_size (uint32_t *size, const lzma_filter *filter) lzma_nothrow
 Get the size of the Filter Properties field.
 
lzma_ret lzma_properties_encode (const lzma_filter *filter, uint8_t *props) lzma_nothrow
 Encode the Filter Properties field.
 
lzma_ret lzma_properties_decode (lzma_filter *filter, const lzma_allocator *allocator, const uint8_t *props, size_t props_size) lzma_nothrow
 Decode the Filter Properties field.
 
lzma_ret lzma_filter_flags_size (uint32_t *size, const lzma_filter *filter) lzma_nothrow lzma_attr_warn_unused_result
 Calculate encoded size of a Filter Flags field.
 
lzma_ret lzma_filter_flags_encode (const lzma_filter *filter, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow lzma_attr_warn_unused_result
 Encode Filter Flags into given buffer.
 
lzma_ret lzma_filter_flags_decode (lzma_filter *filter, const lzma_allocator *allocator, const uint8_t *in, size_t *in_pos, size_t in_size) lzma_nothrow lzma_attr_warn_unused_result
 Decode Filter Flags from given buffer.
 
const char * lzma_str_to_filters (const char *str, int *error_pos, lzma_filter *filters, uint32_t flags, const lzma_allocator *allocator) lzma_nothrow lzma_attr_warn_unused_result
 Convert a string to a filter chain.
 
lzma_ret lzma_str_from_filters (char **str, const lzma_filter *filters, uint32_t flags, const lzma_allocator *allocator) lzma_nothrow lzma_attr_warn_unused_result
 Convert a filter chain to a string.
 
lzma_ret lzma_str_list_filters (char **str, lzma_vli filter_id, uint32_t flags, const lzma_allocator *allocator) lzma_nothrow lzma_attr_warn_unused_result
 List available filters and/or their options (for help message)
 
+

Detailed Description

+

Common filter related types and functions.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ LZMA_FILTERS_MAX

+ +
+
+ + + + +
#define LZMA_FILTERS_MAX   4
+
+ +

Maximum number of filters in a chain.

+

A filter chain can have 1-4 filters, of which three are allowed to change the size of the data. Usually only one or two filters are needed.

+ +
+
+ +

◆ LZMA_STR_ALL_FILTERS

+ +
+
+ + + + +
#define LZMA_STR_ALL_FILTERS   UINT32_C(0x01)
+
+ +

Allow or show all filters.

+

By default only the filters supported in the .xz format are accept by lzma_str_to_filters() or shown by lzma_str_list_filters().

+ +
+
+ +

◆ LZMA_STR_NO_VALIDATION

+ +
+
+ + + + +
#define LZMA_STR_NO_VALIDATION   UINT32_C(0x02)
+
+ +

Do not validate the filter chain in lzma_str_to_filters()

+

By default lzma_str_to_filters() can return an error if the filter chain as a whole isn't usable in the .xz format or in the raw encoder or decoder. With this flag, this validation is skipped. This flag doesn't affect the handling of the individual filter options. To allow non-.xz filters also LZMA_STR_ALL_FILTERS is needed.

+ +
+
+ +

◆ LZMA_STR_ENCODER

+ +
+
+ + + + +
#define LZMA_STR_ENCODER   UINT32_C(0x10)
+
+ +

Stringify encoder options.

+

Show the filter-specific options that the encoder will use. This may be useful for verbose diagnostic messages.

+

Note that if options were decoded from .xz headers then the encoder options may be undefined. This flag shouldn't be used in such a situation.

+ +
+
+ +

◆ LZMA_STR_DECODER

+ +
+
+ + + + +
#define LZMA_STR_DECODER   UINT32_C(0x20)
+
+ +

Stringify decoder options.

+

Show the filter-specific options that the decoder will use. This may be useful for showing what filter options were decoded from file headers.

+ +
+
+ +

◆ LZMA_STR_GETOPT_LONG

+ +
+
+ + + + +
#define LZMA_STR_GETOPT_LONG   UINT32_C(0x40)
+
+ +

Produce xz-compatible getopt_long() syntax.

+

That is, "delta:dist=2 lzma2:dict=4MiB,pb=1,lp=1" becomes "--delta=dist=2 --lzma2=dict=4MiB,pb=1,lp=1".

+

This syntax is compatible with xz 5.0.0 as long as the filters and their options are supported too.

+ +
+
+ +

◆ LZMA_STR_NO_SPACES

+ +
+
+ + + + +
#define LZMA_STR_NO_SPACES   UINT32_C(0x80)
+
+ +

Use two dashes "--" instead of a space to separate filters.

+

That is, "delta:dist=2 lzma2:pb=1,lp=1" becomes "delta:dist=2--lzma2:pb=1,lp=1". This looks slightly odd but this kind of strings should be usable on the command line without quoting. However, it is possible that future versions with new filter options might produce strings that require shell quoting anyway as the exact set of possible characters isn't frozen for now.

+

It is guaranteed that the single quote (') will never be used in filter chain strings (even if LZMA_STR_NO_SPACES isn't used).

+ +
+
+

Function Documentation

+ +

◆ lzma_filter_encoder_is_supported()

+ +
+
+ + + + + + + + +
lzma_bool lzma_filter_encoder_is_supported (lzma_vli id) const
+
+ +

Test if the given Filter ID is supported for encoding.

+
Parameters
+ + +
idFilter ID
+
+
+
Returns
lzma_bool:
    +
  • true if the Filter ID is supported for encoding by this liblzma build.
  • +
  • false otherwise.
  • +
+
+ +
+
+ +

◆ lzma_filter_decoder_is_supported()

+ +
+
+ + + + + + + + +
lzma_bool lzma_filter_decoder_is_supported (lzma_vli id) const
+
+ +

Test if the given Filter ID is supported for decoding.

+
Parameters
+ + +
idFilter ID
+
+
+
Returns
lzma_bool:
    +
  • true if the Filter ID is supported for decoding by this liblzma build.
  • +
  • false otherwise.
  • +
+
+ +
+
+ +

◆ lzma_filters_copy()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_filters_copy (const lzma_filtersrc,
lzma_filterdest,
const lzma_allocatorallocator 
)
+
+ +

Copy the filters array.

+

Copy the Filter IDs and filter-specific options from src to dest. Up to LZMA_FILTERS_MAX filters are copied, plus the terminating .id == LZMA_VLI_UNKNOWN. Thus, dest should have at least LZMA_FILTERS_MAX + 1 elements space unless the caller knows that src is smaller than that.

+

Unless the filter-specific options is NULL, the Filter ID has to be supported by liblzma, because liblzma needs to know the size of every filter-specific options structure. The filter-specific options are not validated. If options is NULL, any unsupported Filter IDs are copied without returning an error.

+

Old filter-specific options in dest are not freed, so dest doesn't need to be initialized by the caller in any way.

+

If an error occurs, memory possibly already allocated by this function is always freed. liblzma versions older than 5.2.7 may modify the dest array and leave its contents in an undefined state if an error occurs. liblzma 5.2.7 and newer only modify the dest array when returning LZMA_OK.

+
Parameters
+ + + + +
srcArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
[out]destDestination filter array
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_OPTIONS_ERROR: Unsupported Filter ID and its options is not NULL.
  • +
  • LZMA_PROG_ERROR: src or dest is NULL.
  • +
+
+ +
+
+ +

◆ lzma_filters_free()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void lzma_filters_free (lzma_filterfilters,
const lzma_allocatorallocator 
)
+
+ +

Free the options in the array of lzma_filter structures.

+

This frees the filter chain options. The filters array itself is not freed.

+

The filters array must have at most LZMA_FILTERS_MAX + 1 elements including the terminating element which must have .id = LZMA_VLI_UNKNOWN. For all elements before the terminating element:

    +
  • options will be freed using the given lzma_allocator or, if allocator is NULL, using free().
  • +
  • options will be set to NULL.
  • +
  • id will be set to LZMA_VLI_UNKNOWN.
  • +
+

If filters is NULL, this does nothing. Again, this never frees the filters array itself.

+
Parameters
+ + + +
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+ +
+
+ +

◆ lzma_raw_encoder_memusage()

+ +
+
+ + + + + + + + +
uint64_t lzma_raw_encoder_memusage (const lzma_filterfilters)
+
+ +

Calculate approximate memory requirements for raw encoder.

+

This function can be used to calculate the memory requirements for Block and Stream encoders too because Block and Stream encoders don't need significantly more memory than raw encoder.

+
Parameters
+ + +
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
+
+
+
Returns
Number of bytes of memory required for the given filter chain when encoding or UINT64_MAX on error.
+ +
+
+ +

◆ lzma_raw_decoder_memusage()

+ +
+
+ + + + + + + + +
uint64_t lzma_raw_decoder_memusage (const lzma_filterfilters)
+
+ +

Calculate approximate memory requirements for raw decoder.

+

This function can be used to calculate the memory requirements for Block and Stream decoders too because Block and Stream decoders don't need significantly more memory than raw decoder.

+
Parameters
+ + +
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
+
+
+
Returns
Number of bytes of memory required for the given filter chain when decoding or UINT64_MAX on error.
+ +
+
+ +

◆ lzma_raw_encoder()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_raw_encoder (lzma_streamstrm,
const lzma_filterfilters 
)
+
+ +

Initialize raw encoder.

+

This function may be useful when implementing custom file formats.

+

The `action' with lzma_code() can be LZMA_RUN, LZMA_SYNC_FLUSH (if the filter chain supports it), or LZMA_FINISH.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_raw_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_raw_decoder (lzma_streamstrm,
const lzma_filterfilters 
)
+
+ +

Initialize raw decoder.

+

The initialization of raw decoder goes similarly to raw encoder.

+

The `action' with lzma_code() can be LZMA_RUN or LZMA_FINISH. Using LZMA_FINISH is not required, it is supported just for convenience.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_filters_update()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_filters_update (lzma_streamstrm,
const lzma_filterfilters 
)
+
+ +

Update the filter chain in the encoder.

+

This function may be called after lzma_code() has returned LZMA_STREAM_END when LZMA_FULL_BARRIER, LZMA_FULL_FLUSH, or LZMA_SYNC_FLUSH was used:

+
    +
  • After LZMA_FULL_BARRIER or LZMA_FULL_FLUSH: Single-threaded .xz Stream encoder (lzma_stream_encoder()) and (since liblzma 5.4.0) multi-threaded Stream encoder (lzma_stream_encoder_mt()) allow setting a new filter chain to be used for the next Block(s).
  • +
  • After LZMA_SYNC_FLUSH: Raw encoder (lzma_raw_encoder()), Block encoder (lzma_block_encoder()), and single-threaded .xz Stream encoder (lzma_stream_encoder()) allow changing certain filter-specific options in the middle of encoding. The actual filters in the chain (Filter IDs) must not be changed! Currently only the lc, lp, and pb options of LZMA2 (not LZMA1) can be changed this way.
  • +
  • In the future some filters might allow changing some of their options without any barrier or flushing but currently such filters don't exist.
  • +
+

This function may also be called when no data has been compressed yet although this is rarely useful. In that case, this function will behave as if LZMA_FULL_FLUSH (Stream encoders) or LZMA_SYNC_FLUSH (Raw or Block encoder) had been used right before calling this function.

+
Parameters
+ + + +
strmPointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT.
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_MEMLIMIT_ERROR
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_raw_buffer_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_raw_buffer_encode (const lzma_filterfilters,
const lzma_allocatorallocator,
const uint8_t * in,
size_t in_size,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call raw encoder.

+
Note
There is no function to calculate how big output buffer would surely be big enough. (lzma_stream_buffer_bound() works only for lzma_stream_buffer_encode(); raw encoder won't necessarily meet that bound.)
+
Parameters
+ + + + + + + + +
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_sizeSize of the input buffer
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_BUF_ERROR: Not enough output buffer space.
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_raw_buffer_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_raw_buffer_decode (const lzma_filterfilters,
const lzma_allocatorallocator,
const uint8_t * in,
size_t * in_pos,
size_t in_size,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call raw decoder.

+
Parameters
+ + + + + + + + + +
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_posThe next byte will be read from in[*in_pos]. *in_pos is updated only if decoding succeeds.
in_sizeSize of the input buffer; the first byte that won't be read is in[in_size].
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Decoding was successful.
  • +
  • LZMA_BUF_ERROR: Not enough output buffer space.
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_properties_size()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_properties_size (uint32_t * size,
const lzma_filterfilter 
)
+
+ +

Get the size of the Filter Properties field.

+

This function may be useful when implementing custom file formats using the raw encoder and decoder.

+
Note
This function validates the Filter ID, but does not necessarily validate the options. Thus, it is possible that this returns LZMA_OK while the following call to lzma_properties_encode() returns LZMA_OPTIONS_ERROR.
+
Parameters
+ + + +
[out]sizePointer to uint32_t to hold the size of the properties
filterFilter ID and options (the size of the properties may vary depending on the options)
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_properties_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_properties_encode (const lzma_filterfilter,
uint8_t * props 
)
+
+ +

Encode the Filter Properties field.

+
Note
Even this function won't validate more options than actually necessary. Thus, it is possible that encoding the properties succeeds but using the same options to initialize the encoder will fail.
+
+If lzma_properties_size() indicated that the size of the Filter Properties field is zero, calling lzma_properties_encode() is not required, but it won't do any harm either.
+
Parameters
+ + + +
filterFilter ID and options
[out]propsBuffer to hold the encoded options. The size of the buffer must have been already determined with lzma_properties_size().
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_properties_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_properties_decode (lzma_filterfilter,
const lzma_allocatorallocator,
const uint8_t * props,
size_t props_size 
)
+
+ +

Decode the Filter Properties field.

+
Parameters
+ + + + + +
filterfilter->id must have been set to the correct Filter ID. filter->options doesn't need to be initialized (it's not freed by this function). The decoded options will be stored in filter->options; it's application's responsibility to free it when appropriate. filter->options is set to NULL if there are no properties or if an error occurs.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free(). and in case of an error, also free().
propsInput buffer containing the properties.
props_sizeSize of the properties. This must be the exact size; giving too much or too little input will return LZMA_OPTIONS_ERROR.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
+
+ +
+
+ +

◆ lzma_filter_flags_size()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_filter_flags_size (uint32_t * size,
const lzma_filterfilter 
)
+
+ +

Calculate encoded size of a Filter Flags field.

+

Knowing the size of Filter Flags is useful to know when allocating memory to hold the encoded Filter Flags.

+
Note
If you need to calculate size of List of Filter Flags, you need to loop over every lzma_filter entry.
+
Parameters
+ + + +
[out]sizePointer to integer to hold the calculated size
filterFilter ID and associated options whose encoded size is to be calculated
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: *size set successfully. Note that this doesn't guarantee that filter->options is valid, thus lzma_filter_flags_encode() may still fail.
  • +
  • LZMA_OPTIONS_ERROR: Unknown Filter ID or unsupported options.
  • +
  • LZMA_PROG_ERROR: Invalid options
  • +
+
+ +
+
+ +

◆ lzma_filter_flags_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_filter_flags_encode (const lzma_filterfilter,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Encode Filter Flags into given buffer.

+

In contrast to some functions, this doesn't allocate the needed buffer. This is due to how this function is used internally by liblzma.

+
Parameters
+ + + + + +
filterFilter ID and options to be encoded
[out]outBeginning of the output buffer
[out]out_posout[*out_pos] is the next write position. This is updated by the encoder.
out_sizeout[out_size] is the first byte to not write.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_OPTIONS_ERROR: Invalid or unsupported options.
  • +
  • LZMA_PROG_ERROR: Invalid options or not enough output buffer space (you should have checked it with lzma_filter_flags_size()).
  • +
+
+ +
+
+ +

◆ lzma_filter_flags_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_filter_flags_decode (lzma_filterfilter,
const lzma_allocatorallocator,
const uint8_t * in,
size_t * in_pos,
size_t in_size 
)
+
+ +

Decode Filter Flags from given buffer.

+

The decoded result is stored into *filter. The old value of filter->options is not free()d. If anything other than LZMA_OK is returned, filter->options is set to NULL.

+
Parameters
+ + + + + + +
[out]filterDestination filter. The decoded Filter ID will be stored in filter->id. If options are needed they will be allocated and the pointer will be stored in filter->options.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
[out]in_posThe next byte will be read from in[*in_pos]. *in_pos is updated only if decoding succeeds.
in_sizeSize of the input buffer; the first byte that won't be read is in[in_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_OPTIONS_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_str_to_filters()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
const char * lzma_str_to_filters (const char * str,
int * error_pos,
lzma_filterfilters,
uint32_t flags,
const lzma_allocatorallocator 
)
+
+ +

Convert a string to a filter chain.

+

This tries to make it easier to write applications that allow users to set custom compression options. This only handles the filter configuration (including presets) but not the number of threads, block size, check type, or memory limits.

+

The input string can be either a preset or a filter chain. Presets begin with a digit 0-9 and may be followed by zero or more flags which are lower-case letters. Currently only "e" is supported, matching LZMA_PRESET_EXTREME. For partial xz command line syntax compatibility, a preset string may start with a single dash "-".

+

A filter chain consists of one or more "filtername:opt1=value1,opt2=value2" strings separated by one or more spaces. Leading and trailing spaces are ignored. All names and values must be lower-case. Extra commas in the option list are ignored. The order of filters is significant: when encoding, the uncompressed input data goes to the leftmost filter first. Normally "lzma2" is the last filter in the chain.

+

If one wishes to avoid spaces, for example, to avoid shell quoting, it is possible to use two dashes "--" instead of spaces to separate the filters.

+

For xz command line compatibility, each filter may be prefixed with two dashes "--" and the colon ":" separating the filter name from the options may be replaced with an equals sign "=".

+

By default, only filters that can be used in the .xz format are accepted. To allow all filters (LZMA1) use the flag LZMA_STR_ALL_FILTERS.

+

By default, very basic validation is done for the filter chain as a whole, for example, that LZMA2 is only used as the last filter in the chain. The validation isn't perfect though and it's possible that this function succeeds but using the filter chain for encoding or decoding will still result in LZMA_OPTIONS_ERROR. To disable this validation, use the flag LZMA_STR_NO_VALIDATION.

+

The available filter names and their options are available via lzma_str_list_filters(). See the xz man page for the description of filter names and options.

+

For command line applications, below is an example how an error message can be displayed. Note the use of an empty string for the field width. If "^" was used there it would create an off-by-one error except at the very beginning of the line.

+
const char *str = ...; // From user
+ +
int pos;
+
const char *msg = lzma_str_to_filters(str, &pos, filters, 0, NULL);
+
if (msg != NULL) {
+
printf("%s: Error in XZ compression options:\n", argv[0]);
+
printf("%s: %s\n", argv[0], str);
+
printf("%s: %*s^\n", argv[0], errpos, "");
+
printf("%s: %s\n", argv[0], msg);
+
}
+
Parameters
+ + + + + + +
strUser-supplied string describing a preset or a filter chain. If a default value is needed and you don't know what would be good, use "6" since that is the default preset in xz too.
[out]error_posIf this isn't NULL, this value will be set on both success and on all errors. This tells the location of the error in the string. This is an int to make it straightforward to use this as printf() field width. The value is guaranteed to be in the range [0, INT_MAX] even if strlen(str) somehow was greater than INT_MAX.
[out]filtersAn array of lzma_filter structures. There must be LZMA_FILTERS_MAX + 1 (that is, five) elements in the array. The old contents are ignored so it doesn't need to be initialized. This array is modified only if this function returns NULL. Once the allocated filter options are no longer needed, lzma_filters_free() can be used to free the options (it doesn't free the filters array itself).
flagsBitwise-or of zero or more of the flags LZMA_STR_ALL_FILTERS and LZMA_STR_NO_VALIDATION.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+
Returns
On success, NULL is returned. On error, a statically-allocated error message is returned which together with the error_pos should give some idea what is wrong.
+ +
+
+ +

◆ lzma_str_from_filters()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_str_from_filters (char ** str,
const lzma_filterfilters,
uint32_t flags,
const lzma_allocatorallocator 
)
+
+ +

Convert a filter chain to a string.

+

Use cases:

+
    +
  • Verbose output showing the full encoder options to the user (use LZMA_STR_ENCODER in flags)
  • +
  • Showing the filters and options that are required to decode a file (use LZMA_STR_DECODER in flags)
  • +
  • Showing the filter names without any options in informational messages where the technical details aren't important (no flags). In this case the .options in the filters array are ignored and may be NULL even if a filter has a mandatory options structure.
  • +
+

Note that even if the filter chain was specified using a preset, the resulting filter chain isn't reversed to a preset. So if you specify "6" to lzma_str_to_filters() then lzma_str_from_filters() will produce a string containing "lzma2".

+
Parameters
+ + + + + +
[out]strOn success *str will be set to point to an allocated string describing the given filter chain. Old value is ignored. On error *str is always set to NULL.
filtersArray of filters terminated with .id == LZMA_VLI_UNKNOWN.
flagsBitwise-or of zero or more of the flags LZMA_STR_ENCODER, LZMA_STR_DECODER, LZMA_STR_GETOPT_LONG, and LZMA_STR_NO_SPACES.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_OPTIONS_ERROR: Empty filter chain (filters[0].id == LZMA_VLI_UNKNOWN) or the filter chain includes a Filter ID that is not supported by this function.
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_str_list_filters()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_str_list_filters (char ** str,
lzma_vli filter_id,
uint32_t flags,
const lzma_allocatorallocator 
)
+
+ +

List available filters and/or their options (for help message)

+

If a filter_id is given then only one line is created which contains the filter name. If LZMA_STR_ENCODER or LZMA_STR_DECODER is used then the options read by the encoder or decoder are printed on the same line.

+

If filter_id is LZMA_VLI_UNKNOWN then all supported .xz-compatible filters are listed:

+
    +
  • If neither LZMA_STR_ENCODER nor LZMA_STR_DECODER is used then the supported filter names are listed on a single line separated by spaces.
  • +
  • If LZMA_STR_ENCODER or LZMA_STR_DECODER is used then filters and the supported options are listed one filter per line. There won't be a newline after the last filter.
  • +
  • If LZMA_STR_ALL_FILTERS is used then the list will include also those filters that cannot be used in the .xz format (LZMA1).
  • +
+
Parameters
+ + + + + +
strOn success *str will be set to point to an allocated string listing the filters and options. Old value is ignored. On error *str is always set to NULL.
filter_idFilter ID or LZMA_VLI_UNKNOWN.
flagsBitwise-or of zero or more of the flags LZMA_STR_ALL_FILTERS, LZMA_STR_ENCODER, LZMA_STR_DECODER, and LZMA_STR_GETOPT_LONG.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_OPTIONS_ERROR: Unsupported filter_id or flags
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+
+ + + + diff --git a/doc/api/folderclosed.svg b/doc/api/folderclosed.svg new file mode 100644 index 0000000..47d22df --- /dev/null +++ b/doc/api/folderclosed.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/doc/api/folderclosedd.svg b/doc/api/folderclosedd.svg new file mode 100644 index 0000000..8fe0031 --- /dev/null +++ b/doc/api/folderclosedd.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/doc/api/folderopen.svg b/doc/api/folderopen.svg new file mode 100644 index 0000000..9565570 --- /dev/null +++ b/doc/api/folderopen.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/doc/api/folderopend.svg b/doc/api/folderopend.svg new file mode 100644 index 0000000..e72e225 --- /dev/null +++ b/doc/api/folderopend.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/doc/api/functions.html b/doc/api/functions.html new file mode 100644 index 0000000..b50cf73 --- /dev/null +++ b/doc/api/functions.html @@ -0,0 +1,210 @@ + + + + + + + +liblzma (XZ Utils): Data Fields + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + + +
+
+
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+
+ + + + diff --git a/doc/api/functions_vars.html b/doc/api/functions_vars.html new file mode 100644 index 0000000..f6d689c --- /dev/null +++ b/doc/api/functions_vars.html @@ -0,0 +1,210 @@ + + + + + + + +liblzma (XZ Utils): Data Fields - Variables + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + + +
+
+
Here is a list of all documented variables with links to the struct/union documentation for each field:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+
+ + + + diff --git a/doc/api/globals.html b/doc/api/globals.html new file mode 100644 index 0000000..f80423c --- /dev/null +++ b/doc/api/globals.html @@ -0,0 +1,272 @@ + + + + + + + +liblzma (XZ Utils): Globals + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + + +
+
+
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
+ +

- l -

+
+ + + + diff --git a/doc/api/globals_defs.html b/doc/api/globals_defs.html new file mode 100644 index 0000000..a7b945c --- /dev/null +++ b/doc/api/globals_defs.html @@ -0,0 +1,119 @@ + + + + + + + +liblzma (XZ Utils): Globals + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + + +
+
+
Here is a list of all documented macros with links to the documentation:
+ +

- l -

+
+ + + + diff --git a/doc/api/globals_enum.html b/doc/api/globals_enum.html new file mode 100644 index 0000000..1820871 --- /dev/null +++ b/doc/api/globals_enum.html @@ -0,0 +1,71 @@ + + + + + + + +liblzma (XZ Utils): Globals + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+
Here is a list of all documented enums with links to the documentation:
+
+ + + + diff --git a/doc/api/globals_eval.html b/doc/api/globals_eval.html new file mode 100644 index 0000000..51424c7 --- /dev/null +++ b/doc/api/globals_eval.html @@ -0,0 +1,103 @@ + + + + + + + +liblzma (XZ Utils): Globals + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + + +
+
+
Here is a list of all documented enum values with links to the documentation:
+ +

- l -

+
+ + + + diff --git a/doc/api/globals_func.html b/doc/api/globals_func.html new file mode 100644 index 0000000..091e519 --- /dev/null +++ b/doc/api/globals_func.html @@ -0,0 +1,177 @@ + + + + + + + +liblzma (XZ Utils): Globals + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + + +
+
+
Here is a list of all documented functions with links to the documentation:
+ +

- l -

+
+ + + + diff --git a/doc/api/globals_type.html b/doc/api/globals_type.html new file mode 100644 index 0000000..cd7aa3f --- /dev/null +++ b/doc/api/globals_type.html @@ -0,0 +1,68 @@ + + + + + + + +liblzma (XZ Utils): Globals + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+
Here is a list of all documented typedefs with links to the documentation:
+
+ + + + diff --git a/doc/api/hardware_8h.html b/doc/api/hardware_8h.html new file mode 100644 index 0000000..fd302e2 --- /dev/null +++ b/doc/api/hardware_8h.html @@ -0,0 +1,123 @@ + + + + + + + +liblzma (XZ Utils): lzma/hardware.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
hardware.h File Reference
+
+
+ +

Hardware information. +More...

+ + + + + + + + +

+Functions

uint64_t lzma_physmem (void) lzma_nothrow
 Get the total amount of physical memory (RAM) in bytes.
 
uint32_t lzma_cputhreads (void) lzma_nothrow
 Get the number of processor cores or threads.
 
+

Detailed Description

+

Hardware information.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Since liblzma can consume a lot of system resources, it also provides ways to limit the resource usage. Applications linking against liblzma need to do the actual decisions how much resources to let liblzma to use. To ease making these decisions, liblzma provides functions to find out the relevant capabilities of the underlying hardware. Currently there is only a function to find out the amount of RAM, but in the future there will be also a function to detect how many concurrent threads the system can run.

+
Note
On some operating systems, these function may temporarily load a shared library or open file descriptor(s) to find out the requested hardware information. Unless the application assumes that specific file descriptors are not touched by other threads, this should have no effect on thread safety. Possible operations involving file descriptors will restart the syscalls if they return EINTR.
+

Function Documentation

+ +

◆ lzma_physmem()

+ +
+
+ + + + + + + + +
uint64_t lzma_physmem (void )
+
+ +

Get the total amount of physical memory (RAM) in bytes.

+

This function may be useful when determining a reasonable memory usage limit for decompressing or how much memory it is OK to use for compressing.

+
Returns
On success, the total amount of physical memory in bytes is returned. If the amount of RAM cannot be determined, zero is returned. This can happen if an error occurs or if there is no code in liblzma to detect the amount of RAM on the specific operating system.
+ +
+
+ +

◆ lzma_cputhreads()

+ +
+
+ + + + + + + + +
uint32_t lzma_cputhreads (void )
+
+ +

Get the number of processor cores or threads.

+

This function may be useful when determining how many threads to use. If the hardware supports more than one thread per CPU core, the number of hardware threads is returned if that information is available.

+
Returns
On success, the number of available CPU threads or cores is returned. If this information isn't available or an error occurs, zero is returned.
+ +
+
+
+ + + + diff --git a/doc/api/index.html b/doc/api/index.html new file mode 100644 index 0000000..b3f8cce --- /dev/null +++ b/doc/api/index.html @@ -0,0 +1,53 @@ + + + + + + + +liblzma (XZ Utils): liblzma (XZ Utils) + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + +
+
+
liblzma (XZ Utils)
+
+
+

liblzma is a public domain general-purpose data compression library with a zlib-like API. The native file format is .xz, but also the old .lzma format and raw (no headers) streams are supported. Multiple compression algorithms (filters) are supported. Currently LZMA2 is the primary filter.

+

liblzma is part of XZ Utils https://tukaani.org/xz/. XZ Utils includes a gzip-like command line tool named xz and some other tools. XZ Utils is developed and maintained by Lasse Collin and Jia Tan.

+

Major parts of liblzma are based on Igor Pavlov's public domain LZMA SDK https://7-zip.org/sdk.html.

+

The SHA-256 implementation is based on the public domain code found from 7-Zip https://7-zip.org/, which has a modified version of the public domain SHA-256 code found from Crypto++ https://www.cryptopp.com/. The SHA-256 code in Crypto++ was written by Kevin Springle and Wei Dai.

+
+
+ + + + diff --git a/doc/api/index_8h.html b/doc/api/index_8h.html new file mode 100644 index 0000000..f0de050 --- /dev/null +++ b/doc/api/index_8h.html @@ -0,0 +1,1268 @@ + + + + + + + +liblzma (XZ Utils): lzma/index.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
index.h File Reference
+
+
+ +

Handling of .xz Index and related information. +More...

+ + + + + +

+Data Structures

struct  lzma_index_iter
 Iterator to get information about Blocks and Streams. More...
 
+ + + + +

+Typedefs

typedef struct lzma_index_s lzma_index
 Opaque data type to hold the Index(es) and other information.
 
+ + + + +

+Enumerations

enum  lzma_index_iter_mode { LZMA_INDEX_ITER_ANY = 0 +, LZMA_INDEX_ITER_STREAM = 1 +, LZMA_INDEX_ITER_BLOCK = 2 +, LZMA_INDEX_ITER_NONEMPTY_BLOCK = 3 + }
 Operation mode for lzma_index_iter_next() More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

uint64_t lzma_index_memusage (lzma_vli streams, lzma_vli blocks) lzma_nothrow
 Calculate memory usage of lzma_index.
 
uint64_t lzma_index_memused (const lzma_index *i) lzma_nothrow
 Calculate the memory usage of an existing lzma_index.
 
lzma_indexlzma_index_init (const lzma_allocator *allocator) lzma_nothrow
 Allocate and initialize a new lzma_index structure.
 
void lzma_index_end (lzma_index *i, const lzma_allocator *allocator) lzma_nothrow
 Deallocate lzma_index.
 
lzma_ret lzma_index_append (lzma_index *i, const lzma_allocator *allocator, lzma_vli unpadded_size, lzma_vli uncompressed_size) lzma_nothrow lzma_attr_warn_unused_result
 Add a new Block to lzma_index.
 
lzma_ret lzma_index_stream_flags (lzma_index *i, const lzma_stream_flags *stream_flags) lzma_nothrow lzma_attr_warn_unused_result
 Set the Stream Flags.
 
uint32_t lzma_index_checks (const lzma_index *i) lzma_nothrow lzma_attr_pure
 Get the types of integrity Checks.
 
lzma_ret lzma_index_stream_padding (lzma_index *i, lzma_vli stream_padding) lzma_nothrow lzma_attr_warn_unused_result
 Set the amount of Stream Padding.
 
lzma_vli lzma_index_stream_count (const lzma_index *i) lzma_nothrow lzma_attr_pure
 Get the number of Streams.
 
lzma_vli lzma_index_block_count (const lzma_index *i) lzma_nothrow lzma_attr_pure
 Get the number of Blocks.
 
lzma_vli lzma_index_size (const lzma_index *i) lzma_nothrow lzma_attr_pure
 Get the size of the Index field as bytes.
 
lzma_vli lzma_index_stream_size (const lzma_index *i) lzma_nothrow lzma_attr_pure
 Get the total size of the Stream.
 
lzma_vli lzma_index_total_size (const lzma_index *i) lzma_nothrow lzma_attr_pure
 Get the total size of the Blocks.
 
lzma_vli lzma_index_file_size (const lzma_index *i) lzma_nothrow lzma_attr_pure
 Get the total size of the file.
 
lzma_vli lzma_index_uncompressed_size (const lzma_index *i) lzma_nothrow lzma_attr_pure
 Get the uncompressed size of the file.
 
void lzma_index_iter_init (lzma_index_iter *iter, const lzma_index *i) lzma_nothrow
 Initialize an iterator.
 
void lzma_index_iter_rewind (lzma_index_iter *iter) lzma_nothrow
 Rewind the iterator.
 
lzma_bool lzma_index_iter_next (lzma_index_iter *iter, lzma_index_iter_mode mode) lzma_nothrow lzma_attr_warn_unused_result
 Get the next Block or Stream.
 
lzma_bool lzma_index_iter_locate (lzma_index_iter *iter, lzma_vli target) lzma_nothrow
 Locate a Block.
 
lzma_ret lzma_index_cat (lzma_index *dest, lzma_index *src, const lzma_allocator *allocator) lzma_nothrow lzma_attr_warn_unused_result
 Concatenate lzma_indexes.
 
lzma_indexlzma_index_dup (const lzma_index *i, const lzma_allocator *allocator) lzma_nothrow lzma_attr_warn_unused_result
 Duplicate lzma_index.
 
lzma_ret lzma_index_encoder (lzma_stream *strm, const lzma_index *i) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .xz Index encoder.
 
lzma_ret lzma_index_decoder (lzma_stream *strm, lzma_index **i, uint64_t memlimit) lzma_nothrow lzma_attr_warn_unused_result
 Initialize .xz Index decoder.
 
lzma_ret lzma_index_buffer_encode (const lzma_index *i, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow
 Single-call .xz Index encoder.
 
lzma_ret lzma_index_buffer_decode (lzma_index **i, uint64_t *memlimit, const lzma_allocator *allocator, const uint8_t *in, size_t *in_pos, size_t in_size) lzma_nothrow
 Single-call .xz Index decoder.
 
lzma_ret lzma_file_info_decoder (lzma_stream *strm, lzma_index **dest_index, uint64_t memlimit, uint64_t file_size) lzma_nothrow
 Initialize a .xz file information decoder.
 
+

Detailed Description

+

Handling of .xz Index and related information.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Typedef Documentation

+ +

◆ lzma_index

+ +
+
+ + + + +
typedef struct lzma_index_s lzma_index
+
+ +

Opaque data type to hold the Index(es) and other information.

+

lzma_index often holds just one .xz Index and possibly the Stream Flags of the same Stream and size of the Stream Padding field. However, multiple lzma_indexes can be concatenated with lzma_index_cat() and then there may be information about multiple Streams in the same lzma_index.

+

Notes about thread safety: Only one thread may modify lzma_index at a time. All functions that take non-const pointer to lzma_index modify it. As long as no thread is modifying the lzma_index, getting information from the same lzma_index can be done from multiple threads at the same time with functions that take a const pointer to lzma_index or use lzma_index_iter. The same iterator must be used only by one thread at a time, of course, but there can be as many iterators for the same lzma_index as needed.

+ +
+
+

Enumeration Type Documentation

+ +

◆ lzma_index_iter_mode

+ +
+
+ + + + +
enum lzma_index_iter_mode
+
+ +

Operation mode for lzma_index_iter_next()

+ + + + + +
Enumerator
LZMA_INDEX_ITER_ANY 

Get the next Block or Stream.

+

Go to the next Block if the current Stream has at least one Block left. Otherwise go to the next Stream even if it has no Blocks. If the Stream has no Blocks (lzma_index_iter.stream.block_count == 0), lzma_index_iter.block will have undefined values.

+
LZMA_INDEX_ITER_STREAM 

Get the next Stream.

+

Go to the next Stream even if the current Stream has unread Blocks left. If the next Stream has at least one Block, the iterator will point to the first Block. If there are no Blocks, lzma_index_iter.block will have undefined values.

+
LZMA_INDEX_ITER_BLOCK 

Get the next Block.

+

Go to the next Block if the current Stream has at least one Block left. If the current Stream has no Blocks left, the next Stream with at least one Block is located and the iterator will be made to point to the first Block of that Stream.

+
LZMA_INDEX_ITER_NONEMPTY_BLOCK 

Get the next non-empty Block.

+

This is like LZMA_INDEX_ITER_BLOCK except that it will skip Blocks whose Uncompressed Size is zero.

+
+ +
+
+

Function Documentation

+ +

◆ lzma_index_memusage()

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint64_t lzma_index_memusage (lzma_vli streams,
lzma_vli blocks 
)
+
+ +

Calculate memory usage of lzma_index.

+

On disk, the size of the Index field depends on both the number of Records stored and the size of the Records (due to variable-length integer encoding). When the Index is kept in lzma_index structure, the memory usage depends only on the number of Records/Blocks stored in the Index(es), and in case of concatenated lzma_indexes, the number of Streams. The size in RAM is almost always significantly bigger than in the encoded form on disk.

+

This function calculates an approximate amount of memory needed to hold the given number of Streams and Blocks in lzma_index structure. This value may vary between CPU architectures and also between liblzma versions if the internal implementation is modified.

+
Parameters
+ + + +
streamsNumber of Streams
blocksNumber of Blocks
+
+
+
Returns
Approximate memory in bytes needed in a lzma_index structure.
+ +
+
+ +

◆ lzma_index_memused()

+ +
+
+ + + + + + + + +
uint64_t lzma_index_memused (const lzma_indexi)
+
+ +

Calculate the memory usage of an existing lzma_index.

+

This is a shorthand for lzma_index_memusage(lzma_index_stream_count(i), lzma_index_block_count(i)).

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Approximate memory in bytes used by the lzma_index structure.
+ +
+
+ +

◆ lzma_index_init()

+ +
+
+ + + + + + + + +
lzma_index * lzma_index_init (const lzma_allocatorallocator)
+
+ +

Allocate and initialize a new lzma_index structure.

+
Parameters
+ + +
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+
Returns
On success, a pointer to an empty initialized lzma_index is returned. If allocation fails, NULL is returned.
+ +
+
+ +

◆ lzma_index_end()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void lzma_index_end (lzma_indexi,
const lzma_allocatorallocator 
)
+
+ +

Deallocate lzma_index.

+

If i is NULL, this does nothing.

+
Parameters
+ + + +
iPointer to lzma_index structure to deallocate
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+ +
+
+ +

◆ lzma_index_append()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_append (lzma_indexi,
const lzma_allocatorallocator,
lzma_vli unpadded_size,
lzma_vli uncompressed_size 
)
+
+ +

Add a new Block to lzma_index.

+
Parameters
+ + + + + +
iPointer to a lzma_index structure
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
unpadded_sizeUnpadded Size of a Block. This can be calculated with lzma_block_unpadded_size() after encoding or decoding the Block.
uncompressed_sizeUncompressed Size of a Block. This can be taken directly from lzma_block structure after encoding or decoding the Block.
+
+
+

Appending a new Block does not invalidate iterators. For example, if an iterator was pointing to the end of the lzma_index, after lzma_index_append() it is possible to read the next Block with an existing iterator.

+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_DATA_ERROR: Compressed or uncompressed size of the Stream or size of the Index field would grow too big.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_index_stream_flags()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_stream_flags (lzma_indexi,
const lzma_stream_flagsstream_flags 
)
+
+ +

Set the Stream Flags.

+

Set the Stream Flags of the last (and typically the only) Stream in lzma_index. This can be useful when reading information from the lzma_index, because to decode Blocks, knowing the integrity check type is needed.

+
Parameters
+ + + +
iPointer to lzma_index structure
stream_flagsPointer to lzma_stream_flags structure. This is copied into the internal preallocated structure, so the caller doesn't need to keep the flags' data available after calling this function.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_OPTIONS_ERROR: Unsupported stream_flags->version.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_index_checks()

+ +
+
+ + + + + + + + +
uint32_t lzma_index_checks (const lzma_indexi)
+
+ +

Get the types of integrity Checks.

+

If lzma_index_stream_flags() is used to set the Stream Flags for every Stream, lzma_index_checks() can be used to get a bitmask to indicate which Check types have been used. It can be useful e.g. if showing the Check types to the user.

+

The bitmask is 1 << check_id, e.g. CRC32 is 1 << 1 and SHA-256 is 1 << 10.

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Bitmask indicating which Check types are used in the lzma_index
+ +
+
+ +

◆ lzma_index_stream_padding()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_stream_padding (lzma_indexi,
lzma_vli stream_padding 
)
+
+ +

Set the amount of Stream Padding.

+

Set the amount of Stream Padding of the last (and typically the only) Stream in the lzma_index. This is needed when planning to do random-access reading within multiple concatenated Streams.

+

By default, the amount of Stream Padding is assumed to be zero bytes.

+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_DATA_ERROR: The file size would grow too big.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_index_stream_count()

+ +
+
+ + + + + + + + +
lzma_vli lzma_index_stream_count (const lzma_indexi)
+
+ +

Get the number of Streams.

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Number of Streams in the lzma_index
+ +
+
+ +

◆ lzma_index_block_count()

+ +
+
+ + + + + + + + +
lzma_vli lzma_index_block_count (const lzma_indexi)
+
+ +

Get the number of Blocks.

+

This returns the total number of Blocks in lzma_index. To get number of Blocks in individual Streams, use lzma_index_iter.

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Number of blocks in the lzma_index
+ +
+
+ +

◆ lzma_index_size()

+ +
+
+ + + + + + + + +
lzma_vli lzma_index_size (const lzma_indexi)
+
+ +

Get the size of the Index field as bytes.

+

This is needed to verify the Backward Size field in the Stream Footer.

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Size in bytes of the Index
+ +
+
+ +

◆ lzma_index_stream_size()

+ +
+
+ + + + + + + + +
lzma_vli lzma_index_stream_size (const lzma_indexi)
+
+ +

Get the total size of the Stream.

+

If multiple lzma_indexes have been combined, this works as if the Blocks were in a single Stream. This is useful if you are going to combine Blocks from multiple Streams into a single new Stream.

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Size in bytes of the Stream (if all Blocks are combined into one Stream).
+ +
+
+ +

◆ lzma_index_total_size()

+ +
+
+ + + + + + + + +
lzma_vli lzma_index_total_size (const lzma_indexi)
+
+ +

Get the total size of the Blocks.

+

This doesn't include the Stream Header, Stream Footer, Stream Padding, or Index fields.

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Size in bytes of all Blocks in the Stream(s)
+ +
+
+ +

◆ lzma_index_file_size()

+ +
+
+ + + + + + + + +
lzma_vli lzma_index_file_size (const lzma_indexi)
+
+ +

Get the total size of the file.

+

When no lzma_indexes have been combined with lzma_index_cat() and there is no Stream Padding, this function is identical to lzma_index_stream_size(). If multiple lzma_indexes have been combined, this includes also the headers of each separate Stream and the possible Stream Padding fields.

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Total size of the .xz file in bytes
+ +
+
+ +

◆ lzma_index_uncompressed_size()

+ +
+
+ + + + + + + + +
lzma_vli lzma_index_uncompressed_size (const lzma_indexi)
+
+ +

Get the uncompressed size of the file.

+
Parameters
+ + +
iPointer to lzma_index structure
+
+
+
Returns
Size in bytes of the uncompressed data in the file
+ +
+
+ +

◆ lzma_index_iter_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void lzma_index_iter_init (lzma_index_iteriter,
const lzma_indexi 
)
+
+ +

Initialize an iterator.

+

This function associates the iterator with the given lzma_index, and calls lzma_index_iter_rewind() on the iterator.

+

This function doesn't allocate any memory, thus there is no lzma_index_iter_end(). The iterator is valid as long as the associated lzma_index is valid, that is, until lzma_index_end() or using it as source in lzma_index_cat(). Specifically, lzma_index doesn't become invalid if new Blocks are added to it with lzma_index_append() or if it is used as the destination in lzma_index_cat().

+

It is safe to make copies of an initialized lzma_index_iter, for example, to easily restart reading at some particular position.

+
Parameters
+ + + +
iterPointer to a lzma_index_iter structure
ilzma_index to which the iterator will be associated
+
+
+ +
+
+ +

◆ lzma_index_iter_rewind()

+ +
+
+ + + + + + + + +
void lzma_index_iter_rewind (lzma_index_iteriter)
+
+ +

Rewind the iterator.

+

Rewind the iterator so that next call to lzma_index_iter_next() will return the first Block or Stream.

+
Parameters
+ + +
iterPointer to a lzma_index_iter structure
+
+
+ +
+
+ +

◆ lzma_index_iter_next()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_bool lzma_index_iter_next (lzma_index_iteriter,
lzma_index_iter_mode mode 
)
+
+ +

Get the next Block or Stream.

+
Parameters
+ + + +
iterIterator initialized with lzma_index_iter_init()
modeSpecify what kind of information the caller wants to get. See lzma_index_iter_mode for details.
+
+
+
Returns
lzma_bool:
    +
  • true if no Block or Stream matching the mode is found. *iter is not updated (failure).
  • +
  • false if the next Block or Stream matching the mode was found. *iter is updated (success).
  • +
+
+ +
+
+ +

◆ lzma_index_iter_locate()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_bool lzma_index_iter_locate (lzma_index_iteriter,
lzma_vli target 
)
+
+ +

Locate a Block.

+

If it is possible to seek in the .xz file, it is possible to parse the Index field(s) and use lzma_index_iter_locate() to do random-access reading with granularity of Block size.

+

If the target is smaller than the uncompressed size of the Stream (can be checked with lzma_index_uncompressed_size()):

    +
  • Information about the Stream and Block containing the requested uncompressed offset is stored into *iter.
  • +
  • Internal state of the iterator is adjusted so that lzma_index_iter_next() can be used to read subsequent Blocks or Streams.
  • +
+

If the target is greater than the uncompressed size of the Stream, *iter is not modified.

+
Parameters
+ + + +
iterIterator that was earlier initialized with lzma_index_iter_init().
targetUncompressed target offset which the caller would like to locate from the Stream
+
+
+
Returns
lzma_bool:
    +
  • true if the target is greater than or equal to the uncompressed size of the Stream (failure)
  • +
  • false if the target is smaller than the uncompressed size of the Stream (success)
  • +
+
+ +
+
+ +

◆ lzma_index_cat()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_cat (lzma_indexdest,
lzma_indexsrc,
const lzma_allocatorallocator 
)
+
+ +

Concatenate lzma_indexes.

+

Concatenating lzma_indexes is useful when doing random-access reading in multi-Stream .xz file, or when combining multiple Streams into single Stream.

+
Parameters
+ + + + +
[out]destlzma_index after which src is appended
srclzma_index to be appended after dest. If this function succeeds, the memory allocated for src is freed or moved to be part of dest, and all iterators pointing to src will become invalid.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: lzma_indexes were concatenated successfully. src is now a dangling pointer.
  • +
  • LZMA_DATA_ERROR: *dest would grow too big.
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_index_dup()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_index * lzma_index_dup (const lzma_indexi,
const lzma_allocatorallocator 
)
+
+ +

Duplicate lzma_index.

+
Parameters
+ + + +
iPointer to lzma_index structure to be duplicated
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+
Returns
A copy of the lzma_index, or NULL if memory allocation failed.
+ +
+
+ +

◆ lzma_index_encoder()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_encoder (lzma_streamstrm,
const lzma_indexi 
)
+
+ +

Initialize .xz Index encoder.

+
Parameters
+ + + +
strmPointer to properly prepared lzma_stream
iPointer to lzma_index which should be encoded.
+
+
+

The valid `action' values for lzma_code() are LZMA_RUN and LZMA_FINISH. It is enough to use only one of them (you can choose freely).

+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Initialization succeeded, continue with lzma_code().
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_index_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_decoder (lzma_streamstrm,
lzma_index ** i,
uint64_t memlimit 
)
+
+ +

Initialize .xz Index decoder.

+
Parameters
+ + + + +
strmPointer to properly prepared lzma_stream
[out]iThe decoded Index will be made available via this pointer. Initially this function will set *i to NULL (the old value is ignored). If decoding succeeds (lzma_code() returns LZMA_STREAM_END), *i will be set to point to a new lzma_index, which the application has to later free with lzma_index_end().
memlimitHow much memory the resulting lzma_index is allowed to require. liblzma 5.2.3 and earlier don't allow 0 here and return LZMA_PROG_ERROR; later versions treat 0 as if 1 had been specified.
+
+
+

Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH. There is no need to use LZMA_FINISH, but it's allowed because it may simplify certain types of applications.

+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Initialization succeeded, continue with lzma_code().
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+
Note
liblzma 5.2.3 and older list also LZMA_MEMLIMIT_ERROR here but that error code has never been possible from this initialization function.
+ +
+
+ +

◆ lzma_index_buffer_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_buffer_encode (const lzma_indexi,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Single-call .xz Index encoder.

+
Note
This function doesn't take allocator argument since all the internal data is allocated on stack.
+
Parameters
+ + + + + +
ilzma_index to be encoded
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos]. *out_pos is updated only if encoding succeeds.
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_BUF_ERROR: Output buffer is too small. Use lzma_index_size() to find out how much output space is needed.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_index_buffer_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_buffer_decode (lzma_index ** i,
uint64_t * memlimit,
const lzma_allocatorallocator,
const uint8_t * in,
size_t * in_pos,
size_t in_size 
)
+
+ +

Single-call .xz Index decoder.

+
Parameters
+ + + + + + + +
[out]iIf decoding succeeds, *i will point to a new lzma_index, which the application has to later free with lzma_index_end(). If an error occurs, *i will be NULL. The old value of *i is always ignored and thus doesn't need to be initialized by the caller.
[out]memlimitPointer to how much memory the resulting lzma_index is allowed to require. The value pointed by this pointer is modified if and only if LZMA_MEMLIMIT_ERROR is returned.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
inBeginning of the input buffer
in_posThe next byte will be read from in[*in_pos]. *in_pos is updated only if decoding succeeds.
in_sizeSize of the input buffer; the first byte that won't be read is in[in_size].
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Decoding was successful.
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. The minimum required memlimit value was stored to *memlimit.
  • +
  • LZMA_DATA_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_file_info_decoder()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_file_info_decoder (lzma_streamstrm,
lzma_index ** dest_index,
uint64_t memlimit,
uint64_t file_size 
)
+
+ +

Initialize a .xz file information decoder.

+

This decoder decodes the Stream Header, Stream Footer, Index, and Stream Padding field(s) from the input .xz file and stores the resulting combined index in *dest_index. This information can be used to get the uncompressed file size with lzma_index_uncompressed_size(*dest_index) or, for example, to implement random access reading by locating the Blocks in the Streams.

+

To get the required information from the .xz file, lzma_code() may ask the application to seek in the input file by returning LZMA_SEEK_NEEDED and having the target file position specified in lzma_stream.seek_pos. The number of seeks required depends on the input file and how big buffers the application provides. When possible, the decoder will seek backward and forward in the given buffer to avoid useless seek requests. Thus, if the application provides the whole file at once, no external seeking will be required (that is, lzma_code() won't return LZMA_SEEK_NEEDED).

+

The value in lzma_stream.total_in can be used to estimate how much data liblzma had to read to get the file information. However, due to seeking and the way total_in is updated, the value of total_in will be somewhat inaccurate (a little too big). Thus, total_in is a good estimate but don't expect to see the same exact value for the same file if you change the input buffer size or switch to a different liblzma version.

+

Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH. You only need to use LZMA_RUN; LZMA_FINISH is only supported because it might be convenient for some applications. If you use LZMA_FINISH and if lzma_code() asks the application to seek, remember to reset `action' back to LZMA_RUN unless you hit the end of the file again.

+

Possible return values from lzma_code():

    +
  • LZMA_OK: All OK so far, more input needed
  • +
  • LZMA_SEEK_NEEDED: Provide more input starting from the absolute file position strm->seek_pos
  • +
  • LZMA_STREAM_END: Decoding was successful, *dest_index has been set
  • +
  • LZMA_FORMAT_ERROR: The input file is not in the .xz format (the expected magic bytes were not found from the beginning of the file)
  • +
  • LZMA_OPTIONS_ERROR: File looks valid but contains headers that aren't supported by this version of liblzma
  • +
  • LZMA_DATA_ERROR: File is corrupt
  • +
  • LZMA_BUF_ERROR
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_MEMLIMIT_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
Parameters
+ + + + + +
strmPointer to a properly prepared lzma_stream
[out]dest_indexPointer to a pointer where the decoder will put the decoded lzma_index. The old value of *dest_index is ignored (not freed).
memlimitHow much memory the resulting lzma_index is allowed to require. Use UINT64_MAX to effectively disable the limiter.
file_sizeSize of the input .xz file
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_MEM_ERROR
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+
+ + + + diff --git a/doc/api/index__hash_8h.html b/doc/api/index__hash_8h.html new file mode 100644 index 0000000..1f568ed --- /dev/null +++ b/doc/api/index__hash_8h.html @@ -0,0 +1,311 @@ + + + + + + + +liblzma (XZ Utils): lzma/index_hash.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
index_hash.h File Reference
+
+
+ +

Validate Index by using a hash function. +More...

+ + + + + +

+Typedefs

+typedef struct lzma_index_hash_s lzma_index_hash
 Opaque data type to hold the Index hash.
 
+ + + + + + + + + + + + + + + + +

+Functions

lzma_index_hashlzma_index_hash_init (lzma_index_hash *index_hash, const lzma_allocator *allocator) lzma_nothrow lzma_attr_warn_unused_result
 Allocate and initialize a new lzma_index_hash structure.
 
void lzma_index_hash_end (lzma_index_hash *index_hash, const lzma_allocator *allocator) lzma_nothrow
 Deallocate lzma_index_hash structure.
 
lzma_ret lzma_index_hash_append (lzma_index_hash *index_hash, lzma_vli unpadded_size, lzma_vli uncompressed_size) lzma_nothrow lzma_attr_warn_unused_result
 Add a new Record to an Index hash.
 
lzma_ret lzma_index_hash_decode (lzma_index_hash *index_hash, const uint8_t *in, size_t *in_pos, size_t in_size) lzma_nothrow lzma_attr_warn_unused_result
 Decode and validate the Index field.
 
lzma_vli lzma_index_hash_size (const lzma_index_hash *index_hash) lzma_nothrow lzma_attr_pure
 Get the size of the Index field as bytes.
 
+

Detailed Description

+

Validate Index by using a hash function.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Hashing makes it possible to use constant amount of memory to validate Index of arbitrary size.

+

Function Documentation

+ +

◆ lzma_index_hash_init()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_index_hash * lzma_index_hash_init (lzma_index_hashindex_hash,
const lzma_allocatorallocator 
)
+
+ +

Allocate and initialize a new lzma_index_hash structure.

+

If index_hash is NULL, this function allocates and initializes a new lzma_index_hash structure and returns a pointer to it. If allocation fails, NULL is returned.

+

If index_hash is non-NULL, this function reinitializes the lzma_index_hash structure and returns the same pointer. In this case, return value cannot be NULL or a different pointer than the index_hash that was given as an argument.

+
Parameters
+ + + +
index_hashPointer to a lzma_index_hash structure or NULL.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+
Returns
Initialized lzma_index_hash structure on success or NULL on failure.
+ +
+
+ +

◆ lzma_index_hash_end()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void lzma_index_hash_end (lzma_index_hashindex_hash,
const lzma_allocatorallocator 
)
+
+ +

Deallocate lzma_index_hash structure.

+
Parameters
+ + + +
index_hashPointer to a lzma_index_hash structure to free.
allocatorlzma_allocator for custom allocator functions. Set to NULL to use malloc() and free().
+
+
+ +
+
+ +

◆ lzma_index_hash_append()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_hash_append (lzma_index_hashindex_hash,
lzma_vli unpadded_size,
lzma_vli uncompressed_size 
)
+
+ +

Add a new Record to an Index hash.

+
Parameters
+ + + + +
index_hashPointer to a lzma_index_hash structure
unpadded_sizeUnpadded Size of a Block
uncompressed_sizeUncompressed Size of a Block
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK
  • +
  • LZMA_DATA_ERROR: Compressed or uncompressed size of the Stream or size of the Index field would grow too big.
  • +
  • LZMA_PROG_ERROR: Invalid arguments or this function is being used when lzma_index_hash_decode() has already been used.
  • +
+
+ +
+
+ +

◆ lzma_index_hash_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_index_hash_decode (lzma_index_hashindex_hash,
const uint8_t * in,
size_t * in_pos,
size_t in_size 
)
+
+ +

Decode and validate the Index field.

+

After telling the sizes of all Blocks with lzma_index_hash_append(), the actual Index field is decoded with this function. Specifically, once decoding of the Index field has been started, no more Records can be added using lzma_index_hash_append().

+

This function doesn't use lzma_stream structure to pass the input data. Instead, the input buffer is specified using three arguments. This is because it matches better the internal APIs of liblzma.

+
Parameters
+ + + + + +
index_hashPointer to a lzma_index_hash structure
inPointer to the beginning of the input buffer
[out]in_posin[*in_pos] is the next byte to process
in_sizein[in_size] is the first byte not to process
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: So far good, but more input is needed.
  • +
  • LZMA_STREAM_END: Index decoded successfully and it matches the Records given with lzma_index_hash_append().
  • +
  • LZMA_DATA_ERROR: Index is corrupt or doesn't match the information given with lzma_index_hash_append().
  • +
  • LZMA_BUF_ERROR: Cannot progress because *in_pos >= in_size.
  • +
  • LZMA_PROG_ERROR
  • +
+
+ +
+
+ +

◆ lzma_index_hash_size()

+ +
+
+ + + + + + + + +
lzma_vli lzma_index_hash_size (const lzma_index_hashindex_hash)
+
+ +

Get the size of the Index field as bytes.

+

This is needed to verify the Backward Size field in the Stream Footer.

+
Parameters
+ + +
index_hashPointer to a lzma_index_hash structure
+
+
+
Returns
Size of the Index field in bytes.
+ +
+
+
+ + + + diff --git a/doc/api/lzma12_8h.html b/doc/api/lzma12_8h.html new file mode 100644 index 0000000..1d8330c --- /dev/null +++ b/doc/api/lzma12_8h.html @@ -0,0 +1,436 @@ + + + + + + + +liblzma (XZ Utils): lzma/lzma12.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
lzma12.h File Reference
+
+
+ +

LZMA1 and LZMA2 filters. +More...

+ + + + + +

+Data Structures

struct  lzma_options_lzma
 Options specific to the LZMA1 and LZMA2 filters. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define LZMA_FILTER_LZMA1   LZMA_VLI_C(0x4000000000000001)
 LZMA1 Filter ID (for raw encoder/decoder only, not in .xz)
 
#define LZMA_FILTER_LZMA1EXT   LZMA_VLI_C(0x4000000000000002)
 LZMA1 Filter ID with extended options (for raw encoder/decoder)
 
#define LZMA_FILTER_LZMA2   LZMA_VLI_C(0x21)
 LZMA2 Filter ID.
 
+#define LZMA_DICT_SIZE_MIN   UINT32_C(4096)
 
+#define LZMA_DICT_SIZE_DEFAULT   (UINT32_C(1) << 23)
 
+#define LZMA_LCLP_MIN   0
 
+#define LZMA_LCLP_MAX   4
 
+#define LZMA_LC_DEFAULT   3
 
+#define LZMA_LP_DEFAULT   0
 
+#define LZMA_PB_MIN   0
 
+#define LZMA_PB_MAX   4
 
+#define LZMA_PB_DEFAULT   2
 
+#define LZMA_LZMA1EXT_ALLOW_EOPM   UINT32_C(0x01)
 
#define lzma_set_ext_size(opt_lzma2, u64size)
 Macro to set the 64-bit uncompressed size in ext_size_*.
 
+ + + + + + + +

+Enumerations

enum  lzma_match_finder {
+  LZMA_MF_HC3 = 0x03 +, LZMA_MF_HC4 = 0x04 +, LZMA_MF_BT2 = 0x12 +, LZMA_MF_BT3 = 0x13 +,
+  LZMA_MF_BT4 = 0x14 +
+ }
 Match finders. More...
 
enum  lzma_mode { LZMA_MODE_FAST = 1 +, LZMA_MODE_NORMAL = 2 + }
 Compression modes. More...
 
+ + + + + + + + + + +

+Functions

lzma_bool lzma_mf_is_supported (lzma_match_finder match_finder) lzma_nothrow lzma_attr_const
 Test if given match finder is supported.
 
lzma_bool lzma_mode_is_supported (lzma_mode mode) lzma_nothrow lzma_attr_const
 Test if given compression mode is supported.
 
lzma_bool lzma_lzma_preset (lzma_options_lzma *options, uint32_t preset) lzma_nothrow
 Set a compression preset to lzma_options_lzma structure.
 
+

Detailed Description

+

LZMA1 and LZMA2 filters.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ LZMA_FILTER_LZMA1

+ +
+
+ + + + +
#define LZMA_FILTER_LZMA1   LZMA_VLI_C(0x4000000000000001)
+
+ +

LZMA1 Filter ID (for raw encoder/decoder only, not in .xz)

+

LZMA1 is the very same thing as what was called just LZMA in LZMA Utils, 7-Zip, and LZMA SDK. It's called LZMA1 here to prevent developers from accidentally using LZMA when they actually want LZMA2.

+ +
+
+ +

◆ LZMA_FILTER_LZMA1EXT

+ +
+
+ + + + +
#define LZMA_FILTER_LZMA1EXT   LZMA_VLI_C(0x4000000000000002)
+
+ +

LZMA1 Filter ID with extended options (for raw encoder/decoder)

+

This is like LZMA_FILTER_LZMA1 but with this ID a few extra options are supported in the lzma_options_lzma structure:

+
    +
  • A flag to tell the encoder if the end of payload marker (EOPM) alias end of stream (EOS) marker must be written at the end of the stream. In contrast, LZMA_FILTER_LZMA1 always writes the end marker.
  • +
  • Decoder needs to be told the uncompressed size of the stream or that it is unknown (using the special value UINT64_MAX). If the size is known, a flag can be set to allow the presence of the end marker anyway. In contrast, LZMA_FILTER_LZMA1 always behaves as if the uncompressed size was unknown.
  • +
+

This allows handling file formats where LZMA1 streams are used but where the end marker isn't allowed or where it might not (always) be present. This extended LZMA1 functionality is provided as a Filter ID for raw encoder and decoder instead of adding new encoder and decoder initialization functions because this way it is possible to also use extra filters, for example, LZMA_FILTER_X86 in a filter chain with LZMA_FILTER_LZMA1EXT, which might be needed to handle some file formats.

+ +
+
+ +

◆ LZMA_FILTER_LZMA2

+ +
+
+ + + + +
#define LZMA_FILTER_LZMA2   LZMA_VLI_C(0x21)
+
+ +

LZMA2 Filter ID.

+

Usually you want this instead of LZMA1. Compared to LZMA1, LZMA2 adds support for LZMA_SYNC_FLUSH, uncompressed chunks (smaller expansion when trying to compress incompressible data), possibility to change lc/lp/pb in the middle of encoding, and some other internal improvements.

+ +
+
+ +

◆ lzma_set_ext_size

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define lzma_set_ext_size( opt_lzma2,
 u64size 
)
+
+Value:
do { \
+
(opt_lzma2).ext_size_low = (uint32_t)(u64size); \
+
(opt_lzma2).ext_size_high = (uint32_t)((uint64_t)(u64size) >> 32); \
+
} while (0)
+
+

Macro to set the 64-bit uncompressed size in ext_size_*.

+

This might be convenient when decoding using LZMA_FILTER_LZMA1EXT. This isn't used with LZMA_FILTER_LZMA1 or LZMA_FILTER_LZMA2.

+ +
+
+

Enumeration Type Documentation

+ +

◆ lzma_match_finder

+ +
+
+ + + + +
enum lzma_match_finder
+
+ +

Match finders.

+

Match finder has major effect on both speed and compression ratio. Usually hash chains are faster than binary trees.

+

If you will use LZMA_SYNC_FLUSH often, the hash chains may be a better choice, because binary trees get much higher compression ratio penalty with LZMA_SYNC_FLUSH.

+

The memory usage formulas are only rough estimates, which are closest to reality when dict_size is a power of two. The formulas are more complex in reality, and can also change a little between liblzma versions. Use lzma_raw_encoder_memusage() to get more accurate estimate of memory usage.

+ + + + + + +
Enumerator
LZMA_MF_HC3 

Hash Chain with 2- and 3-byte hashing.

+

Minimum nice_len: 3

+

Memory usage:

    +
  • dict_size <= 16 MiB: dict_size * 7.5
  • +
  • dict_size > 16 MiB: dict_size * 5.5 + 64 MiB
  • +
+
LZMA_MF_HC4 

Hash Chain with 2-, 3-, and 4-byte hashing.

+

Minimum nice_len: 4

+

Memory usage:

    +
  • dict_size <= 32 MiB: dict_size * 7.5
  • +
  • dict_size > 32 MiB: dict_size * 6.5
  • +
+
LZMA_MF_BT2 

Binary Tree with 2-byte hashing.

+

Minimum nice_len: 2

+

Memory usage: dict_size * 9.5

+
LZMA_MF_BT3 

Binary Tree with 2- and 3-byte hashing.

+

Minimum nice_len: 3

+

Memory usage:

    +
  • dict_size <= 16 MiB: dict_size * 11.5
  • +
  • dict_size > 16 MiB: dict_size * 9.5 + 64 MiB
  • +
+
LZMA_MF_BT4 

Binary Tree with 2-, 3-, and 4-byte hashing.

+

Minimum nice_len: 4

+

Memory usage:

    +
  • dict_size <= 32 MiB: dict_size * 11.5
  • +
  • dict_size > 32 MiB: dict_size * 10.5
  • +
+
+ +
+
+ +

◆ lzma_mode

+ +
+
+ + + + +
enum lzma_mode
+
+ +

Compression modes.

+

This selects the function used to analyze the data produced by the match finder.

+ + + +
Enumerator
LZMA_MODE_FAST 

Fast compression.

+

Fast mode is usually at its best when combined with a hash chain match finder.

+
LZMA_MODE_NORMAL 

Normal compression.

+

This is usually notably slower than fast mode. Use this together with binary tree match finders to expose the full potential of the LZMA1 or LZMA2 encoder.

+
+ +
+
+

Function Documentation

+ +

◆ lzma_mf_is_supported()

+ +
+
+ + + + + + + + +
lzma_bool lzma_mf_is_supported (lzma_match_finder match_finder) const
+
+ +

Test if given match finder is supported.

+

It is safe to call this with a value that isn't listed in lzma_match_finder enumeration; the return value will be false.

+

There is no way to list which match finders are available in this particular liblzma version and build. It would be useless, because a new match finder, which the application developer wasn't aware, could require giving additional options to the encoder that the older match finders don't need.

+
Parameters
+ + +
match_finderMatch finder ID
+
+
+
Returns
lzma_bool:
    +
  • true if the match finder is supported by this liblzma build.
  • +
  • false otherwise.
  • +
+
+ +
+
+ +

◆ lzma_mode_is_supported()

+ +
+
+ + + + + + + + +
lzma_bool lzma_mode_is_supported (lzma_mode mode) const
+
+ +

Test if given compression mode is supported.

+

It is safe to call this with a value that isn't listed in lzma_mode enumeration; the return value will be false.

+

There is no way to list which modes are available in this particular liblzma version and build. It would be useless, because a new compression mode, which the application developer wasn't aware, could require giving additional options to the encoder that the older modes don't need.

+
Parameters
+ + +
modeMode ID.
+
+
+
Returns
lzma_bool:
    +
  • true if the compression mode is supported by this liblzma build.
  • +
  • false otherwise.
  • +
+
+ +
+
+ +

◆ lzma_lzma_preset()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_bool lzma_lzma_preset (lzma_options_lzmaoptions,
uint32_t preset 
)
+
+ +

Set a compression preset to lzma_options_lzma structure.

+

0 is the fastest and 9 is the slowest. These match the switches -0 .. -9 of the xz command line tool. In addition, it is possible to bitwise-or flags to the preset. Currently only LZMA_PRESET_EXTREME is supported. The flags are defined in container.h, because the flags are used also with lzma_easy_encoder().

+

The preset levels are subject to changes between liblzma versions.

+

This function is available only if LZMA1 or LZMA2 encoder has been enabled when building liblzma.

+

If features (like certain match finders) have been disabled at build time, then the function may return success (false) even though the resulting LZMA1/LZMA2 options may not be usable for encoder initialization (LZMA_OPTIONS_ERROR).

+
Parameters
+ + + +
[out]optionsPointer to LZMA1 or LZMA2 options to be filled
presetPreset level bitwse-ORed with preset flags
+
+
+
Returns
lzma_bool:
    +
  • true if the preset is not supported (failure).
  • +
  • false otherwise (success).
  • +
+
+ +
+
+
+ + + + diff --git a/doc/api/lzma_8h.html b/doc/api/lzma_8h.html new file mode 100644 index 0000000..ec417c6 --- /dev/null +++ b/doc/api/lzma_8h.html @@ -0,0 +1,109 @@ + + + + + + + +liblzma (XZ Utils): lzma.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma.h File Reference
+
+
+ +

The public API of liblzma data compression library. +More...

+
#include <stddef.h>
+#include <inttypes.h>
+#include <limits.h>
+#include "lzma/version.h"
+#include "lzma/base.h"
+#include "lzma/vli.h"
+#include "lzma/check.h"
+#include "lzma/filter.h"
+#include "lzma/bcj.h"
+#include "lzma/delta.h"
+#include "lzma/lzma12.h"
+#include "lzma/container.h"
+#include "lzma/stream_flags.h"
+#include "lzma/block.h"
+#include "lzma/index.h"
+#include "lzma/index_hash.h"
+#include "lzma/hardware.h"
+
+ + + + + + + + + + + + + + + + + + + +

+Macros

+#define UINT32_C(n)   n ## U
 
+#define UINT64_C(n)   n ## UL
 
+#define UINT32_MAX   (UINT32_C(4294967295))
 
+#define UINT64_MAX   (UINT64_C(18446744073709551615))
 
+#define lzma_nothrow
 
+#define lzma_attr_pure   lzma_attribute((__pure__))
 
+#define lzma_attr_const   lzma_attribute((__const__))
 
+#define lzma_attr_warn_unused_result    lzma_attribute((__warn_unused_result__))
 
+#define LZMA_H_INTERNAL   1
 
+

Detailed Description

+

The public API of liblzma data compression library.

+
+ + + + diff --git a/doc/api/nav_f.png b/doc/api/nav_f.png new file mode 100644 index 0000000..113913e Binary files /dev/null and b/doc/api/nav_f.png differ diff --git a/doc/api/nav_fd.png b/doc/api/nav_fd.png new file mode 100644 index 0000000..978df01 Binary files /dev/null and b/doc/api/nav_fd.png differ diff --git a/doc/api/nav_g.png b/doc/api/nav_g.png new file mode 100644 index 0000000..2093a23 Binary files /dev/null and b/doc/api/nav_g.png differ diff --git a/doc/api/nav_h.png b/doc/api/nav_h.png new file mode 100644 index 0000000..4e34efd Binary files /dev/null and b/doc/api/nav_h.png differ diff --git a/doc/api/nav_hd.png b/doc/api/nav_hd.png new file mode 100644 index 0000000..b717d93 Binary files /dev/null and b/doc/api/nav_hd.png differ diff --git a/doc/api/open.png b/doc/api/open.png new file mode 100644 index 0000000..b4e49d8 Binary files /dev/null and b/doc/api/open.png differ diff --git a/doc/api/splitbar.png b/doc/api/splitbar.png new file mode 100644 index 0000000..ee781cf Binary files /dev/null and b/doc/api/splitbar.png differ diff --git a/doc/api/splitbard.png b/doc/api/splitbard.png new file mode 100644 index 0000000..aa4d029 Binary files /dev/null and b/doc/api/splitbard.png differ diff --git a/doc/api/stream__flags_8h.html b/doc/api/stream__flags_8h.html new file mode 100644 index 0000000..5cc0df9 --- /dev/null +++ b/doc/api/stream__flags_8h.html @@ -0,0 +1,348 @@ + + + + + + + +liblzma (XZ Utils): lzma/stream_flags.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
stream_flags.h File Reference
+
+
+ +

.xz Stream Header and Stream Footer encoder and decoder +More...

+ + + + + +

+Data Structures

struct  lzma_stream_flags
 Options for encoding/decoding Stream Header and Stream Footer. More...
 
+ + + + + + + + + + +

+Macros

#define LZMA_STREAM_HEADER_SIZE   12
 Size of Stream Header and Stream Footer.
 
+#define LZMA_BACKWARD_SIZE_MIN   4
 Minimum value for lzma_stream_flags.backward_size.
 
+#define LZMA_BACKWARD_SIZE_MAX   (LZMA_VLI_C(1) << 34)
 Maximum value for lzma_stream_flags.backward_size.
 
+ + + + + + + + + + + + + + + + +

+Functions

lzma_ret lzma_stream_header_encode (const lzma_stream_flags *options, uint8_t *out) lzma_nothrow lzma_attr_warn_unused_result
 Encode Stream Header.
 
lzma_ret lzma_stream_footer_encode (const lzma_stream_flags *options, uint8_t *out) lzma_nothrow lzma_attr_warn_unused_result
 Encode Stream Footer.
 
lzma_ret lzma_stream_header_decode (lzma_stream_flags *options, const uint8_t *in) lzma_nothrow lzma_attr_warn_unused_result
 Decode Stream Header.
 
lzma_ret lzma_stream_footer_decode (lzma_stream_flags *options, const uint8_t *in) lzma_nothrow lzma_attr_warn_unused_result
 Decode Stream Footer.
 
lzma_ret lzma_stream_flags_compare (const lzma_stream_flags *a, const lzma_stream_flags *b) lzma_nothrow lzma_attr_pure
 Compare two lzma_stream_flags structures.
 
+

Detailed Description

+

.xz Stream Header and Stream Footer encoder and decoder

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ LZMA_STREAM_HEADER_SIZE

+ +
+
+ + + + +
#define LZMA_STREAM_HEADER_SIZE   12
+
+ +

Size of Stream Header and Stream Footer.

+

Stream Header and Stream Footer have the same size and they are not going to change even if a newer version of the .xz file format is developed in future.

+ +
+
+

Function Documentation

+ +

◆ lzma_stream_header_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_header_encode (const lzma_stream_flagsoptions,
uint8_t * out 
)
+
+ +

Encode Stream Header.

+
Parameters
+ + + +
optionsStream Header options to be encoded. options->backward_size is ignored and doesn't need to be initialized.
[out]outBeginning of the output buffer of LZMA_STREAM_HEADER_SIZE bytes.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_OPTIONS_ERROR: options->version is not supported by this liblzma version.
  • +
  • LZMA_PROG_ERROR: Invalid options.
  • +
+
+ +
+
+ +

◆ lzma_stream_footer_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_footer_encode (const lzma_stream_flagsoptions,
uint8_t * out 
)
+
+ +

Encode Stream Footer.

+
Parameters
+ + + +
optionsStream Footer options to be encoded.
[out]outBeginning of the output buffer of LZMA_STREAM_HEADER_SIZE bytes.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Encoding was successful.
  • +
  • LZMA_OPTIONS_ERROR: options->version is not supported by this liblzma version.
  • +
  • LZMA_PROG_ERROR: Invalid options.
  • +
+
+ +
+
+ +

◆ lzma_stream_header_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_header_decode (lzma_stream_flagsoptions,
const uint8_t * in 
)
+
+ +

Decode Stream Header.

+

options->backward_size is always set to LZMA_VLI_UNKNOWN. This is to help comparing Stream Flags from Stream Header and Stream Footer with lzma_stream_flags_compare().

+
Note
When decoding .xz files that contain multiple Streams, it may make sense to print "file format not recognized" only if decoding of the Stream Header of the first Stream gives LZMA_FORMAT_ERROR. If non-first Stream Header gives LZMA_FORMAT_ERROR, the message used for LZMA_DATA_ERROR is probably more appropriate. For example, the Stream decoder in liblzma uses LZMA_DATA_ERROR if LZMA_FORMAT_ERROR is returned by lzma_stream_header_decode() when decoding non-first Stream.
+
Parameters
+ + + +
[out]optionsTarget for the decoded Stream Header options.
inBeginning of the input buffer of LZMA_STREAM_HEADER_SIZE bytes.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Decoding was successful.
  • +
  • LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given buffer cannot be Stream Header.
  • +
  • LZMA_DATA_ERROR: CRC32 doesn't match, thus the header is corrupt.
  • +
  • LZMA_OPTIONS_ERROR: Unsupported options are present in the header.
  • +
+
+ +
+
+ +

◆ lzma_stream_footer_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_footer_decode (lzma_stream_flagsoptions,
const uint8_t * in 
)
+
+ +

Decode Stream Footer.

+
Note
If Stream Header was already decoded successfully, but decoding Stream Footer returns LZMA_FORMAT_ERROR, the application should probably report some other error message than "file format not recognized". The file likely is corrupt (possibly truncated). The Stream decoder in liblzma uses LZMA_DATA_ERROR in this situation.
+
Parameters
+ + + +
[out]optionsTarget for the decoded Stream Footer options.
inBeginning of the input buffer of LZMA_STREAM_HEADER_SIZE bytes.
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Decoding was successful.
  • +
  • LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given buffer cannot be Stream Footer.
  • +
  • LZMA_DATA_ERROR: CRC32 doesn't match, thus the Stream Footer is corrupt.
  • +
  • LZMA_OPTIONS_ERROR: Unsupported options are present in Stream Footer.
  • +
+
+ +
+
+ +

◆ lzma_stream_flags_compare()

+ +
+
+ + + + + + + + + + + + + + + + + + +
lzma_ret lzma_stream_flags_compare (const lzma_stream_flagsa,
const lzma_stream_flagsb 
)
+
+ +

Compare two lzma_stream_flags structures.

+

backward_size values are compared only if both are not LZMA_VLI_UNKNOWN.

+
Parameters
+ + + +
aPointer to lzma_stream_flags structure
bPointer to lzma_stream_flags structure
+
+
+
Returns
Possible lzma_ret values:
    +
  • LZMA_OK: Both are equal. If either had backward_size set to LZMA_VLI_UNKNOWN, backward_size values were not compared or validated.
  • +
  • LZMA_DATA_ERROR: The structures differ.
  • +
  • LZMA_OPTIONS_ERROR: version in either structure is greater than the maximum supported version (currently zero).
  • +
  • LZMA_PROG_ERROR: Invalid value, e.g. invalid check or backward_size.
  • +
+
+ +
+
+
+ + + + diff --git a/doc/api/structlzma__allocator.html b/doc/api/structlzma__allocator.html new file mode 100644 index 0000000..593647b --- /dev/null +++ b/doc/api/structlzma__allocator.html @@ -0,0 +1,153 @@ + + + + + + + +liblzma (XZ Utils): lzma_allocator Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_allocator Struct Reference
+
+
+ +

Custom functions for memory handling. + More...

+ +

#include <base.h>

+ + + + + + + + + + + +

+Data Fields

void *(* alloc )(void *opaque, size_t nmemb, size_t size)
 Pointer to a custom memory allocation function.
 
void(* free )(void *opaque, void *ptr)
 Pointer to a custom memory freeing function.
 
void * opaque
 Pointer passed to .alloc() and .free()
 
+

Detailed Description

+

Custom functions for memory handling.

+

A pointer to lzma_allocator may be passed via lzma_stream structure to liblzma, and some advanced functions take a pointer to lzma_allocator as a separate function argument. The library will use the functions specified in lzma_allocator for memory handling instead of the default malloc() and free(). C++ users should note that the custom memory handling functions must not throw exceptions.

+

Single-threaded mode only: liblzma doesn't make an internal copy of lzma_allocator. Thus, it is OK to change these function pointers in the middle of the coding process, but obviously it must be done carefully to make sure that the replacement `free' can deallocate memory allocated by the earlier `alloc' function(s).

+

Multithreaded mode: liblzma might internally store pointers to the lzma_allocator given via the lzma_stream structure. The application must not change the allocator pointer in lzma_stream or the contents of the pointed lzma_allocator structure until lzma_end() has been used to free the memory associated with that lzma_stream. The allocation functions might be called simultaneously from multiple threads, and thus they must be thread safe.

+

Field Documentation

+ +

◆ alloc

+ +
+
+ + + + +
void *(* lzma_allocator::alloc) (void *opaque, size_t nmemb, size_t size)
+
+ +

Pointer to a custom memory allocation function.

+

If you don't want a custom allocator, but still want custom free(), set this to NULL and liblzma will use the standard malloc().

+
Parameters
+ + + + +
opaquelzma_allocator.opaque (see below)
nmembNumber of elements like in calloc(). liblzma will always set nmemb to 1, so it is safe to ignore nmemb in a custom allocator if you like. The nmemb argument exists only for compatibility with zlib and libbzip2.
sizeSize of an element in bytes. liblzma never sets this to zero.
+
+
+
Returns
Pointer to the beginning of a memory block of `size' bytes, or NULL if allocation fails for some reason. When allocation fails, functions of liblzma return LZMA_MEM_ERROR.
+

The allocator should not waste time zeroing the allocated buffers. This is not only about speed, but also memory usage, since the operating system kernel doesn't necessarily allocate the requested memory in physical memory until it is actually used. With small input files, liblzma may actually need only a fraction of the memory that it requested for allocation.

+
Note
LZMA_MEM_ERROR is also used when the size of the allocation would be greater than SIZE_MAX. Thus, don't assume that the custom allocator must have returned NULL if some function from liblzma returns LZMA_MEM_ERROR.
+ +
+
+ +

◆ free

+ +
+
+ + + + +
void(* lzma_allocator::free) (void *opaque, void *ptr)
+
+ +

Pointer to a custom memory freeing function.

+

If you don't want a custom freeing function, but still want a custom allocator, set this to NULL and liblzma will use the standard free().

+
Parameters
+ + + +
opaquelzma_allocator.opaque (see below)
ptrPointer returned by lzma_allocator.alloc(), or when it is set to NULL, a pointer returned by the standard malloc().
+
+
+ +
+
+ +

◆ opaque

+ +
+
+ + + + +
void* lzma_allocator::opaque
+
+ +

Pointer passed to .alloc() and .free()

+

opaque is passed as the first argument to lzma_allocator.alloc() and lzma_allocator.free(). This intended to ease implementing custom memory allocation functions for use with liblzma.

+

If you don't need this, you should set this to NULL.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__block.html b/doc/api/structlzma__block.html new file mode 100644 index 0000000..69aa245 --- /dev/null +++ b/doc/api/structlzma__block.html @@ -0,0 +1,347 @@ + + + + + + + +liblzma (XZ Utils): lzma_block Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_block Struct Reference
+
+
+ +

Options for the Block and Block Header encoders and decoders. + More...

+ +

#include <block.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

uint32_t version
 Block format version.
 
uint32_t header_size
 Size of the Block Header field in bytes.
 
lzma_check check
 Type of integrity Check.
 
lzma_vli compressed_size
 Size of the Compressed Data in bytes.
 
lzma_vli uncompressed_size
 Uncompressed Size in bytes.
 
lzma_filterfilters
 Array of filters.
 
uint8_t raw_check [LZMA_CHECK_SIZE_MAX]
 Raw value stored in the Check field.
 
lzma_bool ignore_check
 A flag to Block decoder to not verify the Check field.
 
+

Detailed Description

+

Options for the Block and Block Header encoders and decoders.

+

Different Block handling functions use different parts of this structure. Some read some members, other functions write, and some do both. Only the members listed for reading need to be initialized when the specified functions are called. The members marked for writing will be assigned new values at some point either by calling the given function or by later calls to lzma_code().

+

Field Documentation

+ +

◆ version

+ +
+
+ + + + +
uint32_t lzma_block::version
+
+ +

Block format version.

+

To prevent API and ABI breakages when new features are needed, a version number is used to indicate which members in this structure are in use:

    +
  • liblzma >= 5.0.0: version = 0 is supported.
  • +
  • liblzma >= 5.1.4beta: Support for version = 1 was added, which adds the ignore_check member.
  • +
+

If version is greater than one, most Block related functions will return LZMA_OPTIONS_ERROR (lzma_block_header_decode() works with any version value).

+

Read by:

+

Written by:

+ +
+
+ +

◆ header_size

+ +
+
+ + + + +
uint32_t lzma_block::header_size
+
+
+ +

◆ check

+ +
+
+ + + + +
lzma_check lzma_block::check
+
+ +

Type of integrity Check.

+

The Check ID is not stored into the Block Header, thus its value must be provided also when decoding.

+

Read by:

+ +
+
+ +

◆ compressed_size

+ +
+
+ + + + +
lzma_vli lzma_block::compressed_size
+
+ +

Size of the Compressed Data in bytes.

+

Encoding: If this is not LZMA_VLI_UNKNOWN, Block Header encoder will store this value to the Block Header. Block encoder doesn't care about this value, but will set it once the encoding has been finished.

+

Decoding: If this is not LZMA_VLI_UNKNOWN, Block decoder will verify that the size of the Compressed Data field matches compressed_size.

+

Usually you don't know this value when encoding in streamed mode, and thus cannot write this field into the Block Header.

+

In non-streamed mode you can reserve space for this field before encoding the actual Block. After encoding the data, finish the Block by encoding the Block Header. Steps in detail:

+
    +
  • Set compressed_size to some big enough value. If you don't know better, use LZMA_VLI_MAX, but remember that bigger values take more space in Block Header.
  • +
  • Call lzma_block_header_size() to see how much space you need to reserve for the Block Header.
  • +
  • Encode the Block using lzma_block_encoder() and lzma_code(). It sets compressed_size to the correct value.
  • +
  • Use lzma_block_header_encode() to encode the Block Header. Because space was reserved in the first step, you don't need to call lzma_block_header_size() anymore, because due to reserving, header_size has to be big enough. If it is "too big", lzma_block_header_encode() will add enough Header Padding to make Block Header to match the size specified by header_size.
  • +
+

Read by:

+

Written by:

+ +
+
+ +

◆ uncompressed_size

+ +
+
+ + + + +
lzma_vli lzma_block::uncompressed_size
+
+ +

Uncompressed Size in bytes.

+

This is handled very similarly to compressed_size above.

+

uncompressed_size is needed by fewer functions than compressed_size. This is because uncompressed_size isn't needed to validate that Block stays within proper limits.

+

Read by:

+

Written by:

+ +
+
+ +

◆ filters

+ +
+
+ + + + +
lzma_filter* lzma_block::filters
+
+ +

Array of filters.

+

There can be 1-4 filters. The end of the array is marked with .id = LZMA_VLI_UNKNOWN.

+

Read by:

+

Written by:

    +
  • lzma_block_header_decode(): Note that this does NOT free() the old filter options structures. All unused filters[] will have .id == LZMA_VLI_UNKNOWN and .options == NULL. If decoding fails, all filters[] are guaranteed to be LZMA_VLI_UNKNOWN and NULL.
  • +
+
Note
Because of the array is terminated with .id = LZMA_VLI_UNKNOWN, the actual array must have LZMA_FILTERS_MAX + 1 members or the Block Header decoder will overflow the buffer.
+ +
+
+ +

◆ raw_check

+ +
+
+ + + + +
uint8_t lzma_block::raw_check[LZMA_CHECK_SIZE_MAX]
+
+ +

Raw value stored in the Check field.

+

After successful coding, the first lzma_check_size(check) bytes of this array contain the raw value stored in the Check field.

+

Note that CRC32 and CRC64 are stored in little endian byte order. Take it into account if you display the Check values to the user.

+

Written by:

+ +
+
+ +

◆ ignore_check

+ +
+
+ + + + +
lzma_bool lzma_block::ignore_check
+
+ +

A flag to Block decoder to not verify the Check field.

+

This member is supported by liblzma >= 5.1.4beta if .version >= 1.

+

If this is set to true, the integrity check won't be calculated and verified. Unless you know what you are doing, you should leave this to false. (A reason to set this to true is when the file integrity is verified externally anyway and you want to speed up the decompression, which matters mostly when using SHA-256 as the integrity check.)

+

If .version >= 1, read by:

+

Written by (.version is ignored):

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__filter.html b/doc/api/structlzma__filter.html new file mode 100644 index 0000000..b78081c --- /dev/null +++ b/doc/api/structlzma__filter.html @@ -0,0 +1,114 @@ + + + + + + + +liblzma (XZ Utils): lzma_filter Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_filter Struct Reference
+
+
+ +

Filter options. + More...

+ +

#include <filter.h>

+ + + + + + + + +

+Data Fields

lzma_vli id
 Filter ID.
 
void * options
 Pointer to filter-specific options structure.
 
+

Detailed Description

+

Filter options.

+

This structure is used to pass a Filter ID and a pointer to the filter's options to liblzma. A few functions work with a single lzma_filter structure, while most functions expect a filter chain.

+

A filter chain is indicated with an array of lzma_filter structures. The array is terminated with .id = LZMA_VLI_UNKNOWN. Thus, the filter array must have LZMA_FILTERS_MAX + 1 elements (that is, five) to be able to hold any arbitrary filter chain. This is important when using lzma_block_header_decode() from block.h, because a filter array that is too small would make liblzma write past the end of the array.

+

Field Documentation

+ +

◆ id

+ +
+
+ + + + +
lzma_vli lzma_filter::id
+
+ +

Filter ID.

+

Use constants whose name begin with `LZMA_FILTER_' to specify different filters. In an array of lzma_filter structures, use LZMA_VLI_UNKNOWN to indicate end of filters.

+
Note
This is not an enum, because on some systems enums cannot be 64-bit.
+ +
+
+ +

◆ options

+ +
+
+ + + + +
void* lzma_filter::options
+
+ +

Pointer to filter-specific options structure.

+

If the filter doesn't need options, set this to NULL. If id is set to LZMA_VLI_UNKNOWN, options is ignored, and thus doesn't need be initialized.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__index__iter.html b/doc/api/structlzma__index__iter.html new file mode 100644 index 0000000..d75595a --- /dev/null +++ b/doc/api/structlzma__index__iter.html @@ -0,0 +1,407 @@ + + + + + + + +liblzma (XZ Utils): lzma_index_iter Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_index_iter Struct Reference
+
+
+ +

Iterator to get information about Blocks and Streams. + More...

+ +

#include <index.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

+struct { 
 
   const lzma_stream_flags *   flags 
 Pointer to Stream Flags. More...
 
   lzma_vli   number 
 Stream number in the lzma_index. More...
 
   lzma_vli   block_count 
 Number of Blocks in the Stream. More...
 
   lzma_vli   compressed_offset 
 Compressed start offset of this Stream. More...
 
   lzma_vli   uncompressed_offset 
 Uncompressed start offset of this Stream. More...
 
   lzma_vli   compressed_size 
 Compressed size of this Stream. More...
 
+   lzma_vli   uncompressed_size 
 Uncompressed size of this Stream.
 
   lzma_vli   padding 
 Size of Stream Padding after this Stream. More...
 
stream 
 
+struct { 
 
   lzma_vli   number_in_file 
 Block number in the file. More...
 
   lzma_vli   compressed_file_offset 
 Compressed start offset of this Block. More...
 
   lzma_vli   uncompressed_file_offset 
 Uncompressed start offset of this Block. More...
 
   lzma_vli   number_in_stream 
 Block number in this Stream. More...
 
   lzma_vli   compressed_stream_offset 
 Compressed start offset of this Block. More...
 
   lzma_vli   uncompressed_stream_offset 
 Uncompressed start offset of this Block. More...
 
   lzma_vli   uncompressed_size 
 Uncompressed size of this Block. More...
 
   lzma_vli   unpadded_size 
 Unpadded size of this Block. More...
 
   lzma_vli   total_size 
 Total compressed size. More...
 
block 
 
+

Detailed Description

+

Iterator to get information about Blocks and Streams.

+

Field Documentation

+ +

◆ flags

+ +
+
+ + + + +
const lzma_stream_flags* lzma_index_iter::flags
+
+ +

Pointer to Stream Flags.

+

This is NULL if Stream Flags have not been set for this Stream with lzma_index_stream_flags().

+ +
+
+ +

◆ number

+ +
+
+ + + + +
lzma_vli lzma_index_iter::number
+
+ +

Stream number in the lzma_index.

+

The first Stream is 1.

+ +
+
+ +

◆ block_count

+ +
+
+ + + + +
lzma_vli lzma_index_iter::block_count
+
+ +

Number of Blocks in the Stream.

+

If this is zero, the block structure below has undefined values.

+ +
+
+ +

◆ compressed_offset

+ +
+
+ + + + +
lzma_vli lzma_index_iter::compressed_offset
+
+ +

Compressed start offset of this Stream.

+

The offset is relative to the beginning of the lzma_index (i.e. usually the beginning of the .xz file).

+ +
+
+ +

◆ uncompressed_offset

+ +
+
+ + + + +
lzma_vli lzma_index_iter::uncompressed_offset
+
+ +

Uncompressed start offset of this Stream.

+

The offset is relative to the beginning of the lzma_index (i.e. usually the beginning of the .xz file).

+ +
+
+ +

◆ compressed_size

+ +
+
+ + + + +
lzma_vli lzma_index_iter::compressed_size
+
+ +

Compressed size of this Stream.

+

This includes all headers except the possible Stream Padding after this Stream.

+ +
+
+ +

◆ uncompressed_size

+ +
+
+ + + + +
lzma_vli lzma_index_iter::uncompressed_size
+
+ +

Uncompressed size of this Stream.

+

Uncompressed size of this Block.

+

You should pass this to the Block decoder if you will decode this Block. It will allow the Block decoder to validate the uncompressed size.

+ +
+
+ +

◆ padding

+ +
+
+ + + + +
lzma_vli lzma_index_iter::padding
+
+ +

Size of Stream Padding after this Stream.

+

If it hasn't been set with lzma_index_stream_padding(), this defaults to zero. Stream Padding is always a multiple of four bytes.

+ +
+
+ +

◆ number_in_file

+ +
+
+ + + + +
lzma_vli lzma_index_iter::number_in_file
+
+ +

Block number in the file.

+

The first Block is 1.

+ +
+
+ +

◆ compressed_file_offset

+ +
+
+ + + + +
lzma_vli lzma_index_iter::compressed_file_offset
+
+ +

Compressed start offset of this Block.

+

This offset is relative to the beginning of the lzma_index (i.e. usually the beginning of the .xz file). Normally this is where you should seek in the .xz file to start decompressing this Block.

+ +
+
+ +

◆ uncompressed_file_offset

+ +
+
+ + + + +
lzma_vli lzma_index_iter::uncompressed_file_offset
+
+ +

Uncompressed start offset of this Block.

+

This offset is relative to the beginning of the lzma_index (i.e. usually the beginning of the .xz file).

+

When doing random-access reading, it is possible that the target offset is not exactly at Block boundary. One will need to compare the target offset against uncompressed_file_offset or uncompressed_stream_offset, and possibly decode and throw away some amount of data before reaching the target offset.

+ +
+
+ +

◆ number_in_stream

+ +
+
+ + + + +
lzma_vli lzma_index_iter::number_in_stream
+
+ +

Block number in this Stream.

+

The first Block is 1.

+ +
+
+ +

◆ compressed_stream_offset

+ +
+
+ + + + +
lzma_vli lzma_index_iter::compressed_stream_offset
+
+ +

Compressed start offset of this Block.

+

This offset is relative to the beginning of the Stream containing this Block.

+ +
+
+ +

◆ uncompressed_stream_offset

+ +
+
+ + + + +
lzma_vli lzma_index_iter::uncompressed_stream_offset
+
+ +

Uncompressed start offset of this Block.

+

This offset is relative to the beginning of the Stream containing this Block.

+ +
+
+ +

◆ unpadded_size

+ +
+
+ + + + +
lzma_vli lzma_index_iter::unpadded_size
+
+ +

Unpadded size of this Block.

+

You should pass this to the Block decoder if you will decode this Block. It will allow the Block decoder to validate the unpadded size.

+ +
+
+ +

◆ total_size

+ +
+
+ + + + +
lzma_vli lzma_index_iter::total_size
+
+ +

Total compressed size.

+

This includes all headers and padding in this Block. This is useful if you need to know how many bytes the Block decoder will actually read.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__mt.html b/doc/api/structlzma__mt.html new file mode 100644 index 0000000..17a16cc --- /dev/null +++ b/doc/api/structlzma__mt.html @@ -0,0 +1,256 @@ + + + + + + + +liblzma (XZ Utils): lzma_mt Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_mt Struct Reference
+
+
+ +

Multithreading options. + More...

+ +

#include <container.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

uint32_t flags
 Flags.
 
+uint32_t threads
 Number of worker threads to use.
 
uint64_t block_size
 Encoder only: Maximum uncompressed size of a Block.
 
uint32_t timeout
 Timeout to allow lzma_code() to return early.
 
uint32_t preset
 Encoder only: Compression preset.
 
const lzma_filterfilters
 Encoder only: Filter chain (alternative to a preset)
 
lzma_check check
 Encoder only: Integrity check type.
 
uint64_t memlimit_threading
 Memory usage limit to reduce the number of threads.
 
uint64_t memlimit_stop
 Memory usage limit that should never be exceeded.
 
+

Detailed Description

+

Multithreading options.

+

Field Documentation

+ +

◆ flags

+ +
+
+ + + + +
uint32_t lzma_mt::flags
+
+ +

Flags.

+

Set this to zero if no flags are wanted.

+

Encoder: No flags are currently supported.

+

Decoder: Bitwise-or of zero or more of the decoder flags:

    +
  • LZMA_TELL_NO_CHECK
  • +
  • LZMA_TELL_UNSUPPORTED_CHECK
  • +
  • LZMA_TELL_ANY_CHECK
  • +
  • LZMA_IGNORE_CHECK
  • +
  • LZMA_CONCATENATED
  • +
  • LZMA_FAIL_FAST
  • +
+ +
+
+ +

◆ block_size

+ +
+
+ + + + +
uint64_t lzma_mt::block_size
+
+ +

Encoder only: Maximum uncompressed size of a Block.

+

The encoder will start a new .xz Block every block_size bytes. Using LZMA_FULL_FLUSH or LZMA_FULL_BARRIER with lzma_code() the caller may tell liblzma to start a new Block earlier.

+

With LZMA2, a recommended block size is 2-4 times the LZMA2 dictionary size. With very small dictionaries, it is recommended to use at least 1 MiB block size for good compression ratio, even if this is more than four times the dictionary size. Note that these are only recommendations for typical use cases; feel free to use other values. Just keep in mind that using a block size less than the LZMA2 dictionary size is waste of RAM.

+

Set this to 0 to let liblzma choose the block size depending on the compression options. For LZMA2 it will be 3*dict_size or 1 MiB, whichever is more.

+

For each thread, about 3 * block_size bytes of memory will be allocated. This may change in later liblzma versions. If so, the memory usage will probably be reduced, not increased.

+ +
+
+ +

◆ timeout

+ +
+
+ + + + +
uint32_t lzma_mt::timeout
+
+ +

Timeout to allow lzma_code() to return early.

+

Multithreading can make liblzma consume input and produce output in a very bursty way: it may first read a lot of input to fill internal buffers, then no input or output occurs for a while.

+

In single-threaded mode, lzma_code() won't return until it has either consumed all the input or filled the output buffer. If this is done in multithreaded mode, it may cause a call lzma_code() to take even tens of seconds, which isn't acceptable in all applications.

+

To avoid very long blocking times in lzma_code(), a timeout (in milliseconds) may be set here. If lzma_code() would block longer than this number of milliseconds, it will return with LZMA_OK. Reasonable values are 100 ms or more. The xz command line tool uses 300 ms.

+

If long blocking times are acceptable, set timeout to a special value of 0. This will disable the timeout mechanism and will make lzma_code() block until all the input is consumed or the output buffer has been filled.

+
Note
Even with a timeout, lzma_code() might sometimes take a long time to return. No timing guarantees are made.
+ +
+
+ +

◆ preset

+ +
+
+ + + + +
uint32_t lzma_mt::preset
+
+ +

Encoder only: Compression preset.

+

The preset is set just like with lzma_easy_encoder(). The preset is ignored if filters below is non-NULL.

+ +
+
+ +

◆ filters

+ +
+
+ + + + +
const lzma_filter* lzma_mt::filters
+
+ +

Encoder only: Filter chain (alternative to a preset)

+

If this is NULL, the preset above is used. Otherwise the preset is ignored and the filter chain specified here is used.

+ +
+
+ +

◆ check

+ +
+
+ + + + +
lzma_check lzma_mt::check
+
+ +

Encoder only: Integrity check type.

+

See check.h for available checks. The xz command line tool defaults to LZMA_CHECK_CRC64, which is a good choice if you are unsure.

+ +
+
+ +

◆ memlimit_threading

+ +
+
+ + + + +
uint64_t lzma_mt::memlimit_threading
+
+ +

Memory usage limit to reduce the number of threads.

+

Encoder: Ignored.

+

Decoder:

+

If the number of threads has been set so high that more than memlimit_threading bytes of memory would be needed, the number of threads will be reduced so that the memory usage will not exceed memlimit_threading bytes. However, if memlimit_threading cannot be met even in single-threaded mode, then decoding will continue in single-threaded mode and memlimit_threading may be exceeded even by a large amount. That is, memlimit_threading will never make lzma_code() return LZMA_MEMLIMIT_ERROR. To truly cap the memory usage, see memlimit_stop below.

+

Setting memlimit_threading to UINT64_MAX or a similar huge value means that liblzma is allowed to keep the whole compressed file and the whole uncompressed file in memory in addition to the memory needed by the decompressor data structures used by each thread! In other words, a reasonable value limit must be set here or it will cause problems sooner or later. If you have no idea what a reasonable value could be, try lzma_physmem() / 4 as a starting point. Setting this limit will never prevent decompression of a file; this will only reduce the number of threads.

+

If memlimit_threading is greater than memlimit_stop, then the value of memlimit_stop will be used for both.

+ +
+
+ +

◆ memlimit_stop

+ +
+
+ + + + +
uint64_t lzma_mt::memlimit_stop
+
+ +

Memory usage limit that should never be exceeded.

+

Encoder: Ignored.

+

Decoder: If decompressing will need more than this amount of memory even in the single-threaded mode, then lzma_code() will return LZMA_MEMLIMIT_ERROR.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__options__bcj.html b/doc/api/structlzma__options__bcj.html new file mode 100644 index 0000000..b962092 --- /dev/null +++ b/doc/api/structlzma__options__bcj.html @@ -0,0 +1,95 @@ + + + + + + + +liblzma (XZ Utils): lzma_options_bcj Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_options_bcj Struct Reference
+
+
+ +

Options for BCJ filters. + More...

+ +

#include <bcj.h>

+ + + + + +

+Data Fields

uint32_t start_offset
 Start offset for conversions.
 
+

Detailed Description

+

Options for BCJ filters.

+

The BCJ filters never change the size of the data. Specifying options for them is optional: if pointer to options is NULL, default value is used. You probably never need to specify options to BCJ filters, so just set the options pointer to NULL and be happy.

+

If options with non-default values have been specified when encoding, the same options must also be specified when decoding.

+
Note
At the moment, none of the BCJ filters support LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified, LZMA_OPTIONS_ERROR will be returned. If there is need, partial support for LZMA_SYNC_FLUSH can be added in future. Partial means that flushing would be possible only at offsets that are multiple of 2, 4, or 16 depending on the filter, except x86 which cannot be made to support LZMA_SYNC_FLUSH predictably.
+

Field Documentation

+ +

◆ start_offset

+ +
+
+ + + + +
uint32_t lzma_options_bcj::start_offset
+
+ +

Start offset for conversions.

+

This setting is useful only when the same filter is used _separately_ for multiple sections of the same executable file, and the sections contain cross-section branch/call/jump instructions. In that case it is beneficial to set the start offset of the non-first sections so that the relative addresses of the cross-section branch/call/jump instructions will use the same absolute addresses as in the first section.

+

When the pointer to options is NULL, the default value (zero) is used.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__options__delta.html b/doc/api/structlzma__options__delta.html new file mode 100644 index 0000000..294586d --- /dev/null +++ b/doc/api/structlzma__options__delta.html @@ -0,0 +1,113 @@ + + + + + + + +liblzma (XZ Utils): lzma_options_delta Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_options_delta Struct Reference
+
+
+ +

Options for the Delta filter. + More...

+ +

#include <delta.h>

+ + + + + + + +

+Data Fields

lzma_delta_type type
 
uint32_t dist
 Delta distance.
 
+

Detailed Description

+

Options for the Delta filter.

+

These options are needed by both encoder and decoder.

+

Field Documentation

+ +

◆ type

+ +
+
+ + + + +
lzma_delta_type lzma_options_delta::type
+
+

For now, this must always be LZMA_DELTA_TYPE_BYTE.

+ +
+
+ +

◆ dist

+ +
+
+ + + + +
uint32_t lzma_options_delta::dist
+
+ +

Delta distance.

+

With the only currently supported type, LZMA_DELTA_TYPE_BYTE, the distance is as bytes.

+

Examples:

    +
  • 16-bit stereo audio: distance = 4 bytes
  • +
  • 24-bit RGB image data: distance = 3 bytes
  • +
+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__options__lzma.html b/doc/api/structlzma__options__lzma.html new file mode 100644 index 0000000..f8e3adf --- /dev/null +++ b/doc/api/structlzma__options__lzma.html @@ -0,0 +1,363 @@ + + + + + + + +liblzma (XZ Utils): lzma_options_lzma Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_options_lzma Struct Reference
+
+
+ +

Options specific to the LZMA1 and LZMA2 filters. + More...

+ +

#include <lzma12.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

uint32_t dict_size
 Dictionary size in bytes.
 
const uint8_t * preset_dict
 Pointer to an initial dictionary.
 
uint32_t preset_dict_size
 Size of the preset dictionary.
 
uint32_t lc
 Number of literal context bits.
 
uint32_t lp
 Number of literal position bits.
 
uint32_t pb
 Number of position bits.
 
lzma_mode mode
 
uint32_t nice_len
 Nice length of a match.
 
lzma_match_finder mf
 
uint32_t depth
 Maximum search depth in the match finder.
 
uint32_t ext_flags
 For LZMA_FILTER_LZMA1EXT: Extended flags.
 
uint32_t ext_size_low
 For LZMA_FILTER_LZMA1EXT: Uncompressed size (low bits)
 
uint32_t ext_size_high
 For LZMA_FILTER_LZMA1EXT: Uncompressed size (high bits)
 
+

Detailed Description

+

Options specific to the LZMA1 and LZMA2 filters.

+

Since LZMA1 and LZMA2 share most of the code, it's simplest to share the options structure too. For encoding, all but the reserved variables need to be initialized unless specifically mentioned otherwise. lzma_lzma_preset() can be used to get a good starting point.

+

For raw decoding, both LZMA1 and LZMA2 need dict_size, preset_dict, and preset_dict_size (if preset_dict != NULL). LZMA1 needs also lc, lp, and pb.

+

Field Documentation

+ +

◆ dict_size

+ +
+
+ + + + +
uint32_t lzma_options_lzma::dict_size
+
+ +

Dictionary size in bytes.

+

Dictionary size indicates how many bytes of the recently processed uncompressed data is kept in memory. One method to reduce size of the uncompressed data is to store distance-length pairs, which indicate what data to repeat from the dictionary buffer. Thus, the bigger the dictionary, the better the compression ratio usually is.

+

Maximum size of the dictionary depends on multiple things:

    +
  • Memory usage limit
  • +
  • Available address space (not a problem on 64-bit systems)
  • +
  • Selected match finder (encoder only)
  • +
+

Currently the maximum dictionary size for encoding is 1.5 GiB (i.e. (UINT32_C(1) << 30) + (UINT32_C(1) << 29)) even on 64-bit systems for certain match finder implementation reasons. In the future, there may be match finders that support bigger dictionaries.

+

Decoder already supports dictionaries up to 4 GiB - 1 B (i.e. UINT32_MAX), so increasing the maximum dictionary size of the encoder won't cause problems for old decoders.

+

Because extremely small dictionaries sizes would have unneeded overhead in the decoder, the minimum dictionary size is 4096 bytes.

+
Note
When decoding, too big dictionary does no other harm than wasting memory.
+ +
+
+ +

◆ preset_dict

+ +
+
+ + + + +
const uint8_t* lzma_options_lzma::preset_dict
+
+ +

Pointer to an initial dictionary.

+

It is possible to initialize the LZ77 history window using a preset dictionary. It is useful when compressing many similar, relatively small chunks of data independently from each other. The preset dictionary should contain typical strings that occur in the files being compressed. The most probable strings should be near the end of the preset dictionary.

+

This feature should be used only in special situations. For now, it works correctly only with raw encoding and decoding. Currently none of the container formats supported by liblzma allow preset dictionary when decoding, thus if you create a .xz or .lzma file with preset dictionary, it cannot be decoded with the regular decoder functions. In the future, the .xz format will likely get support for preset dictionary though.

+ +
+
+ +

◆ preset_dict_size

+ +
+
+ + + + +
uint32_t lzma_options_lzma::preset_dict_size
+
+ +

Size of the preset dictionary.

+

Specifies the size of the preset dictionary. If the size is bigger than dict_size, only the last dict_size bytes are processed.

+

This variable is read only when preset_dict is not NULL. If preset_dict is not NULL but preset_dict_size is zero, no preset dictionary is used (identical to only setting preset_dict to NULL).

+ +
+
+ +

◆ lc

+ +
+
+ + + + +
uint32_t lzma_options_lzma::lc
+
+ +

Number of literal context bits.

+

How many of the highest bits of the previous uncompressed eight-bit byte (also known as `literal') are taken into account when predicting the bits of the next literal.

+

E.g. in typical English text, an upper-case letter is often followed by a lower-case letter, and a lower-case letter is usually followed by another lower-case letter. In the US-ASCII character set, the highest three bits are 010 for upper-case letters and 011 for lower-case letters. When lc is at least 3, the literal coding can take advantage of this property in the uncompressed data.

+

There is a limit that applies to literal context bits and literal position bits together: lc + lp <= 4. Without this limit the decoding could become very slow, which could have security related results in some cases like email servers doing virus scanning. This limit also simplifies the internal implementation in liblzma.

+

There may be LZMA1 streams that have lc + lp > 4 (maximum possible lc would be 8). It is not possible to decode such streams with liblzma.

+ +
+
+ +

◆ lp

+ +
+
+ + + + +
uint32_t lzma_options_lzma::lp
+
+ +

Number of literal position bits.

+

lp affects what kind of alignment in the uncompressed data is assumed when encoding literals. A literal is a single 8-bit byte. See pb below for more information about alignment.

+ +
+
+ +

◆ pb

+ +
+
+ + + + +
uint32_t lzma_options_lzma::pb
+
+ +

Number of position bits.

+

pb affects what kind of alignment in the uncompressed data is assumed in general. The default means four-byte alignment (2^ pb =2^2=4), which is often a good choice when there's no better guess.

+

When the alignment is known, setting pb accordingly may reduce the file size a little. E.g. with text files having one-byte alignment (US-ASCII, ISO-8859-*, UTF-8), setting pb=0 can improve compression slightly. For UTF-16 text, pb=1 is a good choice. If the alignment is an odd number like 3 bytes, pb=0 might be the best choice.

+

Even though the assumed alignment can be adjusted with pb and lp, LZMA1 and LZMA2 still slightly favor 16-byte alignment. It might be worth taking into account when designing file formats that are likely to be often compressed with LZMA1 or LZMA2.

+ +
+
+ +

◆ mode

+ +
+
+ + + + +
lzma_mode lzma_options_lzma::mode
+
+

Compression mode

+ +
+
+ +

◆ nice_len

+ +
+
+ + + + +
uint32_t lzma_options_lzma::nice_len
+
+ +

Nice length of a match.

+

This determines how many bytes the encoder compares from the match candidates when looking for the best match. Once a match of at least nice_len bytes long is found, the encoder stops looking for better candidates and encodes the match. (Naturally, if the found match is actually longer than nice_len, the actual length is encoded; it's not truncated to nice_len.)

+

Bigger values usually increase the compression ratio and compression time. For most files, 32 to 128 is a good value, which gives very good compression ratio at good speed.

+

The exact minimum value depends on the match finder. The maximum is 273, which is the maximum length of a match that LZMA1 and LZMA2 can encode.

+ +
+
+ +

◆ mf

+ +
+
+ + + + +
lzma_match_finder lzma_options_lzma::mf
+
+

Match finder ID

+ +
+
+ +

◆ depth

+ +
+
+ + + + +
uint32_t lzma_options_lzma::depth
+
+ +

Maximum search depth in the match finder.

+

For every input byte, match finder searches through the hash chain or binary tree in a loop, each iteration going one step deeper in the chain or tree. The searching stops if

    +
  • a match of at least nice_len bytes long is found;
  • +
  • all match candidates from the hash chain or binary tree have been checked; or
  • +
  • maximum search depth is reached.
  • +
+

Maximum search depth is needed to prevent the match finder from wasting too much time in case there are lots of short match candidates. On the other hand, stopping the search before all candidates have been checked can reduce compression ratio.

+

Setting depth to zero tells liblzma to use an automatic default value, that depends on the selected match finder and nice_len. The default is in the range [4, 200] or so (it may vary between liblzma versions).

+

Using a bigger depth value than the default can increase compression ratio in some cases. There is no strict maximum value, but high values (thousands or millions) should be used with care: the encoder could remain fast enough with typical input, but malicious input could cause the match finder to slow down dramatically, possibly creating a denial of service attack.

+ +
+
+ +

◆ ext_flags

+ +
+
+ + + + +
uint32_t lzma_options_lzma::ext_flags
+
+ +

For LZMA_FILTER_LZMA1EXT: Extended flags.

+

This is used only with LZMA_FILTER_LZMA1EXT.

+

Currently only one flag is supported, LZMA_LZMA1EXT_ALLOW_EOPM:

+
    +
  • Encoder: If the flag is set, then end marker is written just like it is with LZMA_FILTER_LZMA1. Without this flag the end marker isn't written and the application has to store the uncompressed size somewhere outside the compressed stream. To decompress streams without the end marker, the application has to set the correct uncompressed size in ext_size_low and ext_size_high.
  • +
  • Decoder: If the uncompressed size in ext_size_low and ext_size_high is set to the special value UINT64_MAX (indicating unknown uncompressed size) then this flag is ignored and the end marker must always be present, that is, the behavior is identical to LZMA_FILTER_LZMA1.

    +

    Otherwise, if this flag isn't set, then the input stream must not have the end marker; if the end marker is detected then it will result in LZMA_DATA_ERROR. This is useful when it is known that the stream must not have the end marker and strict validation is wanted.

    +

    If this flag is set, then it is autodetected if the end marker is present after the specified number of uncompressed bytes has been decompressed (ext_size_low and ext_size_high). The end marker isn't allowed in any other position. This behavior is useful when uncompressed size is known but the end marker may or may not be present. This is the case, for example, in .7z files (valid .7z files that have the end marker in LZMA1 streams are rare but they do exist).

    +
  • +
+ +
+
+ +

◆ ext_size_low

+ +
+
+ + + + +
uint32_t lzma_options_lzma::ext_size_low
+
+ +

For LZMA_FILTER_LZMA1EXT: Uncompressed size (low bits)

+

The 64-bit uncompressed size is needed for decompression with LZMA_FILTER_LZMA1EXT. The size is ignored by the encoder.

+

The special value UINT64_MAX indicates that the uncompressed size is unknown and that the end of payload marker (also known as end of stream marker) must be present to indicate the end of the LZMA1 stream. Any other value indicates the expected uncompressed size of the LZMA1 stream. (If LZMA1 was used together with filters that change the size of the data then the uncompressed size of the LZMA1 stream could be different than the final uncompressed size of the filtered stream.)

+

ext_size_low holds the least significant 32 bits of the uncompressed size. The most significant 32 bits must be set in ext_size_high. The macro lzma_ext_size_set(opt_lzma, u64size) can be used to set these members.

+

The 64-bit uncompressed size is split into two uint32_t variables because there were no reserved uint64_t members and using the same options structure for LZMA_FILTER_LZMA1, LZMA_FILTER_LZMA1EXT, and LZMA_FILTER_LZMA2 was otherwise more convenient than having a new options structure for LZMA_FILTER_LZMA1EXT. (Replacing two uint32_t members with one uint64_t changes the ABI on some systems as the alignment of this struct can increase from 4 bytes to 8.)

+ +
+
+ +

◆ ext_size_high

+ +
+
+ + + + +
uint32_t lzma_options_lzma::ext_size_high
+
+ +

For LZMA_FILTER_LZMA1EXT: Uncompressed size (high bits)

+

This holds the most significant 32 bits of the uncompressed size.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__stream.html b/doc/api/structlzma__stream.html new file mode 100644 index 0000000..5a0c784 --- /dev/null +++ b/doc/api/structlzma__stream.html @@ -0,0 +1,251 @@ + + + + + + + +liblzma (XZ Utils): lzma_stream Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_stream Struct Reference
+
+
+ +

Passing data to and from liblzma. + More...

+ +

#include <base.h>

+ + + + + + + + + + + + + + + + + + + + + + +

+Data Fields

const uint8_t * next_in
 
size_t avail_in
 
uint64_t total_in
 
uint8_t * next_out
 
size_t avail_out
 
uint64_t total_out
 
const lzma_allocatorallocator
 Custom memory allocation functions.
 
lzma_internalinternal
 
uint64_t seek_pos
 New seek input position for LZMA_SEEK_NEEDED.
 
+

Detailed Description

+

Passing data to and from liblzma.

+

The lzma_stream structure is used for

    +
  • passing pointers to input and output buffers to liblzma;
  • +
  • defining custom memory handler functions; and
  • +
  • holding a pointer to coder-specific internal data structures.
  • +
+

Typical usage:

+
    +
  • After allocating lzma_stream (on stack or with malloc()), it must be initialized to LZMA_STREAM_INIT (see LZMA_STREAM_INIT for details).
  • +
  • Initialize a coder to the lzma_stream, for example by using lzma_easy_encoder() or lzma_auto_decoder(). Some notes:
      +
    • In contrast to zlib, strm->next_in and strm->next_out are ignored by all initialization functions, thus it is safe to not initialize them yet.
    • +
    • The initialization functions always set strm->total_in and strm->total_out to zero.
    • +
    • If the initialization function fails, no memory is left allocated that would require freeing with lzma_end() even if some memory was associated with the lzma_stream structure when the initialization function was called.
    • +
    +
  • +
  • Use lzma_code() to do the actual work.
  • +
  • Once the coding has been finished, the existing lzma_stream can be reused. It is OK to reuse lzma_stream with different initialization function without calling lzma_end() first. Old allocations are automatically freed.
  • +
  • Finally, use lzma_end() to free the allocated memory. lzma_end() never frees the lzma_stream structure itself.
  • +
+

Application may modify the values of total_in and total_out as it wants. They are updated by liblzma to match the amount of data read and written but aren't used for anything else except as a possible return values from lzma_get_progress().

+

Field Documentation

+ +

◆ next_in

+ +
+
+ + + + +
const uint8_t* lzma_stream::next_in
+
+

Pointer to the next input byte.

+ +
+
+ +

◆ avail_in

+ +
+
+ + + + +
size_t lzma_stream::avail_in
+
+

Number of available input bytes in next_in.

+ +
+
+ +

◆ total_in

+ +
+
+ + + + +
uint64_t lzma_stream::total_in
+
+

Total number of bytes read by liblzma.

+ +
+
+ +

◆ next_out

+ +
+
+ + + + +
uint8_t* lzma_stream::next_out
+
+

Pointer to the next output position.

+ +
+
+ +

◆ avail_out

+ +
+
+ + + + +
size_t lzma_stream::avail_out
+
+

Amount of free space in next_out.

+ +
+
+ +

◆ total_out

+ +
+
+ + + + +
uint64_t lzma_stream::total_out
+
+

Total number of bytes written by liblzma.

+ +
+
+ +

◆ allocator

+ +
+
+ + + + +
const lzma_allocator* lzma_stream::allocator
+
+ +

Custom memory allocation functions.

+

In most cases this is NULL which makes liblzma use the standard malloc() and free().

+
Note
In 5.0.x this is not a const pointer.
+ +
+
+ +

◆ internal

+ +
+
+ + + + +
lzma_internal* lzma_stream::internal
+
+

Internal state is not visible to applications.

+ +
+
+ +

◆ seek_pos

+ +
+
+ + + + +
uint64_t lzma_stream::seek_pos
+
+ +

New seek input position for LZMA_SEEK_NEEDED.

+

When lzma_code() returns LZMA_SEEK_NEEDED, the new input position needed by liblzma will be available seek_pos. The value is guaranteed to not exceed the file size that was specified when this lzma_stream was initialized.

+

In all other situations the value of this variable is undefined.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/structlzma__stream__flags.html b/doc/api/structlzma__stream__flags.html new file mode 100644 index 0000000..9098ff3 --- /dev/null +++ b/doc/api/structlzma__stream__flags.html @@ -0,0 +1,134 @@ + + + + + + + +liblzma (XZ Utils): lzma_stream_flags Struct Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + +
+
+ +
lzma_stream_flags Struct Reference
+
+
+ +

Options for encoding/decoding Stream Header and Stream Footer. + More...

+ +

#include <stream_flags.h>

+ + + + + + + + + + + +

+Data Fields

uint32_t version
 Stream Flags format version.
 
lzma_vli backward_size
 Backward Size.
 
lzma_check check
 Check ID.
 
+

Detailed Description

+

Options for encoding/decoding Stream Header and Stream Footer.

+

Field Documentation

+ +

◆ version

+ +
+
+ + + + +
uint32_t lzma_stream_flags::version
+
+ +

Stream Flags format version.

+

To prevent API and ABI breakages if new features are needed in Stream Header or Stream Footer, a version number is used to indicate which members in this structure are in use. For now, version must always be zero. With non-zero version, the lzma_stream_header_encode() and lzma_stream_footer_encode() will return LZMA_OPTIONS_ERROR.

+

lzma_stream_header_decode() and lzma_stream_footer_decode() will always set this to the lowest value that supports all the features indicated by the Stream Flags field. The application must check that the version number set by the decoding functions is supported by the application. Otherwise it is possible that the application will decode the Stream incorrectly.

+ +
+
+ +

◆ backward_size

+ +
+
+ + + + +
lzma_vli lzma_stream_flags::backward_size
+
+ +

Backward Size.

+

Backward Size must be a multiple of four bytes. In this Stream format version, Backward Size is the size of the Index field.

+

Backward Size isn't actually part of the Stream Flags field, but it is convenient to include in this structure anyway. Backward Size is present only in the Stream Footer. There is no need to initialize backward_size when encoding Stream Header.

+

lzma_stream_header_decode() always sets backward_size to LZMA_VLI_UNKNOWN so that it is convenient to use lzma_stream_flags_compare() when both Stream Header and Stream Footer have been decoded.

+ +
+
+ +

◆ check

+ +
+
+ + + + +
lzma_check lzma_stream_flags::check
+
+ +

Check ID.

+

This indicates the type of the integrity check calculated from uncompressed data.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/doc/api/sync_off.png b/doc/api/sync_off.png new file mode 100644 index 0000000..9b04abe Binary files /dev/null and b/doc/api/sync_off.png differ diff --git a/doc/api/sync_on.png b/doc/api/sync_on.png new file mode 100644 index 0000000..34a5b8b Binary files /dev/null and b/doc/api/sync_on.png differ diff --git a/doc/api/tab_a.png b/doc/api/tab_a.png new file mode 100644 index 0000000..3181cdf Binary files /dev/null and b/doc/api/tab_a.png differ diff --git a/doc/api/tab_ad.png b/doc/api/tab_ad.png new file mode 100644 index 0000000..3615386 Binary files /dev/null and b/doc/api/tab_ad.png differ diff --git a/doc/api/tab_b.png b/doc/api/tab_b.png new file mode 100644 index 0000000..3feec4f Binary files /dev/null and b/doc/api/tab_b.png differ diff --git a/doc/api/tab_bd.png b/doc/api/tab_bd.png new file mode 100644 index 0000000..9fd6635 Binary files /dev/null and b/doc/api/tab_bd.png differ diff --git a/doc/api/tab_h.png b/doc/api/tab_h.png new file mode 100644 index 0000000..abb3d3d Binary files /dev/null and b/doc/api/tab_h.png differ diff --git a/doc/api/tab_hd.png b/doc/api/tab_hd.png new file mode 100644 index 0000000..c59e413 Binary files /dev/null and b/doc/api/tab_hd.png differ diff --git a/doc/api/tab_s.png b/doc/api/tab_s.png new file mode 100644 index 0000000..a3f26f5 Binary files /dev/null and b/doc/api/tab_s.png differ diff --git a/doc/api/tab_sd.png b/doc/api/tab_sd.png new file mode 100644 index 0000000..5d4917a Binary files /dev/null and b/doc/api/tab_sd.png differ diff --git a/doc/api/tabs.css b/doc/api/tabs.css new file mode 100644 index 0000000..b56f46e --- /dev/null +++ b/doc/api/tabs.css @@ -0,0 +1,62 @@ +.tabs, .tabs2, .tabs3 { + background-image: var(--nav-gradient-image); + width: 100%; + z-index: 101; + font-size: var(--nav-font-size-level1); + font-family: var(--font-family-nav); + display: table; +} + +.tabs2 { + font-size: var(--nav-font-size-level2); +} +.tabs3 { + font-size: var(--nav-font-size-level3); +} + +.tablist { + margin: 0; + padding: 0; + display: block; +} + +.tablist li { + float: left; + display: table-cell; + background-image: var(--nav-gradient-image); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:var(--nav-separator-image); + background-repeat:no-repeat; + background-position:right; + color: var(--nav-text-normal-color); + text-shadow: var(--nav-text-normal-shadow); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: var(--nav-gradient-hover-image); + background-repeat:repeat-x; + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); + text-decoration: none; +} + +.tablist li.current a { + background-image: var(--nav-gradient-active-image); + background-repeat:repeat-x; + color: var(--nav-text-active-color); + text-shadow: var(--nav-text-active-shadow); +} + diff --git a/doc/api/version_8h.html b/doc/api/version_8h.html new file mode 100644 index 0000000..fd27466 --- /dev/null +++ b/doc/api/version_8h.html @@ -0,0 +1,239 @@ + + + + + + + +liblzma (XZ Utils): lzma/version.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
version.h File Reference
+
+
+ +

Version number. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

+#define LZMA_VERSION_MAJOR   5
 Major version number of the liblzma release.
 
+#define LZMA_VERSION_MINOR   4
 Minor version number of the liblzma release.
 
+#define LZMA_VERSION_PATCH   5
 Patch version number of the liblzma release.
 
#define LZMA_VERSION_STABILITY   LZMA_VERSION_STABILITY_STABLE
 Version stability marker.
 
+#define LZMA_VERSION_COMMIT   ""
 Commit version number of the liblzma release.
 
+#define LZMA_VERSION_STABILITY_ALPHA   0
 
+#define LZMA_VERSION_STABILITY_BETA   1
 
+#define LZMA_VERSION_STABILITY_STABLE   2
 
#define LZMA_VERSION
 Compile-time version number.
 
+#define LZMA_VERSION_STABILITY_STRING   "alpha"
 
+#define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit)    #major "." #minor "." #patch stability commit
 
+#define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit)    LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit)
 
#define LZMA_VERSION_STRING
 Compile-time version as a string.
 
+ + + + + + + +

+Functions

uint32_t lzma_version_number (void) lzma_nothrow lzma_attr_const
 Run-time version number as an integer.
 
const char * lzma_version_string (void) lzma_nothrow lzma_attr_const
 Run-time version as a string.
 
+

Detailed Description

+

Version number.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

Macro Definition Documentation

+ +

◆ LZMA_VERSION_STABILITY

+ +
+
+ + + + +
#define LZMA_VERSION_STABILITY   LZMA_VERSION_STABILITY_STABLE
+
+ +

Version stability marker.

+

This will always be one of three values:

    +
  • LZMA_VERSION_STABILITY_ALPHA
  • +
  • LZMA_VERSION_STABILITY_BETA
  • +
  • LZMA_VERSION_STABILITY_STABLE
  • +
+ +
+
+ +

◆ LZMA_VERSION

+ +
+
+ + + + +
#define LZMA_VERSION
+
+Value:
(LZMA_VERSION_MAJOR * UINT32_C(10000000) \
+
+ LZMA_VERSION_MINOR * UINT32_C(10000) \
+
+ LZMA_VERSION_PATCH * UINT32_C(10) \
+ +
+

Compile-time version number.

+

The version number is of format xyyyzzzs where

    +
  • x = major
  • +
  • yyy = minor
  • +
  • zzz = revision
  • +
  • s indicates stability: 0 = alpha, 1 = beta, 2 = stable
  • +
+

The same xyyyzzz triplet is never reused with different stability levels. For example, if 5.1.0alpha has been released, there will never be 5.1.0beta or 5.1.0 stable.

+
Note
The version number of liblzma has nothing to with the version number of Igor Pavlov's LZMA SDK.
+ +
+
+ +

◆ LZMA_VERSION_STRING

+ +
+
+ + + + +
#define LZMA_VERSION_STRING
+
+Value:
LZMA_VERSION_STRING_C( \
+ +
LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \
+ +
+

Compile-time version as a string.

+

This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable versions don't have any "stable" suffix). In future, a snapshot built from source code repository may include an additional suffix, for example "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form in LZMA_VERSION macro.

+ +
+
+

Function Documentation

+ +

◆ lzma_version_number()

+ +
+
+ + + + + + + + +
uint32_t lzma_version_number (void ) const
+
+ +

Run-time version number as an integer.

+

This allows an application to compare if it was built against the same, older, or newer version of liblzma that is currently running.

+
Returns
The value of LZMA_VERSION macro at the compile time of liblzma
+ +
+
+ +

◆ lzma_version_string()

+ +
+
+ + + + + + + + +
const char * lzma_version_string (void ) const
+
+ +

Run-time version as a string.

+

This function may be useful to display which version of liblzma an application is currently using.

+
Returns
Run-time version of liblzma
+ +
+
+
+ + + + diff --git a/doc/api/vli_8h.html b/doc/api/vli_8h.html new file mode 100644 index 0000000..4e3da1f --- /dev/null +++ b/doc/api/vli_8h.html @@ -0,0 +1,323 @@ + + + + + + + +liblzma (XZ Utils): lzma/vli.h File Reference + + + + + + +
+
+ + + + + + +
+
liblzma (XZ Utils) 5.4.5 +
+
+
+ + + + + +
+
+ +
vli.h File Reference
+
+
+ +

Variable-length integer handling. +More...

+ + + + + + + + + + + + + + + + + +

+Macros

+#define LZMA_VLI_MAX   (UINT64_MAX / 2)
 Maximum supported value of a variable-length integer.
 
+#define LZMA_VLI_UNKNOWN   UINT64_MAX
 VLI value to denote that the value is unknown.
 
+#define LZMA_VLI_BYTES_MAX   9
 Maximum supported encoded length of variable length integers.
 
+#define LZMA_VLI_C(n)   UINT64_C(n)
 VLI constant suffix.
 
#define lzma_vli_is_valid(vli)    ((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN)
 Validate a variable-length integer.
 
+ + + + +

+Typedefs

typedef uint64_t lzma_vli
 Variable-length integer type.
 
+ + + + + + + + + + +

+Functions

lzma_ret lzma_vli_encode (lzma_vli vli, size_t *vli_pos, uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow
 Encode a variable-length integer.
 
lzma_ret lzma_vli_decode (lzma_vli *vli, size_t *vli_pos, const uint8_t *in, size_t *in_pos, size_t in_size) lzma_nothrow
 Decode a variable-length integer.
 
uint32_t lzma_vli_size (lzma_vli vli) lzma_nothrow lzma_attr_pure
 Get the number of bytes required to encode a VLI.
 
+

Detailed Description

+

Variable-length integer handling.

+
Note
Never include this file directly. Use <lzma.h> instead.
+

In the .xz format, most integers are encoded in a variable-length representation, which is sometimes called little endian base-128 encoding. This saves space when smaller values are more likely than bigger values.

+

The encoding scheme encodes seven bits to every byte, using minimum number of bytes required to represent the given value. Encodings that use non-minimum number of bytes are invalid, thus every integer has exactly one encoded representation. The maximum number of bits in a VLI is 63, thus the vli argument must be less than or equal to UINT64_MAX / 2. You should use LZMA_VLI_MAX for clarity.

+

Macro Definition Documentation

+ +

◆ lzma_vli_is_valid

+ +
+
+ + + + + + + + +
#define lzma_vli_is_valid( vli)    ((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN)
+
+ +

Validate a variable-length integer.

+

This is useful to test that application has given acceptable values for example in the uncompressed_size and compressed_size variables.

+
Returns
True if the integer is representable as VLI or if it indicates unknown value. False if the integer cannot be represented as VLI.
+ +
+
+

Typedef Documentation

+ +

◆ lzma_vli

+ +
+
+ + + + +
typedef uint64_t lzma_vli
+
+ +

Variable-length integer type.

+

Valid VLI values are in the range [0, LZMA_VLI_MAX]. Unknown value is indicated with LZMA_VLI_UNKNOWN, which is the maximum value of the underlying integer type.

+

lzma_vli will be uint64_t for the foreseeable future. If a bigger size is needed in the future, it is guaranteed that 2 * LZMA_VLI_MAX will not overflow lzma_vli. This simplifies integer overflow detection.

+ +
+
+

Function Documentation

+ +

◆ lzma_vli_encode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_vli_encode (lzma_vli vli,
size_t * vli_pos,
uint8_t * out,
size_t * out_pos,
size_t out_size 
)
+
+ +

Encode a variable-length integer.

+

This function has two modes: single-call and multi-call. Single-call mode encodes the whole integer at once; it is an error if the output buffer is too small. Multi-call mode saves the position in *vli_pos, and thus it is possible to continue encoding if the buffer becomes full before the whole integer has been encoded.

+
Parameters
+ + + + + + +
vliInteger to be encoded
[out]vli_posHow many VLI-encoded bytes have already been written out. When starting to encode a new integer in multi-call mode, *vli_pos must be set to zero. To use single-call encoding, set vli_pos to NULL.
[out]outBeginning of the output buffer
[out]out_posThe next byte will be written to out[*out_pos].
out_sizeSize of the out buffer; the first byte into which no data is written to is out[out_size].
+
+
+
Returns
Slightly different return values are used in multi-call and single-call modes.
+

Single-call (vli_pos == NULL):

    +
  • LZMA_OK: Integer successfully encoded.
  • +
  • LZMA_PROG_ERROR: Arguments are not sane. This can be due to too little output space; single-call mode doesn't use LZMA_BUF_ERROR, since the application should have checked the encoded size with lzma_vli_size().
  • +
+

Multi-call (vli_pos != NULL):

    +
  • LZMA_OK: So far all OK, but the integer is not completely written out yet.
  • +
  • LZMA_STREAM_END: Integer successfully encoded.
  • +
  • LZMA_BUF_ERROR: No output space was provided.
  • +
  • LZMA_PROG_ERROR: Arguments are not sane.
  • +
+ +
+
+ +

◆ lzma_vli_decode()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lzma_ret lzma_vli_decode (lzma_vlivli,
size_t * vli_pos,
const uint8_t * in,
size_t * in_pos,
size_t in_size 
)
+
+ +

Decode a variable-length integer.

+

Like lzma_vli_encode(), this function has single-call and multi-call modes.

+
Parameters
+ + + + + + +
[out]vliPointer to decoded integer. The decoder will initialize it to zero when *vli_pos == 0, so application isn't required to initialize *vli.
[out]vli_posHow many bytes have already been decoded. When starting to decode a new integer in multi-call mode, *vli_pos must be initialized to zero. To use single-call decoding, set vli_pos to NULL.
inBeginning of the input buffer
[out]in_posThe next byte will be read from in[*in_pos].
in_sizeSize of the input buffer; the first byte that won't be read is in[in_size].
+
+
+
Returns
Slightly different return values are used in multi-call and single-call modes.
+

Single-call (vli_pos == NULL):

    +
  • LZMA_OK: Integer successfully decoded.
  • +
  • LZMA_DATA_ERROR: Integer is corrupt. This includes hitting the end of the input buffer before the whole integer was decoded; providing no input at all will use LZMA_DATA_ERROR.
  • +
  • LZMA_PROG_ERROR: Arguments are not sane.
  • +
+

Multi-call (vli_pos != NULL):

    +
  • LZMA_OK: So far all OK, but the integer is not completely decoded yet.
  • +
  • LZMA_STREAM_END: Integer successfully decoded.
  • +
  • LZMA_DATA_ERROR: Integer is corrupt.
  • +
  • LZMA_BUF_ERROR: No input was provided.
  • +
  • LZMA_PROG_ERROR: Arguments are not sane.
  • +
+ +
+
+ +

◆ lzma_vli_size()

+ +
+
+ + + + + + + + +
uint32_t lzma_vli_size (lzma_vli vli)
+
+ +

Get the number of bytes required to encode a VLI.

+
Parameters
+ + +
vliInteger whose encoded size is to be determined
+
+
+
Returns
Number of bytes on success (1-9). If vli isn't valid, zero is returned.
+ +
+
+
+ + + + diff --git a/doc/examples/00_README.txt b/doc/examples/00_README.txt new file mode 100644 index 0000000..120e1eb --- /dev/null +++ b/doc/examples/00_README.txt @@ -0,0 +1,31 @@ + +liblzma example programs +======================== + +Introduction + + The examples are written so that the same comments aren't + repeated (much) in later files. + + On POSIX systems, the examples should build by just typing "make". + + The examples that use stdin or stdout don't set stdin and stdout + to binary mode. On systems where it matters (e.g. Windows) it is + possible that the examples won't work without modification. + + +List of examples + + 01_compress_easy.c Multi-call compression using + a compression preset + + 02_decompress.c Multi-call decompression + + 03_compress_custom.c Like 01_compress_easy.c but using + a custom filter chain + (x86 BCJ + LZMA2) + + 04_compress_easy_mt.c Multi-threaded multi-call + compression using a compression + preset + diff --git a/doc/examples/01_compress_easy.c b/doc/examples/01_compress_easy.c new file mode 100644 index 0000000..ec32a37 --- /dev/null +++ b/doc/examples/01_compress_easy.c @@ -0,0 +1,297 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 01_compress_easy.c +/// \brief Compress from stdin to stdout in multi-call mode +/// +/// Usage: ./01_compress_easy PRESET < INFILE > OUTFILE +/// +/// Example: ./01_compress_easy 6 < foo > foo.xz +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static void +show_usage_and_exit(const char *argv0) +{ + fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n" + "PRESET is a number 0-9 and can optionally be " + "followed by `e' to indicate extreme preset\n", + argv0); + exit(EXIT_FAILURE); +} + + +static uint32_t +get_preset(int argc, char **argv) +{ + // One argument whose first char must be 0-9. + if (argc != 2 || argv[1][0] < '0' || argv[1][0] > '9') + show_usage_and_exit(argv[0]); + + // Calculate the preste level 0-9. + uint32_t preset = argv[1][0] - '0'; + + // If there is a second char, it must be 'e'. It will set + // the LZMA_PRESET_EXTREME flag. + if (argv[1][1] != '\0') { + if (argv[1][1] != 'e' || argv[1][2] != '\0') + show_usage_and_exit(argv[0]); + + preset |= LZMA_PRESET_EXTREME; + } + + return preset; +} + + +static bool +init_encoder(lzma_stream *strm, uint32_t preset) +{ + // Initialize the encoder using a preset. Set the integrity to check + // to CRC64, which is the default in the xz command line tool. If + // the .xz file needs to be decompressed with XZ Embedded, use + // LZMA_CHECK_CRC32 instead. + lzma_ret ret = lzma_easy_encoder(strm, preset, LZMA_CHECK_CRC64); + + // Return successfully if the initialization went fine. + if (ret == LZMA_OK) + return true; + + // Something went wrong. The possible errors are documented in + // lzma/container.h (src/liblzma/api/lzma/container.h in the source + // package or e.g. /usr/include/lzma/container.h depending on the + // install prefix). + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + msg = "Specified preset is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + // This is most likely LZMA_PROG_ERROR indicating a bug in + // this program or in liblzma. It is inconvenient to have a + // separate error message for errors that should be impossible + // to occur, but knowing the error code is important for + // debugging. That's why it is good to print the error code + // at least when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + // This will be LZMA_RUN until the end of the input file is reached. + // This tells lzma_code() when there will be no more input. + lzma_action action = LZMA_RUN; + + // Buffers to temporarily hold uncompressed input + // and compressed output. + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + // Initialize the input and output pointers. Initializing next_in + // and avail_in isn't really necessary when we are going to encode + // just one file since LZMA_STREAM_INIT takes care of initializing + // those already. But it doesn't hurt much and it will be needed + // if encoding more than one file like we will in 02_decompress.c. + // + // While we don't care about strm->total_in or strm->total_out in this + // example, it is worth noting that initializing the encoder will + // always reset total_in and total_out to zero. But the encoder + // initialization doesn't touch next_in, avail_in, next_out, or + // avail_out. + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + // Loop until the file has been successfully compressed or until + // an error occurs. + while (true) { + // Fill the input buffer if it is empty. + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + // Once the end of the input file has been reached, + // we need to tell lzma_code() that no more input + // will be coming and that it should finish the + // encoding. + if (feof(infile)) + action = LZMA_FINISH; + } + + // Tell liblzma do the actual encoding. + // + // This reads up to strm->avail_in bytes of input starting + // from strm->next_in. avail_in will be decremented and + // next_in incremented by an equal amount to match the + // number of input bytes consumed. + // + // Up to strm->avail_out bytes of compressed output will be + // written starting from strm->next_out. avail_out and next_out + // will be incremented by an equal amount to match the number + // of output bytes written. + // + // The encoder has to do internal buffering, which means that + // it may take quite a bit of input before the same data is + // available in compressed form in the output buffer. + lzma_ret ret = lzma_code(strm, action); + + // If the output buffer is full or if the compression finished + // successfully, write the data from the output buffer to + // the output file. + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + // When lzma_code() has returned LZMA_STREAM_END, + // the output buffer is likely to be only partially + // full. Calculate how much new data there is to + // be written to the output file. + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + // Reset next_out and avail_out. + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + // Normally the return value of lzma_code() will be LZMA_OK + // until everything has been encoded. + if (ret != LZMA_OK) { + // Once everything has been encoded successfully, the + // return value of lzma_code() will be LZMA_STREAM_END. + // + // It is important to check for LZMA_STREAM_END. Do not + // assume that getting ret != LZMA_OK would mean that + // everything has gone well. + if (ret == LZMA_STREAM_END) + return true; + + // It's not LZMA_OK nor LZMA_STREAM_END, + // so it must be an error code. See lzma/base.h + // (src/liblzma/api/lzma/base.h in the source package + // or e.g. /usr/include/lzma/base.h depending on the + // install prefix) for the list and documentation of + // possible values. Most values listen in lzma_ret + // enumeration aren't possible in this example. + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + // This error is returned if the compressed + // or uncompressed size get near 8 EiB + // (2^63 bytes) because that's where the .xz + // file format size limits currently are. + // That is, the possibility of this error + // is mostly theoretical unless you are doing + // something very unusual. + // + // Note that strm->total_in and strm->total_out + // have nothing to do with this error. Changing + // those variables won't increase or decrease + // the chance of getting this error. + msg = "File size limits exceeded"; + break; + + default: + // This is most likely LZMA_PROG_ERROR, but + // if this program is buggy (or liblzma has + // a bug), it may be e.g. LZMA_BUF_ERROR or + // LZMA_OPTIONS_ERROR too. + // + // It is inconvenient to have a separate + // error message for errors that should be + // impossible to occur, but knowing the error + // code is important for debugging. That's why + // it is good to print the error code at least + // when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(int argc, char **argv) +{ + // Get the preset number from the command line. + uint32_t preset = get_preset(argc, argv); + + // Initialize a lzma_stream structure. When it is allocated on stack, + // it is simplest to use LZMA_STREAM_INIT macro like below. When it + // is allocated on heap, using memset(strmptr, 0, sizeof(*strmptr)) + // works (as long as NULL pointers are represented with zero bits + // as they are on practically all computers today). + lzma_stream strm = LZMA_STREAM_INIT; + + // Initialize the encoder. If it succeeds, compress from + // stdin to stdout. + bool success = init_encoder(&strm, preset); + if (success) + success = compress(&strm, stdin, stdout); + + // Free the memory allocated for the encoder. If we were encoding + // multiple files, this would only need to be done after the last + // file. See 02_decompress.c for handling of multiple files. + // + // It is OK to call lzma_end() multiple times or when it hasn't been + // actually used except initialized with LZMA_STREAM_INIT. + lzma_end(&strm); + + // Close stdout to catch possible write errors that can occur + // when pending data is flushed from the stdio buffers. + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/doc/examples/02_decompress.c b/doc/examples/02_decompress.c new file mode 100644 index 0000000..98339be --- /dev/null +++ b/doc/examples/02_decompress.c @@ -0,0 +1,287 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 02_decompress.c +/// \brief Decompress .xz files to stdout +/// +/// Usage: ./02_decompress INPUT_FILES... > OUTFILE +/// +/// Example: ./02_decompress foo.xz bar.xz > foobar +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_decoder(lzma_stream *strm) +{ + // Initialize a .xz decoder. The decoder supports a memory usage limit + // and a set of flags. + // + // The memory usage of the decompressor depends on the settings used + // to compress a .xz file. It can vary from less than a megabyte to + // a few gigabytes, but in practice (at least for now) it rarely + // exceeds 65 MiB because that's how much memory is required to + // decompress files created with "xz -9". Settings requiring more + // memory take extra effort to use and don't (at least for now) + // provide significantly better compression in most cases. + // + // Memory usage limit is useful if it is important that the + // decompressor won't consume gigabytes of memory. The need + // for limiting depends on the application. In this example, + // no memory usage limiting is used. This is done by setting + // the limit to UINT64_MAX. + // + // The .xz format allows concatenating compressed files as is: + // + // echo foo | xz > foobar.xz + // echo bar | xz >> foobar.xz + // + // When decompressing normal standalone .xz files, LZMA_CONCATENATED + // should always be used to support decompression of concatenated + // .xz files. If LZMA_CONCATENATED isn't used, the decoder will stop + // after the first .xz stream. This can be useful when .xz data has + // been embedded inside another file format. + // + // Flags other than LZMA_CONCATENATED are supported too, and can + // be combined with bitwise-or. See lzma/container.h + // (src/liblzma/api/lzma/container.h in the source package or e.g. + // /usr/include/lzma/container.h depending on the install prefix) + // for details. + lzma_ret ret = lzma_stream_decoder( + strm, UINT64_MAX, LZMA_CONCATENATED); + + // Return successfully if the initialization went fine. + if (ret == LZMA_OK) + return true; + + // Something went wrong. The possible errors are documented in + // lzma/container.h (src/liblzma/api/lzma/container.h in the source + // package or e.g. /usr/include/lzma/container.h depending on the + // install prefix). + // + // Note that LZMA_MEMLIMIT_ERROR is never possible here. If you + // specify a very tiny limit, the error will be delayed until + // the first headers have been parsed by a call to lzma_code(). + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + msg = "Unsupported decompressor flags"; + break; + + default: + // This is most likely LZMA_PROG_ERROR indicating a bug in + // this program or in liblzma. It is inconvenient to have a + // separate error message for errors that should be impossible + // to occur, but knowing the error code is important for + // debugging. That's why it is good to print the error code + // at least when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the decoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +static bool +decompress(lzma_stream *strm, const char *inname, FILE *infile, FILE *outfile) +{ + // When LZMA_CONCATENATED flag was used when initializing the decoder, + // we need to tell lzma_code() when there will be no more input. + // This is done by setting action to LZMA_FINISH instead of LZMA_RUN + // in the same way as it is done when encoding. + // + // When LZMA_CONCATENATED isn't used, there is no need to use + // LZMA_FINISH to tell when all the input has been read, but it + // is still OK to use it if you want. When LZMA_CONCATENATED isn't + // used, the decoder will stop after the first .xz stream. In that + // case some unused data may be left in strm->next_in. + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "%s: Read error: %s\n", + inname, strerror(errno)); + return false; + } + + // Once the end of the input file has been reached, + // we need to tell lzma_code() that no more input + // will be coming. As said before, this isn't required + // if the LZMA_CONCATENATED flag isn't used when + // initializing the decoder. + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + // Once everything has been decoded successfully, the + // return value of lzma_code() will be LZMA_STREAM_END. + // + // It is important to check for LZMA_STREAM_END. Do not + // assume that getting ret != LZMA_OK would mean that + // everything has gone well or that when you aren't + // getting more output it must have successfully + // decoded everything. + if (ret == LZMA_STREAM_END) + return true; + + // It's not LZMA_OK nor LZMA_STREAM_END, + // so it must be an error code. See lzma/base.h + // (src/liblzma/api/lzma/base.h in the source package + // or e.g. /usr/include/lzma/base.h depending on the + // install prefix) for the list and documentation of + // possible values. Many values listen in lzma_ret + // enumeration aren't possible in this example, but + // can be made possible by enabling memory usage limit + // or adding flags to the decoder initialization. + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_FORMAT_ERROR: + // .xz magic bytes weren't found. + msg = "The input is not in the .xz format"; + break; + + case LZMA_OPTIONS_ERROR: + // For example, the headers specify a filter + // that isn't supported by this liblzma + // version (or it hasn't been enabled when + // building liblzma, but no-one sane does + // that unless building liblzma for an + // embedded system). Upgrading to a newer + // liblzma might help. + // + // Note that it is unlikely that the file has + // accidentally became corrupt if you get this + // error. The integrity of the .xz headers is + // always verified with a CRC32, so + // unintentionally corrupt files can be + // distinguished from unsupported files. + msg = "Unsupported compression options"; + break; + + case LZMA_DATA_ERROR: + msg = "Compressed file is corrupt"; + break; + + case LZMA_BUF_ERROR: + // Typically this error means that a valid + // file has got truncated, but it might also + // be a damaged part in the file that makes + // the decoder think the file is truncated. + // If you prefer, you can use the same error + // message for this as for LZMA_DATA_ERROR. + msg = "Compressed file is truncated or " + "otherwise corrupt"; + break; + + default: + // This is most likely LZMA_PROG_ERROR. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "%s: Decoder error: " + "%s (error code %u)\n", + inname, msg, ret); + return false; + } + } +} + + +extern int +main(int argc, char **argv) +{ + if (argc <= 1) { + fprintf(stderr, "Usage: %s FILES...\n", argv[0]); + return EXIT_FAILURE; + } + + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = true; + + // Try to decompress all files. + for (int i = 1; i < argc; ++i) { + if (!init_decoder(&strm)) { + // Decoder initialization failed. There's no point + // to retry it so we need to exit. + success = false; + break; + } + + FILE *infile = fopen(argv[i], "rb"); + + if (infile == NULL) { + fprintf(stderr, "%s: Error opening the " + "input file: %s\n", + argv[i], strerror(errno)); + success = false; + } else { + success &= decompress(&strm, argv[i], infile, stdout); + fclose(infile); + } + } + + // Free the memory allocated for the decoder. This only needs to be + // done after the last file. + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/doc/examples/03_compress_custom.c b/doc/examples/03_compress_custom.c new file mode 100644 index 0000000..40c85e3 --- /dev/null +++ b/doc/examples/03_compress_custom.c @@ -0,0 +1,193 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 03_compress_custom.c +/// \brief Compress in multi-call mode using x86 BCJ and LZMA2 +/// +/// Usage: ./03_compress_custom < INFILE > OUTFILE +/// +/// Example: ./03_compress_custom < foo > foo.xz +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_encoder(lzma_stream *strm) +{ + // Use the default preset (6) for LZMA2. + // + // The lzma_options_lzma structure and the lzma_lzma_preset() function + // are declared in lzma/lzma12.h (src/liblzma/api/lzma/lzma12.h in the + // source package or e.g. /usr/include/lzma/lzma12.h depending on + // the install prefix). + lzma_options_lzma opt_lzma2; + if (lzma_lzma_preset(&opt_lzma2, LZMA_PRESET_DEFAULT)) { + // It should never fail because the default preset + // (and presets 0-9 optionally with LZMA_PRESET_EXTREME) + // are supported by all stable liblzma versions. + // + // (The encoder initialization later in this function may + // still fail due to unsupported preset *if* the features + // required by the preset have been disabled at build time, + // but no-one does such things except on embedded systems.) + fprintf(stderr, "Unsupported preset, possibly a bug\n"); + return false; + } + + // Now we could customize the LZMA2 options if we wanted. For example, + // we could set the the dictionary size (opt_lzma2.dict_size) to + // something else than the default (8 MiB) of the default preset. + // See lzma/lzma12.h for details of all LZMA2 options. + // + // The x86 BCJ filter will try to modify the x86 instruction stream so + // that LZMA2 can compress it better. The x86 BCJ filter doesn't need + // any options so it will be set to NULL below. + // + // Construct the filter chain. The uncompressed data goes first to + // the first filter in the array, in this case the x86 BCJ filter. + // The array is always terminated by setting .id = LZMA_VLI_UNKNOWN. + // + // See lzma/filter.h for more information about the lzma_filter + // structure. + lzma_filter filters[] = { + { .id = LZMA_FILTER_X86, .options = NULL }, + { .id = LZMA_FILTER_LZMA2, .options = &opt_lzma2 }, + { .id = LZMA_VLI_UNKNOWN, .options = NULL }, + }; + + // Initialize the encoder using the custom filter chain. + lzma_ret ret = lzma_stream_encoder(strm, filters, LZMA_CHECK_CRC64); + + if (ret == LZMA_OK) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + // We are no longer using a plain preset so this error + // message has been edited accordingly compared to + // 01_compress_easy.c. + msg = "Specified filter chain is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +// This function is identical to the one in 01_compress_easy.c. +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + if (ret == LZMA_STREAM_END) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + msg = "File size limits exceeded"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(void) +{ + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = init_encoder(&strm); + if (success) + success = compress(&strm, stdin, stdout); + + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/doc/examples/04_compress_easy_mt.c b/doc/examples/04_compress_easy_mt.c new file mode 100644 index 0000000..efe5697 --- /dev/null +++ b/doc/examples/04_compress_easy_mt.c @@ -0,0 +1,206 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 04_compress_easy_mt.c +/// \brief Compress in multi-call mode using LZMA2 in multi-threaded mode +/// +/// Usage: ./04_compress_easy_mt < INFILE > OUTFILE +/// +/// Example: ./04_compress_easy_mt < foo > foo.xz +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_encoder(lzma_stream *strm) +{ + // The threaded encoder takes the options as pointer to + // a lzma_mt structure. + lzma_mt mt = { + // No flags are needed. + .flags = 0, + + // Let liblzma determine a sane block size. + .block_size = 0, + + // Use no timeout for lzma_code() calls by setting timeout + // to zero. That is, sometimes lzma_code() might block for + // a long time (from several seconds to even minutes). + // If this is not OK, for example due to progress indicator + // needing updates, specify a timeout in milliseconds here. + // See the documentation of lzma_mt in lzma/container.h for + // information how to choose a reasonable timeout. + .timeout = 0, + + // Use the default preset (6) for LZMA2. + // To use a preset, filters must be set to NULL. + .preset = LZMA_PRESET_DEFAULT, + .filters = NULL, + + // Use CRC64 for integrity checking. See also + // 01_compress_easy.c about choosing the integrity check. + .check = LZMA_CHECK_CRC64, + }; + + // Detect how many threads the CPU supports. + mt.threads = lzma_cputhreads(); + + // If the number of CPU cores/threads cannot be detected, + // use one thread. Note that this isn't the same as the normal + // single-threaded mode as this will still split the data into + // blocks and use more RAM than the normal single-threaded mode. + // You may want to consider using lzma_easy_encoder() or + // lzma_stream_encoder() instead of lzma_stream_encoder_mt() if + // lzma_cputhreads() returns 0 or 1. + if (mt.threads == 0) + mt.threads = 1; + + // If the number of CPU cores/threads exceeds threads_max, + // limit the number of threads to keep memory usage lower. + // The number 8 is arbitrarily chosen and may be too low or + // high depending on the compression preset and the computer + // being used. + // + // FIXME: A better way could be to check the amount of RAM + // (or available RAM) and use lzma_stream_encoder_mt_memusage() + // to determine if the number of threads should be reduced. + const uint32_t threads_max = 8; + if (mt.threads > threads_max) + mt.threads = threads_max; + + // Initialize the threaded encoder. + lzma_ret ret = lzma_stream_encoder_mt(strm, &mt); + + if (ret == LZMA_OK) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + // We are no longer using a plain preset so this error + // message has been edited accordingly compared to + // 01_compress_easy.c. + msg = "Specified filter chain is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +// This function is identical to the one in 01_compress_easy.c. +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + if (ret == LZMA_STREAM_END) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + msg = "File size limits exceeded"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(void) +{ + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = init_encoder(&strm); + if (success) + success = compress(&strm, stdin, stdout); + + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/doc/examples/Makefile b/doc/examples/Makefile new file mode 100644 index 0000000..e8839d8 --- /dev/null +++ b/doc/examples/Makefile @@ -0,0 +1,25 @@ +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +CC = c99 +CFLAGS = -g +LDFLAGS = -llzma + +PROGS = \ + 01_compress_easy \ + 02_decompress \ + 03_compress_custom \ + 04_compress_easy_mt \ + 11_file_info + +all: $(PROGS) + +.c: + $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) + +clean: + -rm -f $(PROGS) diff --git a/doc/examples_old/xz_pipe_comp.c b/doc/examples_old/xz_pipe_comp.c new file mode 100644 index 0000000..9f9224b --- /dev/null +++ b/doc/examples_old/xz_pipe_comp.c @@ -0,0 +1,127 @@ +/* + * xz_pipe_comp.c + * A simple example of pipe-only xz compressor implementation. + * version: 2010-07-12 - by Daniel Mealha Cabrita + * Not copyrighted -- provided to the public domain. + * + * Compiling: + * Link with liblzma. GCC example: + * $ gcc -llzma xz_pipe_comp.c -o xz_pipe_comp + * + * Usage example: + * $ cat some_file | ./xz_pipe_comp > some_file.xz + */ + +#include +#include +#include +#include +#include + + +/* COMPRESSION SETTINGS */ + +/* analogous to xz CLI options: -0 to -9 */ +#define COMPRESSION_LEVEL 6 + +/* boolean setting, analogous to xz CLI option: -e */ +#define COMPRESSION_EXTREME true + +/* see: /usr/include/lzma/check.h LZMA_CHECK_* */ +#define INTEGRITY_CHECK LZMA_CHECK_CRC64 + + +/* read/write buffer sizes */ +#define IN_BUF_MAX 4096 +#define OUT_BUF_MAX 4096 + +/* error codes */ +#define RET_OK 0 +#define RET_ERROR_INIT 1 +#define RET_ERROR_INPUT 2 +#define RET_ERROR_OUTPUT 3 +#define RET_ERROR_COMPRESSION 4 + + +/* note: in_file and out_file must be open already */ +int xz_compress (FILE *in_file, FILE *out_file) +{ + uint32_t preset = COMPRESSION_LEVEL | (COMPRESSION_EXTREME ? LZMA_PRESET_EXTREME : 0); + lzma_check check = INTEGRITY_CHECK; + lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */ + uint8_t in_buf [IN_BUF_MAX]; + uint8_t out_buf [OUT_BUF_MAX]; + size_t in_len; /* length of useful data in in_buf */ + size_t out_len; /* length of useful data in out_buf */ + bool in_finished = false; + bool out_finished = false; + lzma_action action; + lzma_ret ret_xz; + int ret; + + ret = RET_OK; + + /* initialize xz encoder */ + ret_xz = lzma_easy_encoder (&strm, preset, check); + if (ret_xz != LZMA_OK) { + fprintf (stderr, "lzma_easy_encoder error: %d\n", (int) ret_xz); + return RET_ERROR_INIT; + } + + while ((! in_finished) && (! out_finished)) { + /* read incoming data */ + in_len = fread (in_buf, 1, IN_BUF_MAX, in_file); + + if (feof (in_file)) { + in_finished = true; + } + if (ferror (in_file)) { + in_finished = true; + ret = RET_ERROR_INPUT; + } + + strm.next_in = in_buf; + strm.avail_in = in_len; + + /* if no more data from in_buf, flushes the + internal xz buffers and closes the xz data + with LZMA_FINISH */ + action = in_finished ? LZMA_FINISH : LZMA_RUN; + + /* loop until there's no pending compressed output */ + do { + /* out_buf is clean at this point */ + strm.next_out = out_buf; + strm.avail_out = OUT_BUF_MAX; + + /* compress data */ + ret_xz = lzma_code (&strm, action); + + if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) { + fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz); + out_finished = true; + ret = RET_ERROR_COMPRESSION; + } else { + /* write compressed data */ + out_len = OUT_BUF_MAX - strm.avail_out; + fwrite (out_buf, 1, out_len, out_file); + if (ferror (out_file)) { + out_finished = true; + ret = RET_ERROR_OUTPUT; + } + } + } while (strm.avail_out == 0); + } + + lzma_end (&strm); + return ret; +} + +int main () +{ + int ret; + + ret = xz_compress (stdin, stdout); + return ret; +} + diff --git a/doc/examples_old/xz_pipe_decomp.c b/doc/examples_old/xz_pipe_decomp.c new file mode 100644 index 0000000..fb5ad89 --- /dev/null +++ b/doc/examples_old/xz_pipe_decomp.c @@ -0,0 +1,123 @@ +/* + * xz_pipe_decomp.c + * A simple example of pipe-only xz decompressor implementation. + * version: 2012-06-14 - by Daniel Mealha Cabrita + * Not copyrighted -- provided to the public domain. + * + * Compiling: + * Link with liblzma. GCC example: + * $ gcc -llzma xz_pipe_decomp.c -o xz_pipe_decomp + * + * Usage example: + * $ cat some_file.xz | ./xz_pipe_decomp > some_file + */ + +#include +#include +#include +#include +#include + + +/* read/write buffer sizes */ +#define IN_BUF_MAX 4096 +#define OUT_BUF_MAX 4096 + +/* error codes */ +#define RET_OK 0 +#define RET_ERROR_INIT 1 +#define RET_ERROR_INPUT 2 +#define RET_ERROR_OUTPUT 3 +#define RET_ERROR_DECOMPRESSION 4 + + +/* note: in_file and out_file must be open already */ +int xz_decompress (FILE *in_file, FILE *out_file) +{ + lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */ + const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED; + const uint64_t memory_limit = UINT64_MAX; /* no memory limit */ + uint8_t in_buf [IN_BUF_MAX]; + uint8_t out_buf [OUT_BUF_MAX]; + size_t in_len; /* length of useful data in in_buf */ + size_t out_len; /* length of useful data in out_buf */ + bool in_finished = false; + bool out_finished = false; + lzma_action action; + lzma_ret ret_xz; + int ret; + + ret = RET_OK; + + /* initialize xz decoder */ + ret_xz = lzma_stream_decoder (&strm, memory_limit, flags); + if (ret_xz != LZMA_OK) { + fprintf (stderr, "lzma_stream_decoder error: %d\n", (int) ret_xz); + return RET_ERROR_INIT; + } + + while ((! in_finished) && (! out_finished)) { + /* read incoming data */ + in_len = fread (in_buf, 1, IN_BUF_MAX, in_file); + + if (feof (in_file)) { + in_finished = true; + } + if (ferror (in_file)) { + in_finished = true; + ret = RET_ERROR_INPUT; + } + + strm.next_in = in_buf; + strm.avail_in = in_len; + + /* if no more data from in_buf, flushes the + internal xz buffers and closes the decompressed data + with LZMA_FINISH */ + action = in_finished ? LZMA_FINISH : LZMA_RUN; + + /* loop until there's no pending decompressed output */ + do { + /* out_buf is clean at this point */ + strm.next_out = out_buf; + strm.avail_out = OUT_BUF_MAX; + + /* decompress data */ + ret_xz = lzma_code (&strm, action); + + if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) { + fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz); + out_finished = true; + ret = RET_ERROR_DECOMPRESSION; + } else { + /* write decompressed data */ + out_len = OUT_BUF_MAX - strm.avail_out; + fwrite (out_buf, 1, out_len, out_file); + if (ferror (out_file)) { + out_finished = true; + ret = RET_ERROR_OUTPUT; + } + } + } while (strm.avail_out == 0); + } + + /* Bug fix (2012-06-14): If no errors were detected, check + that the last lzma_code() call returned LZMA_STREAM_END. + If not, the file is probably truncated. */ + if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) { + fprintf (stderr, "Input truncated or corrupt\n"); + ret = RET_ERROR_DECOMPRESSION; + } + + lzma_end (&strm); + return ret; +} + +int main () +{ + int ret; + + ret = xz_decompress (stdin, stdout); + return ret; +} + diff --git a/doc/faq.txt b/doc/faq.txt new file mode 100644 index 0000000..3f9068b --- /dev/null +++ b/doc/faq.txt @@ -0,0 +1,244 @@ + +XZ Utils FAQ +============ + +Q: What do the letters XZ mean? + +A: Nothing. They are just two letters, which come from the file format + suffix .xz. The .xz suffix was selected, because it seemed to be + pretty much unused. It has no deeper meaning. + + +Q: What are LZMA and LZMA2? + +A: LZMA stands for Lempel-Ziv-Markov chain-Algorithm. It is the name + of the compression algorithm designed by Igor Pavlov for 7-Zip. + LZMA is based on LZ77 and range encoding. + + LZMA2 is an updated version of the original LZMA to fix a couple of + practical issues. In context of XZ Utils, LZMA is called LZMA1 to + emphasize that LZMA is not the same thing as LZMA2. LZMA2 is the + primary compression algorithm in the .xz file format. + + +Q: There are many LZMA related projects. How does XZ Utils relate to them? + +A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly + a subset of the 7-Zip source tree. + + p7zip is 7-Zip's command-line tools ported to POSIX-like systems. + + LZMA Utils provide a gzip-like lzma tool for POSIX-like systems. + LZMA Utils are based on LZMA SDK. XZ Utils are the successor to + LZMA Utils. + + There are several other projects using LZMA. Most are more or less + based on LZMA SDK. See . + + +Q: Why is liblzma named liblzma if its primary file format is .xz? + Shouldn't it be e.g. libxz? + +A: When the designing of the .xz format began, the idea was to replace + the .lzma format and use the same .lzma suffix. It would have been + quite OK to reuse the suffix when there were very few .lzma files + around. However, the old .lzma format became popular before the + new format was finished. The new format was renamed to .xz but the + name of liblzma wasn't changed. + + +Q: Do XZ Utils support the .7z format? + +A: No. Use 7-Zip (Windows) or p7zip (POSIX-like systems) to handle .7z + files. + + +Q: I have many .tar.7z files. Can I convert them to .tar.xz without + spending hours recompressing the data? + +A: In the "extra" directory, there is a script named 7z2lzma.bash which + is able to convert some .7z files to the .lzma format (not .xz). It + needs the 7za (or 7z) command from p7zip. The script may silently + produce corrupt output if certain assumptions are not met, so + decompress the resulting .lzma file and compare it against the + original before deleting the original file! + + +Q: I have many .lzma files. Can I quickly convert them to the .xz format? + +A: For now, no. Since XZ Utils supports the .lzma format, it's usually + not too bad to keep the old files in the old format. If you want to + do the conversion anyway, you need to decompress the .lzma files and + then recompress to the .xz format. + + Technically, there is a way to make the conversion relatively fast + (roughly twice the time that normal decompression takes). Writing + such a tool would take quite a bit of time though, and would probably + be useful to only a few people. If you really want such a conversion + tool, contact Lasse Collin and offer some money. + + +Q: I have installed xz, but my tar doesn't recognize .tar.xz files. + How can I extract .tar.xz files? + +A: xz -dc foo.tar.xz | tar xf - + + +Q: Can I recover parts of a broken .xz file (e.g. a corrupted CD-R)? + +A: It may be possible if the file consists of multiple blocks, which + typically is not the case if the file was created in single-threaded + mode. There is no recovery program yet. + + +Q: Is (some part of) XZ Utils patented? + +A: Lasse Collin is not aware of any patents that could affect XZ Utils. + However, due to the nature of software patents, it's not possible to + guarantee that XZ Utils isn't affected by any third party patent(s). + + +Q: Where can I find documentation about the file format and algorithms? + +A: The .xz format is documented in xz-file-format.txt. It is a container + format only, and doesn't include descriptions of any non-trivial + filters. + + Documenting LZMA and LZMA2 is planned, but for now, there is no other + documentation than the source code. Before you begin, you should know + the basics of LZ77 and range-coding algorithms. LZMA is based on LZ77, + but LZMA is a lot more complex. Range coding is used to compress + the final bitstream like Huffman coding is used in Deflate. + + +Q: I cannot find BCJ and BCJ2 filters. Don't they exist in liblzma? + +A: BCJ filter is called "x86" in liblzma. BCJ2 is not included, + because it requires using more than one encoded output stream. + + +Q: I need to use a script that runs "xz -9". On a system with 256 MiB + of RAM, xz says that it cannot allocate memory. Can I make the + script work without modifying it? + +A: Set a default memory usage limit for compression. You can do it e.g. + in a shell initialization script such as ~/.bashrc or /etc/profile: + + XZ_DEFAULTS=--memlimit-compress=150MiB + export XZ_DEFAULTS + + xz will then scale the compression settings down so that the given + memory usage limit is not reached. This way xz shouldn't run out + of memory. + + Check also that memory-related resource limits are high enough. + On most systems, "ulimit -a" will show the current resource limits. + + +Q: How do I create files that can be decompressed with XZ Embedded? + +A: See the documentation in XZ Embedded. In short, something like + this is a good start: + + xz --check=crc32 --lzma2=preset=6e,dict=64KiB + + Or if a BCJ filter is needed too, e.g. if compressing + a kernel image for PowerPC: + + xz --check=crc32 --powerpc --lzma2=preset=6e,dict=64KiB + + Adjust the dictionary size to get a good compromise between + compression ratio and decompressor memory usage. Note that + in single-call decompression mode of XZ Embedded, a big + dictionary doesn't increase memory usage. + + +Q: How is multi-threaded compression implemented in XZ Utils? + +A: The simplest method is splitting the uncompressed data into blocks + and compressing them in parallel independent from each other. + This is currently the only threading method supported in XZ Utils. + Since the blocks are compressed independently, they can also be + decompressed independently. Together with the index feature in .xz, + this allows using threads to create .xz files for random-access + reading. This also makes threaded decompression possible. + + The independent blocks method has a couple of disadvantages too. It + will compress worse than a single-block method. Often the difference + is not too big (maybe 1-2 %) but sometimes it can be too big. Also, + the memory usage of the compressor increases linearly when adding + threads. + + At least two other threading methods are possible but these haven't + been implemented in XZ Utils: + + Match finder parallelization has been in 7-Zip for ages. It doesn't + affect compression ratio or memory usage significantly. Among the + three threading methods, only this is useful when compressing small + files (files that are not significantly bigger than the dictionary). + Unfortunately this method scales only to about two CPU cores. + + The third method is pigz-style threading (I use that name, because + pigz uses that method). It doesn't + affect compression ratio significantly and scales to many cores. + The memory usage scales linearly when threads are added. This isn't + significant with pigz, because Deflate uses only a 32 KiB dictionary, + but with LZMA2 the memory usage will increase dramatically just like + with the independent-blocks method. There is also a constant + computational overhead, which may make pigz-method a bit dull on + dual-core compared to the parallel match finder method, but with more + cores the overhead is not a big deal anymore. + + Combining the threading methods will be possible and also useful. + For example, combining match finder parallelization with pigz-style + threading or independent-blocks-threading can cut the memory usage + by 50 %. + + +Q: I told xz to use many threads but it is using only one or two + processor cores. What is wrong? + +A: Since multi-threaded compression is done by splitting the data into + blocks that are compressed individually, if the input file is too + small for the block size, then many threads cannot be used. The + default block size increases when the compression level is + increased. For example, xz -6 uses 8 MiB LZMA2 dictionary and + 24 MiB blocks, and xz -9 uses 64 MiB LZMA dictionary and 192 MiB + blocks. If the input file is 100 MiB, xz -6 can use five threads + of which one will finish quickly as it has only 4 MiB to compress. + However, for the same file, xz -9 can only use one thread. + + One can adjust block size with --block-size=SIZE but making the + block size smaller than LZMA2 dictionary is waste of RAM: using + xz -9 with 6 MiB blocks isn't any better than using xz -6 with + 6 MiB blocks. The default settings use a block size bigger than + the LZMA2 dictionary size because this was seen as a reasonable + compromise between RAM usage and compression ratio. + + When decompressing, the ability to use threads depends on how the + file was created. If it was created in multi-threaded mode then + it can be decompressed in multi-threaded mode too if there are + multiple blocks in the file. + + +Q: How do I build a program that needs liblzmadec (lzmadec.h)? + +A: liblzmadec is part of LZMA Utils. XZ Utils has liblzma, but no + liblzmadec. The code using liblzmadec should be ported to use + liblzma instead. If you cannot or don't want to do that, download + LZMA Utils from . + + +Q: The default build of liblzma is too big. How can I make it smaller? + +A: Give --enable-small to the configure script. Use also appropriate + --enable or --disable options to include only those filter encoders + and decoders and integrity checks that you actually need. Use + CFLAGS=-Os (with GCC) or equivalent to tell your compiler to optimize + for size. See INSTALL for information about configure options. + + If the result is still too big, take a look at XZ Embedded. It is + a separate project, which provides a limited but significantly + smaller XZ decoder implementation than XZ Utils. You can find it + at . + diff --git a/doc/history.txt b/doc/history.txt new file mode 100644 index 0000000..8545e23 --- /dev/null +++ b/doc/history.txt @@ -0,0 +1,150 @@ + +History of LZMA Utils and XZ Utils +================================== + +Tukaani distribution + + In 2005, there was a small group working on the Tukaani distribution, + which was a Slackware fork. One of the project's goals was to fit the + distro on a single 700 MiB ISO-9660 image. Using LZMA instead of gzip + helped a lot. Roughly speaking, one could fit data that took 1000 MiB + in gzipped form into 700 MiB with LZMA. Naturally, the compression + ratio varied across packages, but this was what we got on average. + + Slackware packages have traditionally had .tgz as the filename suffix, + which is an abbreviation of .tar.gz. A logical naming for LZMA + compressed packages was .tlz, being an abbreviation of .tar.lzma. + + At the end of the year 2007, there was no distribution under the + Tukaani project anymore, but development of LZMA Utils was kept going. + Still, there were .tlz packages around, because at least Vector Linux + (a Slackware based distribution) used LZMA for its packages. + + First versions of the modified pkgtools used the LZMA_Alone tool from + Igor Pavlov's LZMA SDK as is. It was fine, because users wouldn't need + to interact with LZMA_Alone directly. But people soon wanted to use + LZMA for other files too, and the interface of LZMA_Alone wasn't + comfortable for those used to gzip and bzip2. + + +First steps of LZMA Utils + + The first version of LZMA Utils (4.22.0) included a shell script called + lzmash. It was a wrapper that had a gzip-like command-line interface. It + used the LZMA_Alone tool from LZMA SDK to do all the real work. zgrep, + zdiff, and related scripts from gzip were adapted to work with LZMA and + were part of the first LZMA Utils release too. + + LZMA Utils 4.22.0 included also lzmadec, which was a small (less than + 10 KiB) decoder-only command-line tool. It was written on top of the + decoder-only C code found from the LZMA SDK. lzmadec was convenient in + situations where LZMA_Alone (a few hundred KiB) would be too big. + + lzmash and lzmadec were written by Lasse Collin. + + +Second generation + + The lzmash script was an ugly and not very secure hack. The last + version of LZMA Utils to use lzmash was 4.27.1. + + LZMA Utils 4.32.0beta1 introduced a new lzma command-line tool written + by Ville Koskinen. It was written in C++, and used the encoder and + decoder from C++ LZMA SDK with some little modifications. This tool + replaced both the lzmash script and the LZMA_Alone command-line tool + in LZMA Utils. + + Introducing this new tool caused some temporary incompatibilities, + because the LZMA_Alone executable was simply named lzma like the new + command-line tool, but they had a completely different command-line + interface. The file format was still the same. + + Lasse wrote liblzmadec, which was a small decoder-only library based + on the C code found from LZMA SDK. liblzmadec had an API similar to + zlib, although there were some significant differences, which made it + non-trivial to use it in some applications designed for zlib and + libbzip2. + + The lzmadec command-line tool was converted to use liblzmadec. + + Alexandre Sauvé helped converting the build system to use GNU + Autotools. This made it easier to test for certain less portable + features needed by the new command-line tool. + + Since the new command-line tool never got completely finished (for + example, it didn't support the LZMA_OPT environment variable), the + intent was to not call 4.32.x stable. Similarly, liblzmadec wasn't + polished, but appeared to work well enough, so some people started + using it too. + + Because the development of the third generation of LZMA Utils was + delayed considerably (3-4 years), the 4.32.x branch had to be kept + maintained. It got some bug fixes now and then, and finally it was + decided to call it stable, although most of the missing features were + never added. + + +File format problems + + The file format used by LZMA_Alone was primitive. It was designed with + embedded systems in mind, and thus provided only a minimal set of + features. The two biggest problems for non-embedded use were the lack + of magic bytes and an integrity check. + + Igor and Lasse started developing a new file format with some help + from Ville Koskinen. Also Mark Adler, Mikko Pouru, H. Peter Anvin, + and Lars Wirzenius helped with some minor things at some point of the + development. Designing the new format took quite a long time (actually, + too long a time would be a more appropriate expression). It was mostly + because Lasse was quite slow at getting things done due to personal + reasons. + + Originally the new format was supposed to use the same .lzma suffix + that was already used by the old file format. Switching to the new + format wouldn't have caused much trouble when the old format wasn't + used by many people. But since the development of the new format took + such a long time, the old format got quite popular, and it was decided + that the new file format must use a different suffix. + + It was decided to use .xz as the suffix of the new file format. The + first stable .xz file format specification was finally released in + December 2008. In addition to fixing the most obvious problems of + the old .lzma format, the .xz format added some new features like + support for multiple filters (compression algorithms), filter chaining + (like piping on the command line), and limited random-access reading. + + Currently the primary compression algorithm used in .xz is LZMA2. + It is an extension on top of the original LZMA to fix some practical + problems: LZMA2 adds support for flushing the encoder, uncompressed + chunks, eases stateful decoder implementations, and improves support + for multithreading. Since LZMA2 is better than the original LZMA, the + original LZMA is not supported in .xz. + + +Transition to XZ Utils + + The early versions of XZ Utils were called LZMA Utils. The first + releases were 4.42.0alphas. They dropped the rest of the C++ LZMA SDK. + The code was still directly based on LZMA SDK but ported to C and + converted from a callback API to a stateful API. Later, Igor Pavlov + made a C version of the LZMA encoder too; these ports from C++ to C + were independent in LZMA SDK and LZMA Utils. + + The core of the new LZMA Utils was liblzma, a compression library with + a zlib-like API. liblzma supported both the old and new file format. + The gzip-like lzma command-line tool was rewritten to use liblzma. + + The new LZMA Utils code base was renamed to XZ Utils when the name + of the new file format had been decided. The liblzma compression + library retained its name though, because changing it would have + caused unnecessary breakage in applications already using the early + liblzma snapshots. + + The xz command-line tool can emulate the gzip-like lzma tool by + creating appropriate symlinks (e.g. lzma -> xz). Thus, practically + all scripts using the lzma tool from LZMA Utils will work as is with + XZ Utils (and will keep using the old .lzma format). Still, the .lzma + format is more or less deprecated. XZ Utils will keep supporting it, + but new applications should use the .xz format, and migrating old + applications to .xz is often a good idea too. + diff --git a/doc/lzma-file-format.txt b/doc/lzma-file-format.txt new file mode 100644 index 0000000..4865def --- /dev/null +++ b/doc/lzma-file-format.txt @@ -0,0 +1,173 @@ + +The .lzma File Format +===================== + + 0. Preface + 0.1. Notices and Acknowledgements + 0.2. Changes + 1. File Format + 1.1. Header + 1.1.1. Properties + 1.1.2. Dictionary Size + 1.1.3. Uncompressed Size + 1.2. LZMA Compressed Data + 2. References + + +0. Preface + + This document describes the .lzma file format, which is + sometimes also called LZMA_Alone format. It is a legacy file + format, which is being or has been replaced by the .xz format. + The MIME type of the .lzma format is `application/x-lzma'. + + The most commonly used software to handle .lzma files are + LZMA SDK, LZMA Utils, 7-Zip, and XZ Utils. This document + describes some of the differences between these implementations + and gives hints what subset of the .lzma format is the most + portable. + + +0.1. Notices and Acknowledgements + + This file format was designed by Igor Pavlov for use in + LZMA SDK. This document was written by Lasse Collin + using the documentation found + from the LZMA SDK. + + This document has been put into the public domain. + + +0.2. Changes + + Last modified: 2022-07-13 21:00+0300 + + Compared to the previous version (2011-04-12 11:55+0300) + the section 1.1.3 was modified to allow End of Payload Marker + with a known Uncompressed Size. + + +1. File Format + + +-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+ + | Header | LZMA Compressed Data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+ + + The .lzma format file consist of 13-byte Header followed by + the LZMA Compressed Data. + + Unlike the .gz, .bz2, and .xz formats, it is not possible to + concatenate multiple .lzma files as is and expect the + decompression tool to decode the resulting file as if it were + a single .lzma file. + + For example, the command line tools from LZMA Utils and + LZMA SDK silently ignore all the data after the first .lzma + stream. In contrast, the command line tool from XZ Utils + considers the .lzma file to be corrupt if there is data after + the first .lzma stream. + + +1.1. Header + + +------------+----+----+----+----+--+--+--+--+--+--+--+--+ + | Properties | Dictionary Size | Uncompressed Size | + +------------+----+----+----+----+--+--+--+--+--+--+--+--+ + + +1.1.1. Properties + + The Properties field contains three properties. An abbreviation + is given in parentheses, followed by the value range of the + property. The field consists of + + 1) the number of literal context bits (lc, [0, 8]); + 2) the number of literal position bits (lp, [0, 4]); and + 3) the number of position bits (pb, [0, 4]). + + The properties are encoded using the following formula: + + Properties = (pb * 5 + lp) * 9 + lc + + The following C code illustrates a straightforward way to + decode the Properties field: + + uint8_t lc, lp, pb; + uint8_t prop = get_lzma_properties(); + if (prop > (4 * 5 + 4) * 9 + 8) + return LZMA_PROPERTIES_ERROR; + + pb = prop / (9 * 5); + prop -= pb * 9 * 5; + lp = prop / 9; + lc = prop - lp * 9; + + XZ Utils has an additional requirement: lc + lp <= 4. Files + which don't follow this requirement cannot be decompressed + with XZ Utils. Usually this isn't a problem since the most + common lc/lp/pb values are 3/0/2. It is the only lc/lp/pb + combination that the files created by LZMA Utils can have, + but LZMA Utils can decompress files with any lc/lp/pb. + + +1.1.2. Dictionary Size + + Dictionary Size is stored as an unsigned 32-bit little endian + integer. Any 32-bit value is possible, but for maximum + portability, only sizes of 2^n and 2^n + 2^(n-1) should be + used. + + LZMA Utils creates only files with dictionary size 2^n, + 16 <= n <= 25. LZMA Utils can decompress files with any + dictionary size. + + XZ Utils creates and decompresses .lzma files only with + dictionary sizes 2^n and 2^n + 2^(n-1). If some other + dictionary size is specified when compressing, the value + stored in the Dictionary Size field is a rounded up, but the + specified value is still used in the actual compression code. + + +1.1.3. Uncompressed Size + + Uncompressed Size is stored as unsigned 64-bit little endian + integer. A special value of 0xFFFF_FFFF_FFFF_FFFF indicates + that Uncompressed Size is unknown. End of Payload Marker (*) + is used if Uncompressed Size is unknown. End of Payload Marker + is allowed but rarely used if Uncompressed Size is known. + XZ Utils 5.2.5 and older don't support .lzma files that have + End of Payload Marker together with a known Uncompressed Size. + + XZ Utils rejects files whose Uncompressed Size field specifies + a known size that is 256 GiB or more. This is to reject false + positives when trying to guess if the input file is in the + .lzma format. When Uncompressed Size is unknown, there is no + limit for the uncompressed size of the file. + + (*) Some tools use the term End of Stream (EOS) marker + instead of End of Payload Marker. + + +1.2. LZMA Compressed Data + + Detailed description of the format of this field is out of + scope of this document. + + +2. References + + LZMA SDK - The original LZMA implementation + http://7-zip.org/sdk.html + + 7-Zip + http://7-zip.org/ + + LZMA Utils - LZMA adapted to POSIX-like systems + http://tukaani.org/lzma/ + + XZ Utils - The next generation of LZMA Utils + http://tukaani.org/xz/ + + The .xz file format - The successor of the .lzma format + http://tukaani.org/xz/xz-file-format.txt + diff --git a/doc/man/pdf-a4/lzmainfo-a4.pdf b/doc/man/pdf-a4/lzmainfo-a4.pdf new file mode 100644 index 0000000..0ee526f Binary files /dev/null and b/doc/man/pdf-a4/lzmainfo-a4.pdf differ diff --git a/doc/man/pdf-a4/xz-a4.pdf b/doc/man/pdf-a4/xz-a4.pdf new file mode 100644 index 0000000..5f1a30c Binary files /dev/null and b/doc/man/pdf-a4/xz-a4.pdf differ diff --git a/doc/man/pdf-a4/xzdec-a4.pdf b/doc/man/pdf-a4/xzdec-a4.pdf new file mode 100644 index 0000000..35f2059 Binary files /dev/null and b/doc/man/pdf-a4/xzdec-a4.pdf differ diff --git a/doc/man/pdf-a4/xzdiff-a4.pdf b/doc/man/pdf-a4/xzdiff-a4.pdf new file mode 100644 index 0000000..1189d84 Binary files /dev/null and b/doc/man/pdf-a4/xzdiff-a4.pdf differ diff --git a/doc/man/pdf-a4/xzgrep-a4.pdf b/doc/man/pdf-a4/xzgrep-a4.pdf new file mode 100644 index 0000000..2cb3528 Binary files /dev/null and b/doc/man/pdf-a4/xzgrep-a4.pdf differ diff --git a/doc/man/pdf-a4/xzless-a4.pdf b/doc/man/pdf-a4/xzless-a4.pdf new file mode 100644 index 0000000..4a8e8e6 Binary files /dev/null and b/doc/man/pdf-a4/xzless-a4.pdf differ diff --git a/doc/man/pdf-a4/xzmore-a4.pdf b/doc/man/pdf-a4/xzmore-a4.pdf new file mode 100644 index 0000000..687074b Binary files /dev/null and b/doc/man/pdf-a4/xzmore-a4.pdf differ diff --git a/doc/man/pdf-letter/lzmainfo-letter.pdf b/doc/man/pdf-letter/lzmainfo-letter.pdf new file mode 100644 index 0000000..d953045 Binary files /dev/null and b/doc/man/pdf-letter/lzmainfo-letter.pdf differ diff --git a/doc/man/pdf-letter/xz-letter.pdf b/doc/man/pdf-letter/xz-letter.pdf new file mode 100644 index 0000000..440f294 Binary files /dev/null and b/doc/man/pdf-letter/xz-letter.pdf differ diff --git a/doc/man/pdf-letter/xzdec-letter.pdf b/doc/man/pdf-letter/xzdec-letter.pdf new file mode 100644 index 0000000..83c6bb2 Binary files /dev/null and b/doc/man/pdf-letter/xzdec-letter.pdf differ diff --git a/doc/man/pdf-letter/xzdiff-letter.pdf b/doc/man/pdf-letter/xzdiff-letter.pdf new file mode 100644 index 0000000..9c7ab61 Binary files /dev/null and b/doc/man/pdf-letter/xzdiff-letter.pdf differ diff --git a/doc/man/pdf-letter/xzgrep-letter.pdf b/doc/man/pdf-letter/xzgrep-letter.pdf new file mode 100644 index 0000000..8303764 Binary files /dev/null and b/doc/man/pdf-letter/xzgrep-letter.pdf differ diff --git a/doc/man/pdf-letter/xzless-letter.pdf b/doc/man/pdf-letter/xzless-letter.pdf new file mode 100644 index 0000000..9a8e231 Binary files /dev/null and b/doc/man/pdf-letter/xzless-letter.pdf differ diff --git a/doc/man/pdf-letter/xzmore-letter.pdf b/doc/man/pdf-letter/xzmore-letter.pdf new file mode 100644 index 0000000..ef60bbc Binary files /dev/null and b/doc/man/pdf-letter/xzmore-letter.pdf differ diff --git a/doc/man/txt/lzmainfo.txt b/doc/man/txt/lzmainfo.txt new file mode 100644 index 0000000..fa4e51c --- /dev/null +++ b/doc/man/txt/lzmainfo.txt @@ -0,0 +1,40 @@ +LZMAINFO(1) XZ Utils LZMAINFO(1) + + + +NAME + lzmainfo - show information stored in the .lzma file header + +SYNOPSIS + lzmainfo [--help] [--version] [file...] + +DESCRIPTION + lzmainfo shows information stored in the .lzma file header. It reads + the first 13 bytes from the specified file, decodes the header, and + prints it to standard output in human readable format. If no files are + given or file is -, standard input is read. + + Usually the most interesting information is the uncompressed size and + the dictionary size. Uncompressed size can be shown only if the file + is in the non-streamed .lzma format variant. The amount of memory re- + quired to decompress the file is a few dozen kilobytes plus the dictio- + nary size. + + lzmainfo is included in XZ Utils primarily for backward compatibility + with LZMA Utils. + +EXIT STATUS + 0 All is good. + + 1 An error occurred. + +BUGS + lzmainfo uses MB while the correct suffix would be MiB (2^20 bytes). + This is to keep the output compatible with LZMA Utils. + +SEE ALSO + xz(1) + + + +Tukaani 2013-06-30 LZMAINFO(1) diff --git a/doc/man/txt/xz.txt b/doc/man/txt/xz.txt new file mode 100644 index 0000000..4fec85b --- /dev/null +++ b/doc/man/txt/xz.txt @@ -0,0 +1,1586 @@ +XZ(1) XZ Utils XZ(1) + + + +NAME + xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and + .lzma files + +SYNOPSIS + xz [option...] [file...] + +COMMAND ALIASES + unxz is equivalent to xz --decompress. + xzcat is equivalent to xz --decompress --stdout. + lzma is equivalent to xz --format=lzma. + unlzma is equivalent to xz --format=lzma --decompress. + lzcat is equivalent to xz --format=lzma --decompress --stdout. + + When writing scripts that need to decompress files, it is recommended + to always use the name xz with appropriate arguments (xz -d or xz -dc) + instead of the names unxz and xzcat. + +DESCRIPTION + xz is a general-purpose data compression tool with command line syntax + similar to gzip(1) and bzip2(1). The native file format is the .xz + format, but the legacy .lzma format used by LZMA Utils and raw com- + pressed streams with no container format headers are also supported. + In addition, decompression of the .lz format used by lzip is supported. + + xz compresses or decompresses each file according to the selected oper- + ation mode. If no files are given or file is -, xz reads from standard + input and writes the processed data to standard output. xz will refuse + (display an error and skip the file) to write compressed data to stan- + dard output if it is a terminal. Similarly, xz will refuse to read + compressed data from standard input if it is a terminal. + + Unless --stdout is specified, files other than - are written to a new + file whose name is derived from the source file name: + + o When compressing, the suffix of the target file format (.xz or + .lzma) is appended to the source filename to get the target file- + name. + + o When decompressing, the .xz, .lzma, or .lz suffix is removed from + the filename to get the target filename. xz also recognizes the + suffixes .txz and .tlz, and replaces them with the .tar suffix. + + If the target file already exists, an error is displayed and the file + is skipped. + + Unless writing to standard output, xz will display a warning and skip + the file if any of the following applies: + + o File is not a regular file. Symbolic links are not followed, and + thus they are not considered to be regular files. + + o File has more than one hard link. + + o File has setuid, setgid, or sticky bit set. + + o The operation mode is set to compress and the file already has a + suffix of the target file format (.xz or .txz when compressing to + the .xz format, and .lzma or .tlz when compressing to the .lzma for- + mat). + + o The operation mode is set to decompress and the file doesn't have a + suffix of any of the supported file formats (.xz, .txz, .lzma, .tlz, + or .lz). + + After successfully compressing or decompressing the file, xz copies the + owner, group, permissions, access time, and modification time from the + source file to the target file. If copying the group fails, the per- + missions are modified so that the target file doesn't become accessible + to users who didn't have permission to access the source file. xz + doesn't support copying other metadata like access control lists or ex- + tended attributes yet. + + Once the target file has been successfully closed, the source file is + removed unless --keep was specified. The source file is never removed + if the output is written to standard output or if an error occurs. + + Sending SIGINFO or SIGUSR1 to the xz process makes it print progress + information to standard error. This has only limited use since when + standard error is a terminal, using --verbose will display an automati- + cally updating progress indicator. + + Memory usage + The memory usage of xz varies from a few hundred kilobytes to several + gigabytes depending on the compression settings. The settings used + when compressing a file determine the memory requirements of the decom- + pressor. Typically the decompressor needs 5 % to 20 % of the amount of + memory that the compressor needed when creating the file. For example, + decompressing a file created with xz -9 currently requires 65 MiB of + memory. Still, it is possible to have .xz files that require several + gigabytes of memory to decompress. + + Especially users of older systems may find the possibility of very + large memory usage annoying. To prevent uncomfortable surprises, xz + has a built-in memory usage limiter, which is disabled by default. + While some operating systems provide ways to limit the memory usage of + processes, relying on it wasn't deemed to be flexible enough (for exam- + ple, using ulimit(1) to limit virtual memory tends to cripple mmap(2)). + + The memory usage limiter can be enabled with the command line option + --memlimit=limit. Often it is more convenient to enable the limiter by + default by setting the environment variable XZ_DEFAULTS, for example, + XZ_DEFAULTS=--memlimit=150MiB. It is possible to set the limits sepa- + rately for compression and decompression by using --memlimit-com- + press=limit and --memlimit-decompress=limit. Using these two options + outside XZ_DEFAULTS is rarely useful because a single run of xz cannot + do both compression and decompression and --memlimit=limit (or -M + limit) is shorter to type on the command line. + + If the specified memory usage limit is exceeded when decompressing, xz + will display an error and decompressing the file will fail. If the + limit is exceeded when compressing, xz will try to scale the settings + down so that the limit is no longer exceeded (except when using --for- + mat=raw or --no-adjust). This way the operation won't fail unless the + limit is very small. The scaling of the settings is done in steps that + don't match the compression level presets, for example, if the limit is + only slightly less than the amount required for xz -9, the settings + will be scaled down only a little, not all the way down to xz -8. + + Concatenation and padding with .xz files + It is possible to concatenate .xz files as is. xz will decompress such + files as if they were a single .xz file. + + It is possible to insert padding between the concatenated parts or af- + ter the last part. The padding must consist of null bytes and the size + of the padding must be a multiple of four bytes. This can be useful, + for example, if the .xz file is stored on a medium that measures file + sizes in 512-byte blocks. + + Concatenation and padding are not allowed with .lzma files or raw + streams. + +OPTIONS + Integer suffixes and special values + In most places where an integer argument is expected, an optional suf- + fix is supported to easily indicate large integers. There must be no + space between the integer and the suffix. + + KiB Multiply the integer by 1,024 (2^10). Ki, k, kB, K, and KB are + accepted as synonyms for KiB. + + MiB Multiply the integer by 1,048,576 (2^20). Mi, m, M, and MB are + accepted as synonyms for MiB. + + GiB Multiply the integer by 1,073,741,824 (2^30). Gi, g, G, and GB + are accepted as synonyms for GiB. + + The special value max can be used to indicate the maximum integer value + supported by the option. + + Operation mode + If multiple operation mode options are given, the last one takes ef- + fect. + + -z, --compress + Compress. This is the default operation mode when no operation + mode option is specified and no other operation mode is implied + from the command name (for example, unxz implies --decompress). + + -d, --decompress, --uncompress + Decompress. + + -t, --test + Test the integrity of compressed files. This option is equiva- + lent to --decompress --stdout except that the decompressed data + is discarded instead of being written to standard output. No + files are created or removed. + + -l, --list + Print information about compressed files. No uncompressed out- + put is produced, and no files are created or removed. In list + mode, the program cannot read the compressed data from standard + input or from other unseekable sources. + + The default listing shows basic information about files, one + file per line. To get more detailed information, use also the + --verbose option. For even more information, use --verbose + twice, but note that this may be slow, because getting all the + extra information requires many seeks. The width of verbose + output exceeds 80 characters, so piping the output to, for exam- + ple, less -S may be convenient if the terminal isn't wide + enough. + + The exact output may vary between xz versions and different lo- + cales. For machine-readable output, --robot --list should be + used. + + Operation modifiers + -k, --keep + Don't delete the input files. + + Since xz 5.2.6, this option also makes xz compress or decompress + even if the input is a symbolic link to a regular file, has more + than one hard link, or has the setuid, setgid, or sticky bit + set. The setuid, setgid, and sticky bits are not copied to the + target file. In earlier versions this was only done with + --force. + + -f, --force + This option has several effects: + + o If the target file already exists, delete it before compress- + ing or decompressing. + + o Compress or decompress even if the input is a symbolic link + to a regular file, has more than one hard link, or has the + setuid, setgid, or sticky bit set. The setuid, setgid, and + sticky bits are not copied to the target file. + + o When used with --decompress --stdout and xz cannot recognize + the type of the source file, copy the source file as is to + standard output. This allows xzcat --force to be used like + cat(1) for files that have not been compressed with xz. Note + that in future, xz might support new compressed file formats, + which may make xz decompress more types of files instead of + copying them as is to standard output. --format=format can + be used to restrict xz to decompress only a single file for- + mat. + + -c, --stdout, --to-stdout + Write the compressed or decompressed data to standard output in- + stead of a file. This implies --keep. + + --single-stream + Decompress only the first .xz stream, and silently ignore possi- + ble remaining input data following the stream. Normally such + trailing garbage makes xz display an error. + + xz never decompresses more than one stream from .lzma files or + raw streams, but this option still makes xz ignore the possible + trailing data after the .lzma file or raw stream. + + This option has no effect if the operation mode is not --decom- + press or --test. + + --no-sparse + Disable creation of sparse files. By default, if decompressing + into a regular file, xz tries to make the file sparse if the de- + compressed data contains long sequences of binary zeros. It + also works when writing to standard output as long as standard + output is connected to a regular file and certain additional + conditions are met to make it safe. Creating sparse files may + save disk space and speed up the decompression by reducing the + amount of disk I/O. + + -S .suf, --suffix=.suf + When compressing, use .suf as the suffix for the target file in- + stead of .xz or .lzma. If not writing to standard output and + the source file already has the suffix .suf, a warning is dis- + played and the file is skipped. + + When decompressing, recognize files with the suffix .suf in ad- + dition to files with the .xz, .txz, .lzma, .tlz, or .lz suffix. + If the source file has the suffix .suf, the suffix is removed to + get the target filename. + + When compressing or decompressing raw streams (--format=raw), + the suffix must always be specified unless writing to standard + output, because there is no default suffix for raw streams. + + --files[=file] + Read the filenames to process from file; if file is omitted, + filenames are read from standard input. Filenames must be ter- + minated with the newline character. A dash (-) is taken as a + regular filename; it doesn't mean standard input. If filenames + are given also as command line arguments, they are processed be- + fore the filenames read from file. + + --files0[=file] + This is identical to --files[=file] except that each filename + must be terminated with the null character. + + Basic file format and compression options + -F format, --format=format + Specify the file format to compress or decompress: + + auto This is the default. When compressing, auto is equiva- + lent to xz. When decompressing, the format of the input + file is automatically detected. Note that raw streams + (created with --format=raw) cannot be auto-detected. + + xz Compress to the .xz file format, or accept only .xz files + when decompressing. + + lzma, alone + Compress to the legacy .lzma file format, or accept only + .lzma files when decompressing. The alternative name + alone is provided for backwards compatibility with LZMA + Utils. + + lzip Accept only .lz files when decompressing. Compression is + not supported. + + The .lz format version 0 and the unextended version 1 are + supported. Version 0 files were produced by lzip 1.3 and + older. Such files aren't common but may be found from + file archives as a few source packages were released in + this format. People might have old personal files in + this format too. Decompression support for the format + version 0 was removed in lzip 1.18. + + lzip 1.4 and later create files in the format version 1. + The sync flush marker extension to the format version 1 + was added in lzip 1.6. This extension is rarely used and + isn't supported by xz (diagnosed as corrupt input). + + raw Compress or uncompress a raw stream (no headers). This + is meant for advanced users only. To decode raw streams, + you need use --format=raw and explicitly specify the fil- + ter chain, which normally would have been stored in the + container headers. + + -C check, --check=check + Specify the type of the integrity check. The check is calcu- + lated from the uncompressed data and stored in the .xz file. + This option has an effect only when compressing into the .xz + format; the .lzma format doesn't support integrity checks. The + integrity check (if any) is verified when the .xz file is decom- + pressed. + + Supported check types: + + none Don't calculate an integrity check at all. This is usu- + ally a bad idea. This can be useful when integrity of + the data is verified by other means anyway. + + crc32 Calculate CRC32 using the polynomial from IEEE-802.3 + (Ethernet). + + crc64 Calculate CRC64 using the polynomial from ECMA-182. This + is the default, since it is slightly better than CRC32 at + detecting damaged files and the speed difference is neg- + ligible. + + sha256 Calculate SHA-256. This is somewhat slower than CRC32 + and CRC64. + + Integrity of the .xz headers is always verified with CRC32. It + is not possible to change or disable it. + + --ignore-check + Don't verify the integrity check of the compressed data when de- + compressing. The CRC32 values in the .xz headers will still be + verified normally. + + Do not use this option unless you know what you are doing. Pos- + sible reasons to use this option: + + o Trying to recover data from a corrupt .xz file. + + o Speeding up decompression. This matters mostly with SHA-256 + or with files that have compressed extremely well. It's rec- + ommended to not use this option for this purpose unless the + file integrity is verified externally in some other way. + + -0 ... -9 + Select a compression preset level. The default is -6. If mul- + tiple preset levels are specified, the last one takes effect. + If a custom filter chain was already specified, setting a com- + pression preset level clears the custom filter chain. + + The differences between the presets are more significant than + with gzip(1) and bzip2(1). The selected compression settings + determine the memory requirements of the decompressor, thus us- + ing a too high preset level might make it painful to decompress + the file on an old system with little RAM. Specifically, it's + not a good idea to blindly use -9 for everything like it often + is with gzip(1) and bzip2(1). + + -0 ... -3 + These are somewhat fast presets. -0 is sometimes faster + than gzip -9 while compressing much better. The higher + ones often have speed comparable to bzip2(1) with compa- + rable or better compression ratio, although the results + depend a lot on the type of data being compressed. + + -4 ... -6 + Good to very good compression while keeping decompressor + memory usage reasonable even for old systems. -6 is the + default, which is usually a good choice for distributing + files that need to be decompressible even on systems with + only 16 MiB RAM. (-5e or -6e may be worth considering + too. See --extreme.) + + -7 ... -9 + These are like -6 but with higher compressor and decom- + pressor memory requirements. These are useful only when + compressing files bigger than 8 MiB, 16 MiB, and 32 MiB, + respectively. + + On the same hardware, the decompression speed is approximately a + constant number of bytes of compressed data per second. In + other words, the better the compression, the faster the decom- + pression will usually be. This also means that the amount of + uncompressed output produced per second can vary a lot. + + The following table summarises the features of the presets: + + Preset DictSize CompCPU CompMem DecMem + -0 256 KiB 0 3 MiB 1 MiB + -1 1 MiB 1 9 MiB 2 MiB + -2 2 MiB 2 17 MiB 3 MiB + -3 4 MiB 3 32 MiB 5 MiB + -4 4 MiB 4 48 MiB 5 MiB + -5 8 MiB 5 94 MiB 9 MiB + -6 8 MiB 6 94 MiB 9 MiB + -7 16 MiB 6 186 MiB 17 MiB + -8 32 MiB 6 370 MiB 33 MiB + -9 64 MiB 6 674 MiB 65 MiB + + Column descriptions: + + o DictSize is the LZMA2 dictionary size. It is waste of memory + to use a dictionary bigger than the size of the uncompressed + file. This is why it is good to avoid using the presets -7 + ... -9 when there's no real need for them. At -6 and lower, + the amount of memory wasted is usually low enough to not mat- + ter. + + o CompCPU is a simplified representation of the LZMA2 settings + that affect compression speed. The dictionary size affects + speed too, so while CompCPU is the same for levels -6 ... -9, + higher levels still tend to be a little slower. To get even + slower and thus possibly better compression, see --extreme. + + o CompMem contains the compressor memory requirements in the + single-threaded mode. It may vary slightly between xz ver- + sions. Memory requirements of some of the future multi- + threaded modes may be dramatically higher than that of the + single-threaded mode. + + o DecMem contains the decompressor memory requirements. That + is, the compression settings determine the memory require- + ments of the decompressor. The exact decompressor memory us- + age is slightly more than the LZMA2 dictionary size, but the + values in the table have been rounded up to the next full + MiB. + + -e, --extreme + Use a slower variant of the selected compression preset level + (-0 ... -9) to hopefully get a little bit better compression ra- + tio, but with bad luck this can also make it worse. Decompres- + sor memory usage is not affected, but compressor memory usage + increases a little at preset levels -0 ... -3. + + Since there are two presets with dictionary sizes 4 MiB and + 8 MiB, the presets -3e and -5e use slightly faster settings + (lower CompCPU) than -4e and -6e, respectively. That way no two + presets are identical. + + Preset DictSize CompCPU CompMem DecMem + -0e 256 KiB 8 4 MiB 1 MiB + -1e 1 MiB 8 13 MiB 2 MiB + -2e 2 MiB 8 25 MiB 3 MiB + -3e 4 MiB 7 48 MiB 5 MiB + -4e 4 MiB 8 48 MiB 5 MiB + -5e 8 MiB 7 94 MiB 9 MiB + -6e 8 MiB 8 94 MiB 9 MiB + -7e 16 MiB 8 186 MiB 17 MiB + -8e 32 MiB 8 370 MiB 33 MiB + -9e 64 MiB 8 674 MiB 65 MiB + + For example, there are a total of four presets that use 8 MiB + dictionary, whose order from the fastest to the slowest is -5, + -6, -5e, and -6e. + + --fast + --best These are somewhat misleading aliases for -0 and -9, respec- + tively. These are provided only for backwards compatibility + with LZMA Utils. Avoid using these options. + + --block-size=size + When compressing to the .xz format, split the input data into + blocks of size bytes. The blocks are compressed independently + from each other, which helps with multi-threading and makes lim- + ited random-access decompression possible. This option is typi- + cally used to override the default block size in multi-threaded + mode, but this option can be used in single-threaded mode too. + + In multi-threaded mode about three times size bytes will be al- + located in each thread for buffering input and output. The de- + fault size is three times the LZMA2 dictionary size or 1 MiB, + whichever is more. Typically a good value is 2-4 times the size + of the LZMA2 dictionary or at least 1 MiB. Using size less than + the LZMA2 dictionary size is waste of RAM because then the LZMA2 + dictionary buffer will never get fully used. The sizes of the + blocks are stored in the block headers, which a future version + of xz will use for multi-threaded decompression. + + In single-threaded mode no block splitting is done by default. + Setting this option doesn't affect memory usage. No size infor- + mation is stored in block headers, thus files created in single- + threaded mode won't be identical to files created in multi- + threaded mode. The lack of size information also means that a + future version of xz won't be able decompress the files in + multi-threaded mode. + + --block-list=sizes + When compressing to the .xz format, start a new block after the + given intervals of uncompressed data. + + The uncompressed sizes of the blocks are specified as a comma- + separated list. Omitting a size (two or more consecutive com- + mas) is a shorthand to use the size of the previous block. + + If the input file is bigger than the sum of sizes, the last + value in sizes is repeated until the end of the file. A special + value of 0 may be used as the last value to indicate that the + rest of the file should be encoded as a single block. + + If one specifies sizes that exceed the encoder's block size (ei- + ther the default value in threaded mode or the value specified + with --block-size=size), the encoder will create additional + blocks while keeping the boundaries specified in sizes. For ex- + ample, if one specifies --block-size=10MiB + --block-list=5MiB,10MiB,8MiB,12MiB,24MiB and the input file is + 80 MiB, one will get 11 blocks: 5, 10, 8, 10, 2, 10, 10, 4, 10, + 10, and 1 MiB. + + In multi-threaded mode the sizes of the blocks are stored in the + block headers. This isn't done in single-threaded mode, so the + encoded output won't be identical to that of the multi-threaded + mode. + + --flush-timeout=timeout + When compressing, if more than timeout milliseconds (a positive + integer) has passed since the previous flush and reading more + input would block, all the pending input data is flushed from + the encoder and made available in the output stream. This can + be useful if xz is used to compress data that is streamed over a + network. Small timeout values make the data available at the + receiving end with a small delay, but large timeout values give + better compression ratio. + + This feature is disabled by default. If this option is speci- + fied more than once, the last one takes effect. The special + timeout value of 0 can be used to explicitly disable this fea- + ture. + + This feature is not available on non-POSIX systems. + + This feature is still experimental. Currently xz is unsuitable + for decompressing the stream in real time due to how xz does + buffering. + + --memlimit-compress=limit + Set a memory usage limit for compression. If this option is + specified multiple times, the last one takes effect. + + If the compression settings exceed the limit, xz will attempt to + adjust the settings downwards so that the limit is no longer ex- + ceeded and display a notice that automatic adjustment was done. + The adjustments are done in this order: reducing the number of + threads, switching to single-threaded mode if even one thread in + multi-threaded mode exceeds the limit, and finally reducing the + LZMA2 dictionary size. + + When compressing with --format=raw or if --no-adjust has been + specified, only the number of threads may be reduced since it + can be done without affecting the compressed output. + + If the limit cannot be met even with the adjustments described + above, an error is displayed and xz will exit with exit status + 1. + + The limit can be specified in multiple ways: + + o The limit can be an absolute value in bytes. Using an inte- + ger suffix like MiB can be useful. Example: --memlimit-com- + press=80MiB + + o The limit can be specified as a percentage of total physical + memory (RAM). This can be useful especially when setting the + XZ_DEFAULTS environment variable in a shell initialization + script that is shared between different computers. That way + the limit is automatically bigger on systems with more mem- + ory. Example: --memlimit-compress=70% + + o The limit can be reset back to its default value by setting + it to 0. This is currently equivalent to setting the limit + to max (no memory usage limit). + + For 32-bit xz there is a special case: if the limit would be + over 4020 MiB, the limit is set to 4020 MiB. On MIPS32 2000 MiB + is used instead. (The values 0 and max aren't affected by this. + A similar feature doesn't exist for decompression.) This can be + helpful when a 32-bit executable has access to 4 GiB address + space (2 GiB on MIPS32) while hopefully doing no harm in other + situations. + + See also the section Memory usage. + + --memlimit-decompress=limit + Set a memory usage limit for decompression. This also affects + the --list mode. If the operation is not possible without ex- + ceeding the limit, xz will display an error and decompressing + the file will fail. See --memlimit-compress=limit for possible + ways to specify the limit. + + --memlimit-mt-decompress=limit + Set a memory usage limit for multi-threaded decompression. This + can only affect the number of threads; this will never make xz + refuse to decompress a file. If limit is too low to allow any + multi-threading, the limit is ignored and xz will continue in + single-threaded mode. Note that if also --memlimit-decompress + is used, it will always apply to both single-threaded and multi- + threaded modes, and so the effective limit for multi-threading + will never be higher than the limit set with --memlimit-decom- + press. + + In contrast to the other memory usage limit options, --mem- + limit-mt-decompress=limit has a system-specific default limit. + xz --info-memory can be used to see the current value. + + This option and its default value exist because without any + limit the threaded decompressor could end up allocating an in- + sane amount of memory with some input files. If the default + limit is too low on your system, feel free to increase the limit + but never set it to a value larger than the amount of usable RAM + as with appropriate input files xz will attempt to use that + amount of memory even with a low number of threads. Running out + of memory or swapping will not improve decompression perfor- + mance. + + See --memlimit-compress=limit for possible ways to specify the + limit. Setting limit to 0 resets the limit to the default sys- + tem-specific value. + + -M limit, --memlimit=limit, --memory=limit + This is equivalent to specifying --memlimit-compress=limit + --memlimit-decompress=limit --memlimit-mt-decompress=limit. + + --no-adjust + Display an error and exit if the memory usage limit cannot be + met without adjusting settings that affect the compressed out- + put. That is, this prevents xz from switching the encoder from + multi-threaded mode to single-threaded mode and from reducing + the LZMA2 dictionary size. Even when this option is used the + number of threads may be reduced to meet the memory usage limit + as that won't affect the compressed output. + + Automatic adjusting is always disabled when creating raw streams + (--format=raw). + + -T threads, --threads=threads + Specify the number of worker threads to use. Setting threads to + a special value 0 makes xz use up to as many threads as the pro- + cessor(s) on the system support. The actual number of threads + can be fewer than threads if the input file is not big enough + for threading with the given settings or if using more threads + would exceed the memory usage limit. + + The single-threaded and multi-threaded compressors produce dif- + ferent output. Single-threaded compressor will give the small- + est file size but only the output from the multi-threaded com- + pressor can be decompressed using multiple threads. Setting + threads to 1 will use the single-threaded mode. Setting threads + to any other value, including 0, will use the multi-threaded + compressor even if the system supports only one hardware thread. + (xz 5.2.x used single-threaded mode in this situation.) + + To use multi-threaded mode with only one thread, set threads to + +1. The + prefix has no effect with values other than 1. A + memory usage limit can still make xz switch to single-threaded + mode unless --no-adjust is used. Support for the + prefix was + added in xz 5.4.0. + + If an automatic number of threads has been requested and no mem- + ory usage limit has been specified, then a system-specific de- + fault soft limit will be used to possibly limit the number of + threads. It is a soft limit in sense that it is ignored if the + number of threads becomes one, thus a soft limit will never stop + xz from compressing or decompressing. This default soft limit + will not make xz switch from multi-threaded mode to single- + threaded mode. The active limits can be seen with xz + --info-memory. + + Currently the only threading method is to split the input into + blocks and compress them independently from each other. The de- + fault block size depends on the compression level and can be + overridden with the --block-size=size option. + + Threaded decompression only works on files that contain multiple + blocks with size information in block headers. All large enough + files compressed in multi-threaded mode meet this condition, but + files compressed in single-threaded mode don't even if + --block-size=size has been used. + + Custom compressor filter chains + A custom filter chain allows specifying the compression settings in de- + tail instead of relying on the settings associated to the presets. + When a custom filter chain is specified, preset options (-0 ... -9 and + --extreme) earlier on the command line are forgotten. If a preset op- + tion is specified after one or more custom filter chain options, the + new preset takes effect and the custom filter chain options specified + earlier are forgotten. + + A filter chain is comparable to piping on the command line. When com- + pressing, the uncompressed input goes to the first filter, whose output + goes to the next filter (if any). The output of the last filter gets + written to the compressed file. The maximum number of filters in the + chain is four, but typically a filter chain has only one or two fil- + ters. + + Many filters have limitations on where they can be in the filter chain: + some filters can work only as the last filter in the chain, some only + as a non-last filter, and some work in any position in the chain. De- + pending on the filter, this limitation is either inherent to the filter + design or exists to prevent security issues. + + A custom filter chain is specified by using one or more filter options + in the order they are wanted in the filter chain. That is, the order + of filter options is significant! When decoding raw streams (--for- + mat=raw), the filter chain is specified in the same order as it was + specified when compressing. + + Filters take filter-specific options as a comma-separated list. Extra + commas in options are ignored. Every option has a default value, so + you need to specify only those you want to change. + + To see the whole filter chain and options, use xz -vv (that is, use + --verbose twice). This works also for viewing the filter chain options + used by presets. + + --lzma1[=options] + --lzma2[=options] + Add LZMA1 or LZMA2 filter to the filter chain. These filters + can be used only as the last filter in the chain. + + LZMA1 is a legacy filter, which is supported almost solely due + to the legacy .lzma file format, which supports only LZMA1. + LZMA2 is an updated version of LZMA1 to fix some practical is- + sues of LZMA1. The .xz format uses LZMA2 and doesn't support + LZMA1 at all. Compression speed and ratios of LZMA1 and LZMA2 + are practically the same. + + LZMA1 and LZMA2 share the same set of options: + + preset=preset + Reset all LZMA1 or LZMA2 options to preset. Preset con- + sist of an integer, which may be followed by single-let- + ter preset modifiers. The integer can be from 0 to 9, + matching the command line options -0 ... -9. The only + supported modifier is currently e, which matches --ex- + treme. If no preset is specified, the default values of + LZMA1 or LZMA2 options are taken from the preset 6. + + dict=size + Dictionary (history buffer) size indicates how many bytes + of the recently processed uncompressed data is kept in + memory. The algorithm tries to find repeating byte se- + quences (matches) in the uncompressed data, and replace + them with references to the data currently in the dictio- + nary. The bigger the dictionary, the higher is the + chance to find a match. Thus, increasing dictionary size + usually improves compression ratio, but a dictionary big- + ger than the uncompressed file is waste of memory. + + Typical dictionary size is from 64 KiB to 64 MiB. The + minimum is 4 KiB. The maximum for compression is cur- + rently 1.5 GiB (1536 MiB). The decompressor already sup- + ports dictionaries up to one byte less than 4 GiB, which + is the maximum for the LZMA1 and LZMA2 stream formats. + + Dictionary size and match finder (mf) together determine + the memory usage of the LZMA1 or LZMA2 encoder. The same + (or bigger) dictionary size is required for decompressing + that was used when compressing, thus the memory usage of + the decoder is determined by the dictionary size used + when compressing. The .xz headers store the dictionary + size either as 2^n or 2^n + 2^(n-1), so these sizes are + somewhat preferred for compression. Other sizes will get + rounded up when stored in the .xz headers. + + lc=lc Specify the number of literal context bits. The minimum + is 0 and the maximum is 4; the default is 3. In addi- + tion, the sum of lc and lp must not exceed 4. + + All bytes that cannot be encoded as matches are encoded + as literals. That is, literals are simply 8-bit bytes + that are encoded one at a time. + + The literal coding makes an assumption that the highest + lc bits of the previous uncompressed byte correlate with + the next byte. For example, in typical English text, an + upper-case letter is often followed by a lower-case let- + ter, and a lower-case letter is usually followed by an- + other lower-case letter. In the US-ASCII character set, + the highest three bits are 010 for upper-case letters and + 011 for lower-case letters. When lc is at least 3, the + literal coding can take advantage of this property in the + uncompressed data. + + The default value (3) is usually good. If you want maxi- + mum compression, test lc=4. Sometimes it helps a little, + and sometimes it makes compression worse. If it makes it + worse, test lc=2 too. + + lp=lp Specify the number of literal position bits. The minimum + is 0 and the maximum is 4; the default is 0. + + Lp affects what kind of alignment in the uncompressed + data is assumed when encoding literals. See pb below for + more information about alignment. + + pb=pb Specify the number of position bits. The minimum is 0 + and the maximum is 4; the default is 2. + + Pb affects what kind of alignment in the uncompressed + data is assumed in general. The default means four-byte + alignment (2^pb=2^2=4), which is often a good choice when + there's no better guess. + + When the alignment is known, setting pb accordingly may + reduce the file size a little. For example, with text + files having one-byte alignment (US-ASCII, ISO-8859-*, + UTF-8), setting pb=0 can improve compression slightly. + For UTF-16 text, pb=1 is a good choice. If the alignment + is an odd number like 3 bytes, pb=0 might be the best + choice. + + Even though the assumed alignment can be adjusted with pb + and lp, LZMA1 and LZMA2 still slightly favor 16-byte + alignment. It might be worth taking into account when + designing file formats that are likely to be often com- + pressed with LZMA1 or LZMA2. + + mf=mf Match finder has a major effect on encoder speed, memory + usage, and compression ratio. Usually Hash Chain match + finders are faster than Binary Tree match finders. The + default depends on the preset: 0 uses hc3, 1-3 use hc4, + and the rest use bt4. + + The following match finders are supported. The memory + usage formulas below are rough approximations, which are + closest to the reality when dict is a power of two. + + hc3 Hash Chain with 2- and 3-byte hashing + Minimum value for nice: 3 + Memory usage: + dict * 7.5 (if dict <= 16 MiB); + dict * 5.5 + 64 MiB (if dict > 16 MiB) + + hc4 Hash Chain with 2-, 3-, and 4-byte hashing + Minimum value for nice: 4 + Memory usage: + dict * 7.5 (if dict <= 32 MiB); + dict * 6.5 (if dict > 32 MiB) + + bt2 Binary Tree with 2-byte hashing + Minimum value for nice: 2 + Memory usage: dict * 9.5 + + bt3 Binary Tree with 2- and 3-byte hashing + Minimum value for nice: 3 + Memory usage: + dict * 11.5 (if dict <= 16 MiB); + dict * 9.5 + 64 MiB (if dict > 16 MiB) + + bt4 Binary Tree with 2-, 3-, and 4-byte hashing + Minimum value for nice: 4 + Memory usage: + dict * 11.5 (if dict <= 32 MiB); + dict * 10.5 (if dict > 32 MiB) + + mode=mode + Compression mode specifies the method to analyze the data + produced by the match finder. Supported modes are fast + and normal. The default is fast for presets 0-3 and nor- + mal for presets 4-9. + + Usually fast is used with Hash Chain match finders and + normal with Binary Tree match finders. This is also what + the presets do. + + nice=nice + Specify what is considered to be a nice length for a + match. Once a match of at least nice bytes is found, the + algorithm stops looking for possibly better matches. + + Nice can be 2-273 bytes. Higher values tend to give bet- + ter compression ratio at the expense of speed. The de- + fault depends on the preset. + + depth=depth + Specify the maximum search depth in the match finder. + The default is the special value of 0, which makes the + compressor determine a reasonable depth from mf and nice. + + Reasonable depth for Hash Chains is 4-100 and 16-1000 for + Binary Trees. Using very high values for depth can make + the encoder extremely slow with some files. Avoid set- + ting the depth over 1000 unless you are prepared to in- + terrupt the compression in case it is taking far too + long. + + When decoding raw streams (--format=raw), LZMA2 needs only the + dictionary size. LZMA1 needs also lc, lp, and pb. + + --x86[=options] + --arm[=options] + --armthumb[=options] + --arm64[=options] + --powerpc[=options] + --ia64[=options] + --sparc[=options] + Add a branch/call/jump (BCJ) filter to the filter chain. These + filters can be used only as a non-last filter in the filter + chain. + + A BCJ filter converts relative addresses in the machine code to + their absolute counterparts. This doesn't change the size of + the data but it increases redundancy, which can help LZMA2 to + produce 0-15 % smaller .xz file. The BCJ filters are always re- + versible, so using a BCJ filter for wrong type of data doesn't + cause any data loss, although it may make the compression ratio + slightly worse. The BCJ filters are very fast and use an in- + significant amount of memory. + + These BCJ filters have known problems related to the compression + ratio: + + o Some types of files containing executable code (for example, + object files, static libraries, and Linux kernel modules) + have the addresses in the instructions filled with filler + values. These BCJ filters will still do the address conver- + sion, which will make the compression worse with these files. + + o If a BCJ filter is applied on an archive, it is possible that + it makes the compression ratio worse than not using a BCJ + filter. For example, if there are similar or even identical + executables then filtering will likely make the files less + similar and thus compression is worse. The contents of non- + executable files in the same archive can matter too. In + practice one has to try with and without a BCJ filter to see + which is better in each situation. + + Different instruction sets have different alignment: the exe- + cutable file must be aligned to a multiple of this value in the + input data to make the filter work. + + Filter Alignment Notes + x86 1 32-bit or 64-bit x86 + ARM 4 + ARM-Thumb 2 + ARM64 4 4096-byte alignment is best + PowerPC 4 Big endian only + IA-64 16 Itanium + SPARC 4 + + Since the BCJ-filtered data is usually compressed with LZMA2, + the compression ratio may be improved slightly if the LZMA2 op- + tions are set to match the alignment of the selected BCJ filter. + For example, with the IA-64 filter, it's good to set pb=4 or + even pb=4,lp=4,lc=0 with LZMA2 (2^4=16). The x86 filter is an + exception; it's usually good to stick to LZMA2's default four- + byte alignment when compressing x86 executables. + + All BCJ filters support the same options: + + start=offset + Specify the start offset that is used when converting be- + tween relative and absolute addresses. The offset must + be a multiple of the alignment of the filter (see the ta- + ble above). The default is zero. In practice, the de- + fault is good; specifying a custom offset is almost never + useful. + + --delta[=options] + Add the Delta filter to the filter chain. The Delta filter can + be only used as a non-last filter in the filter chain. + + Currently only simple byte-wise delta calculation is supported. + It can be useful when compressing, for example, uncompressed + bitmap images or uncompressed PCM audio. However, special pur- + pose algorithms may give significantly better results than Delta + + LZMA2. This is true especially with audio, which compresses + faster and better, for example, with flac(1). + + Supported options: + + dist=distance + Specify the distance of the delta calculation in bytes. + distance must be 1-256. The default is 1. + + For example, with dist=2 and eight-byte input A1 B1 A2 B3 + A3 B5 A4 B7, the output will be A1 B1 01 02 01 02 01 02. + + Other options + -q, --quiet + Suppress warnings and notices. Specify this twice to suppress + errors too. This option has no effect on the exit status. That + is, even if a warning was suppressed, the exit status to indi- + cate a warning is still used. + + -v, --verbose + Be verbose. If standard error is connected to a terminal, xz + will display a progress indicator. Specifying --verbose twice + will give even more verbose output. + + The progress indicator shows the following information: + + o Completion percentage is shown if the size of the input file + is known. That is, the percentage cannot be shown in pipes. + + o Amount of compressed data produced (compressing) or consumed + (decompressing). + + o Amount of uncompressed data consumed (compressing) or pro- + duced (decompressing). + + o Compression ratio, which is calculated by dividing the amount + of compressed data processed so far by the amount of uncom- + pressed data processed so far. + + o Compression or decompression speed. This is measured as the + amount of uncompressed data consumed (compression) or pro- + duced (decompression) per second. It is shown after a few + seconds have passed since xz started processing the file. + + o Elapsed time in the format M:SS or H:MM:SS. + + o Estimated remaining time is shown only when the size of the + input file is known and a couple of seconds have already + passed since xz started processing the file. The time is + shown in a less precise format which never has any colons, + for example, 2 min 30 s. + + When standard error is not a terminal, --verbose will make xz + print the filename, compressed size, uncompressed size, compres- + sion ratio, and possibly also the speed and elapsed time on a + single line to standard error after compressing or decompressing + the file. The speed and elapsed time are included only when the + operation took at least a few seconds. If the operation didn't + finish, for example, due to user interruption, also the comple- + tion percentage is printed if the size of the input file is + known. + + -Q, --no-warn + Don't set the exit status to 2 even if a condition worth a warn- + ing was detected. This option doesn't affect the verbosity + level, thus both --quiet and --no-warn have to be used to not + display warnings and to not alter the exit status. + + --robot + Print messages in a machine-parsable format. This is intended + to ease writing frontends that want to use xz instead of li- + blzma, which may be the case with various scripts. The output + with this option enabled is meant to be stable across xz re- + leases. See the section ROBOT MODE for details. + + --info-memory + Display, in human-readable format, how much physical memory + (RAM) and how many processor threads xz thinks the system has + and the memory usage limits for compression and decompression, + and exit successfully. + + -h, --help + Display a help message describing the most commonly used op- + tions, and exit successfully. + + -H, --long-help + Display a help message describing all features of xz, and exit + successfully + + -V, --version + Display the version number of xz and liblzma in human readable + format. To get machine-parsable output, specify --robot before + --version. + +ROBOT MODE + The robot mode is activated with the --robot option. It makes the out- + put of xz easier to parse by other programs. Currently --robot is sup- + ported only together with --version, --info-memory, and --list. It + will be supported for compression and decompression in the future. + + Version + xz --robot --version prints the version number of xz and liblzma in the + following format: + + XZ_VERSION=XYYYZZZS + LIBLZMA_VERSION=XYYYZZZS + + X Major version. + + YYY Minor version. Even numbers are stable. Odd numbers are alpha + or beta versions. + + ZZZ Patch level for stable releases or just a counter for develop- + ment releases. + + S Stability. 0 is alpha, 1 is beta, and 2 is stable. S should be + always 2 when YYY is even. + + XYYYZZZS are the same on both lines if xz and liblzma are from the same + XZ Utils release. + + Examples: 4.999.9beta is 49990091 and 5.0.0 is 50000002. + + Memory limit information + xz --robot --info-memory prints a single line with multiple tab-sepa- + rated columns: + + 1. Total amount of physical memory (RAM) in bytes. + + 2. Memory usage limit for compression in bytes (--memlimit-compress). + A special value of 0 indicates the default setting which for sin- + gle-threaded mode is the same as no limit. + + 3. Memory usage limit for decompression in bytes (--memlimit-decom- + press). A special value of 0 indicates the default setting which + for single-threaded mode is the same as no limit. + + 4. Since xz 5.3.4alpha: Memory usage for multi-threaded decompression + in bytes (--memlimit-mt-decompress). This is never zero because a + system-specific default value shown in the column 5 is used if no + limit has been specified explicitly. This is also never greater + than the value in the column 3 even if a larger value has been + specified with --memlimit-mt-decompress. + + 5. Since xz 5.3.4alpha: A system-specific default memory usage limit + that is used to limit the number of threads when compressing with + an automatic number of threads (--threads=0) and no memory usage + limit has been specified (--memlimit-compress). This is also used + as the default value for --memlimit-mt-decompress. + + 6. Since xz 5.3.4alpha: Number of available processor threads. + + In the future, the output of xz --robot --info-memory may have more + columns, but never more than a single line. + + List mode + xz --robot --list uses tab-separated output. The first column of every + line has a string that indicates the type of the information found on + that line: + + name This is always the first line when starting to list a file. The + second column on the line is the filename. + + file This line contains overall information about the .xz file. This + line is always printed after the name line. + + stream This line type is used only when --verbose was specified. There + are as many stream lines as there are streams in the .xz file. + + block This line type is used only when --verbose was specified. There + are as many block lines as there are blocks in the .xz file. + The block lines are shown after all the stream lines; different + line types are not interleaved. + + summary + This line type is used only when --verbose was specified twice. + This line is printed after all block lines. Like the file line, + the summary line contains overall information about the .xz + file. + + totals This line is always the very last line of the list output. It + shows the total counts and sizes. + + The columns of the file lines: + 2. Number of streams in the file + 3. Total number of blocks in the stream(s) + 4. Compressed size of the file + 5. Uncompressed size of the file + 6. Compression ratio, for example, 0.123. If ratio is over + 9.999, three dashes (---) are displayed instead of the ra- + tio. + 7. Comma-separated list of integrity check names. The follow- + ing strings are used for the known check types: None, CRC32, + CRC64, and SHA-256. For unknown check types, Unknown-N is + used, where N is the Check ID as a decimal number (one or + two digits). + 8. Total size of stream padding in the file + + The columns of the stream lines: + 2. Stream number (the first stream is 1) + 3. Number of blocks in the stream + 4. Compressed start offset + 5. Uncompressed start offset + 6. Compressed size (does not include stream padding) + 7. Uncompressed size + 8. Compression ratio + 9. Name of the integrity check + 10. Size of stream padding + + The columns of the block lines: + 2. Number of the stream containing this block + 3. Block number relative to the beginning of the stream (the + first block is 1) + 4. Block number relative to the beginning of the file + 5. Compressed start offset relative to the beginning of the + file + 6. Uncompressed start offset relative to the beginning of the + file + 7. Total compressed size of the block (includes headers) + 8. Uncompressed size + 9. Compression ratio + 10. Name of the integrity check + + If --verbose was specified twice, additional columns are included on + the block lines. These are not displayed with a single --verbose, be- + cause getting this information requires many seeks and can thus be + slow: + 11. Value of the integrity check in hexadecimal + 12. Block header size + 13. Block flags: c indicates that compressed size is present, + and u indicates that uncompressed size is present. If the + flag is not set, a dash (-) is shown instead to keep the + string length fixed. New flags may be added to the end of + the string in the future. + 14. Size of the actual compressed data in the block (this ex- + cludes the block header, block padding, and check fields) + 15. Amount of memory (in bytes) required to decompress this + block with this xz version + 16. Filter chain. Note that most of the options used at com- + pression time cannot be known, because only the options that + are needed for decompression are stored in the .xz headers. + + The columns of the summary lines: + 2. Amount of memory (in bytes) required to decompress this file + with this xz version + 3. yes or no indicating if all block headers have both com- + pressed size and uncompressed size stored in them + Since xz 5.1.2alpha: + 4. Minimum xz version required to decompress the file + + The columns of the totals line: + 2. Number of streams + 3. Number of blocks + 4. Compressed size + 5. Uncompressed size + 6. Average compression ratio + 7. Comma-separated list of integrity check names that were + present in the files + 8. Stream padding size + 9. Number of files. This is here to keep the order of the ear- + lier columns the same as on file lines. + + If --verbose was specified twice, additional columns are included on + the totals line: + 10. Maximum amount of memory (in bytes) required to decompress + the files with this xz version + 11. yes or no indicating if all block headers have both com- + pressed size and uncompressed size stored in them + Since xz 5.1.2alpha: + 12. Minimum xz version required to decompress the file + + Future versions may add new line types and new columns can be added to + the existing line types, but the existing columns won't be changed. + +EXIT STATUS + 0 All is good. + + 1 An error occurred. + + 2 Something worth a warning occurred, but no actual errors oc- + curred. + + Notices (not warnings or errors) printed on standard error don't affect + the exit status. + +ENVIRONMENT + xz parses space-separated lists of options from the environment vari- + ables XZ_DEFAULTS and XZ_OPT, in this order, before parsing the options + from the command line. Note that only options are parsed from the en- + vironment variables; all non-options are silently ignored. Parsing is + done with getopt_long(3) which is used also for the command line argu- + ments. + + XZ_DEFAULTS + User-specific or system-wide default options. Typically this is + set in a shell initialization script to enable xz's memory usage + limiter by default. Excluding shell initialization scripts and + similar special cases, scripts must never set or unset XZ_DE- + FAULTS. + + XZ_OPT This is for passing options to xz when it is not possible to set + the options directly on the xz command line. This is the case + when xz is run by a script or tool, for example, GNU tar(1): + + XZ_OPT=-2v tar caf foo.tar.xz foo + + Scripts may use XZ_OPT, for example, to set script-specific de- + fault compression options. It is still recommended to allow + users to override XZ_OPT if that is reasonable. For example, in + sh(1) scripts one may use something like this: + + XZ_OPT=${XZ_OPT-"-7e"} + export XZ_OPT + +LZMA UTILS COMPATIBILITY + The command line syntax of xz is practically a superset of lzma, un- + lzma, and lzcat as found from LZMA Utils 4.32.x. In most cases, it is + possible to replace LZMA Utils with XZ Utils without breaking existing + scripts. There are some incompatibilities though, which may sometimes + cause problems. + + Compression preset levels + The numbering of the compression level presets is not identical in xz + and LZMA Utils. The most important difference is how dictionary sizes + are mapped to different presets. Dictionary size is roughly equal to + the decompressor memory usage. + + Level xz LZMA Utils + -0 256 KiB N/A + -1 1 MiB 64 KiB + -2 2 MiB 1 MiB + -3 4 MiB 512 KiB + -4 4 MiB 1 MiB + -5 8 MiB 2 MiB + -6 8 MiB 4 MiB + -7 16 MiB 8 MiB + -8 32 MiB 16 MiB + -9 64 MiB 32 MiB + + The dictionary size differences affect the compressor memory usage too, + but there are some other differences between LZMA Utils and XZ Utils, + which make the difference even bigger: + + Level xz LZMA Utils 4.32.x + -0 3 MiB N/A + -1 9 MiB 2 MiB + -2 17 MiB 12 MiB + -3 32 MiB 12 MiB + -4 48 MiB 16 MiB + -5 94 MiB 26 MiB + -6 94 MiB 45 MiB + -7 186 MiB 83 MiB + -8 370 MiB 159 MiB + -9 674 MiB 311 MiB + + The default preset level in LZMA Utils is -7 while in XZ Utils it is + -6, so both use an 8 MiB dictionary by default. + + Streamed vs. non-streamed .lzma files + The uncompressed size of the file can be stored in the .lzma header. + LZMA Utils does that when compressing regular files. The alternative + is to mark that uncompressed size is unknown and use end-of-payload + marker to indicate where the decompressor should stop. LZMA Utils uses + this method when uncompressed size isn't known, which is the case, for + example, in pipes. + + xz supports decompressing .lzma files with or without end-of-payload + marker, but all .lzma files created by xz will use end-of-payload + marker and have uncompressed size marked as unknown in the .lzma + header. This may be a problem in some uncommon situations. For exam- + ple, a .lzma decompressor in an embedded device might work only with + files that have known uncompressed size. If you hit this problem, you + need to use LZMA Utils or LZMA SDK to create .lzma files with known un- + compressed size. + + Unsupported .lzma files + The .lzma format allows lc values up to 8, and lp values up to 4. LZMA + Utils can decompress files with any lc and lp, but always creates files + with lc=3 and lp=0. Creating files with other lc and lp is possible + with xz and with LZMA SDK. + + The implementation of the LZMA1 filter in liblzma requires that the sum + of lc and lp must not exceed 4. Thus, .lzma files, which exceed this + limitation, cannot be decompressed with xz. + + LZMA Utils creates only .lzma files which have a dictionary size of 2^n + (a power of 2) but accepts files with any dictionary size. liblzma ac- + cepts only .lzma files which have a dictionary size of 2^n or 2^n + + 2^(n-1). This is to decrease false positives when detecting .lzma + files. + + These limitations shouldn't be a problem in practice, since practically + all .lzma files have been compressed with settings that liblzma will + accept. + + Trailing garbage + When decompressing, LZMA Utils silently ignore everything after the + first .lzma stream. In most situations, this is a bug. This also + means that LZMA Utils don't support decompressing concatenated .lzma + files. + + If there is data left after the first .lzma stream, xz considers the + file to be corrupt unless --single-stream was used. This may break ob- + scure scripts which have assumed that trailing garbage is ignored. + +NOTES + Compressed output may vary + The exact compressed output produced from the same uncompressed input + file may vary between XZ Utils versions even if compression options are + identical. This is because the encoder can be improved (faster or bet- + ter compression) without affecting the file format. The output can + vary even between different builds of the same XZ Utils version, if + different build options are used. + + The above means that once --rsyncable has been implemented, the result- + ing files won't necessarily be rsyncable unless both old and new files + have been compressed with the same xz version. This problem can be + fixed if a part of the encoder implementation is frozen to keep rsynca- + ble output stable across xz versions. + + Embedded .xz decompressors + Embedded .xz decompressor implementations like XZ Embedded don't neces- + sarily support files created with integrity check types other than none + and crc32. Since the default is --check=crc64, you must use + --check=none or --check=crc32 when creating files for embedded systems. + + Outside embedded systems, all .xz format decompressors support all the + check types, or at least are able to decompress the file without veri- + fying the integrity check if the particular check is not supported. + + XZ Embedded supports BCJ filters, but only with the default start off- + set. + +EXAMPLES + Basics + Compress the file foo into foo.xz using the default compression level + (-6), and remove foo if compression is successful: + + xz foo + + Decompress bar.xz into bar and don't remove bar.xz even if decompres- + sion is successful: + + xz -dk bar.xz + + Create baz.tar.xz with the preset -4e (-4 --extreme), which is slower + than the default -6, but needs less memory for compression and decom- + pression (48 MiB and 5 MiB, respectively): + + tar cf - baz | xz -4e > baz.tar.xz + + A mix of compressed and uncompressed files can be decompressed to stan- + dard output with a single command: + + xz -dcf a.txt b.txt.xz c.txt d.txt.lzma > abcd.txt + + Parallel compression of many files + On GNU and *BSD, find(1) and xargs(1) can be used to parallelize com- + pression of many files: + + find . -type f \! -name '*.xz' -print0 \ + | xargs -0r -P4 -n16 xz -T1 + + The -P option to xargs(1) sets the number of parallel xz processes. + The best value for the -n option depends on how many files there are to + be compressed. If there are only a couple of files, the value should + probably be 1; with tens of thousands of files, 100 or even more may be + appropriate to reduce the number of xz processes that xargs(1) will + eventually create. + + The option -T1 for xz is there to force it to single-threaded mode, be- + cause xargs(1) is used to control the amount of parallelization. + + Robot mode + Calculate how many bytes have been saved in total after compressing + multiple files: + + xz --robot --list *.xz | awk '/^totals/{print $5-$4}' + + A script may want to know that it is using new enough xz. The follow- + ing sh(1) script checks that the version number of the xz tool is at + least 5.0.0. This method is compatible with old beta versions, which + didn't support the --robot option: + + if ! eval "$(xz --robot --version 2> /dev/null)" || + [ "$XZ_VERSION" -lt 50000002 ]; then + echo "Your xz is too old." + fi + unset XZ_VERSION LIBLZMA_VERSION + + Set a memory usage limit for decompression using XZ_OPT, but if a limit + has already been set, don't increase it: + + NEWLIM=$((123 << 20)) # 123 MiB + OLDLIM=$(xz --robot --info-memory | cut -f3) + if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then + XZ_OPT="$XZ_OPT --memlimit-decompress=$NEWLIM" + export XZ_OPT + fi + + Custom compressor filter chains + The simplest use for custom filter chains is customizing a LZMA2 pre- + set. This can be useful, because the presets cover only a subset of + the potentially useful combinations of compression settings. + + The CompCPU columns of the tables from the descriptions of the options + -0 ... -9 and --extreme are useful when customizing LZMA2 presets. + Here are the relevant parts collected from those two tables: + + Preset CompCPU + -0 0 + -1 1 + -2 2 + -3 3 + -4 4 + -5 5 + -6 6 + -5e 7 + -6e 8 + + If you know that a file requires somewhat big dictionary (for example, + 32 MiB) to compress well, but you want to compress it quicker than xz + -8 would do, a preset with a low CompCPU value (for example, 1) can be + modified to use a bigger dictionary: + + xz --lzma2=preset=1,dict=32MiB foo.tar + + With certain files, the above command may be faster than xz -6 while + compressing significantly better. However, it must be emphasized that + only some files benefit from a big dictionary while keeping the CompCPU + value low. The most obvious situation, where a big dictionary can help + a lot, is an archive containing very similar files of at least a few + megabytes each. The dictionary size has to be significantly bigger + than any individual file to allow LZMA2 to take full advantage of the + similarities between consecutive files. + + If very high compressor and decompressor memory usage is fine, and the + file being compressed is at least several hundred megabytes, it may be + useful to use an even bigger dictionary than the 64 MiB that xz -9 + would use: + + xz -vv --lzma2=dict=192MiB big_foo.tar + + Using -vv (--verbose --verbose) like in the above example can be useful + to see the memory requirements of the compressor and decompressor. Re- + member that using a dictionary bigger than the size of the uncompressed + file is waste of memory, so the above command isn't useful for small + files. + + Sometimes the compression time doesn't matter, but the decompressor + memory usage has to be kept low, for example, to make it possible to + decompress the file on an embedded system. The following command uses + -6e (-6 --extreme) as a base and sets the dictionary to only 64 KiB. + The resulting file can be decompressed with XZ Embedded (that's why + there is --check=crc32) using about 100 KiB of memory. + + xz --check=crc32 --lzma2=preset=6e,dict=64KiB foo + + If you want to squeeze out as many bytes as possible, adjusting the + number of literal context bits (lc) and number of position bits (pb) + can sometimes help. Adjusting the number of literal position bits (lp) + might help too, but usually lc and pb are more important. For example, + a source code archive contains mostly US-ASCII text, so something like + the following might give slightly (like 0.1 %) smaller file than xz -6e + (try also without lc=4): + + xz --lzma2=preset=6e,pb=0,lc=4 source_code.tar + + Using another filter together with LZMA2 can improve compression with + certain file types. For example, to compress a x86-32 or x86-64 shared + library using the x86 BCJ filter: + + xz --x86 --lzma2 libfoo.so + + Note that the order of the filter options is significant. If --x86 is + specified after --lzma2, xz will give an error, because there cannot be + any filter after LZMA2, and also because the x86 BCJ filter cannot be + used as the last filter in the chain. + + The Delta filter together with LZMA2 can give good results with bitmap + images. It should usually beat PNG, which has a few more advanced fil- + ters than simple delta but uses Deflate for the actual compression. + + The image has to be saved in uncompressed format, for example, as un- + compressed TIFF. The distance parameter of the Delta filter is set to + match the number of bytes per pixel in the image. For example, 24-bit + RGB bitmap needs dist=3, and it is also good to pass pb=0 to LZMA2 to + accommodate the three-byte alignment: + + xz --delta=dist=3 --lzma2=pb=0 foo.tiff + + If multiple images have been put into a single archive (for example, + .tar), the Delta filter will work on that too as long as all images + have the same number of bytes per pixel. + +SEE ALSO + xzdec(1), xzdiff(1), xzgrep(1), xzless(1), xzmore(1), gzip(1), + bzip2(1), 7z(1) + + XZ Utils: + XZ Embedded: + LZMA SDK: + + + +Tukaani 2023-07-17 XZ(1) diff --git a/doc/man/txt/xzdec.txt b/doc/man/txt/xzdec.txt new file mode 100644 index 0000000..a914e20 --- /dev/null +++ b/doc/man/txt/xzdec.txt @@ -0,0 +1,80 @@ +XZDEC(1) XZ Utils XZDEC(1) + + + +NAME + xzdec, lzmadec - Small .xz and .lzma decompressors + +SYNOPSIS + xzdec [option...] [file...] + lzmadec [option...] [file...] + +DESCRIPTION + xzdec is a liblzma-based decompression-only tool for .xz (and only .xz) + files. xzdec is intended to work as a drop-in replacement for xz(1) in + the most common situations where a script has been written to use xz + --decompress --stdout (and possibly a few other commonly used options) + to decompress .xz files. lzmadec is identical to xzdec except that lz- + madec supports .lzma files instead of .xz files. + + To reduce the size of the executable, xzdec doesn't support multi- + threading or localization, and doesn't read options from XZ_DEFAULTS + and XZ_OPT environment variables. xzdec doesn't support displaying in- + termediate progress information: sending SIGINFO to xzdec does nothing, + but sending SIGUSR1 terminates the process instead of displaying + progress information. + +OPTIONS + -d, --decompress, --uncompress + Ignored for xz(1) compatibility. xzdec supports only decompres- + sion. + + -k, --keep + Ignored for xz(1) compatibility. xzdec never creates or removes + any files. + + -c, --stdout, --to-stdout + Ignored for xz(1) compatibility. xzdec always writes the decom- + pressed data to standard output. + + -q, --quiet + Specifying this once does nothing since xzdec never displays any + warnings or notices. Specify this twice to suppress errors. + + -Q, --no-warn + Ignored for xz(1) compatibility. xzdec never uses the exit sta- + tus 2. + + -h, --help + Display a help message and exit successfully. + + -V, --version + Display the version number of xzdec and liblzma. + +EXIT STATUS + 0 All was good. + + 1 An error occurred. + + xzdec doesn't have any warning messages like xz(1) has, thus the exit + status 2 is not used by xzdec. + +NOTES + Use xz(1) instead of xzdec or lzmadec for normal everyday use. xzdec + or lzmadec are meant only for situations where it is important to have + a smaller decompressor than the full-featured xz(1). + + xzdec and lzmadec are not really that small. The size can be reduced + further by dropping features from liblzma at compile time, but that + shouldn't usually be done for executables distributed in typical non- + embedded operating system distributions. If you need a truly small .xz + decompressor, consider using XZ Embedded. + +SEE ALSO + xz(1) + + XZ Embedded: + + + +Tukaani 2017-04-19 XZDEC(1) diff --git a/doc/man/txt/xzdiff.txt b/doc/man/txt/xzdiff.txt new file mode 100644 index 0000000..681b00c --- /dev/null +++ b/doc/man/txt/xzdiff.txt @@ -0,0 +1,37 @@ +XZDIFF(1) XZ Utils XZDIFF(1) + + + +NAME + xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files + +SYNOPSIS + xzcmp [cmp_options] file1 [file2] + xzdiff [diff_options] file1 [file2] + lzcmp [cmp_options] file1 [file2] + lzdiff [diff_options] file1 [file2] + +DESCRIPTION + xzcmp and xzdiff invoke cmp(1) or diff(1) on files compressed with + xz(1), lzma(1), gzip(1), bzip2(1), lzop(1), or zstd(1). All options + specified are passed directly to cmp(1) or diff(1). If only one file + is specified, then the files compared are file1 (which must have a suf- + fix of a supported compression format) and file1 from which the com- + pression format suffix has been stripped. If two files are specified, + then they are uncompressed if necessary and fed to cmp(1) or diff(1). + The exit status from cmp(1) or diff(1) is preserved unless a decompres- + sion error occurs; then exit status is 2. + + The names lzcmp and lzdiff are provided for backward compatibility with + LZMA Utils. + +SEE ALSO + cmp(1), diff(1), xz(1), gzip(1), bzip2(1), lzop(1), zstd(1), zdiff(1) + +BUGS + Messages from the cmp(1) or diff(1) programs refer to temporary file- + names instead of those specified. + + + +Tukaani 2021-06-04 XZDIFF(1) diff --git a/doc/man/txt/xzgrep.txt b/doc/man/txt/xzgrep.txt new file mode 100644 index 0000000..596520c --- /dev/null +++ b/doc/man/txt/xzgrep.txt @@ -0,0 +1,49 @@ +XZGREP(1) XZ Utils XZGREP(1) + + + +NAME + xzgrep - search compressed files for a regular expression + +SYNOPSIS + xzgrep [grep_options] [-e] pattern [file...] + xzegrep ... + xzfgrep ... + lzgrep ... + lzegrep ... + lzfgrep ... + +DESCRIPTION + xzgrep invokes grep(1) on files which may be either uncompressed or + compressed with xz(1), lzma(1), gzip(1), bzip2(1), lzop(1), or zstd(1). + All options specified are passed directly to grep(1). + + If no file is specified, then standard input is decompressed if neces- + sary and fed to grep(1). When reading from standard input, gzip(1), + bzip2(1), lzop(1), and zstd(1) compressed files are not supported. + + If xzgrep is invoked as xzegrep or xzfgrep then grep -E or grep -F is + used instead of grep(1). The same applies to names lzgrep, lzegrep, + and lzfgrep, which are provided for backward compatibility with LZMA + Utils. + +EXIT STATUS + 0 At least one match was found from at least one of the input + files. No errors occurred. + + 1 No matches were found from any of the input files. No errors + occurred. + + >1 One or more errors occurred. It is unknown if matches were + found. + +ENVIRONMENT + GREP If the GREP environment variable is set, xzgrep uses it instead + of grep(1), grep -E, or grep -F. + +SEE ALSO + grep(1), xz(1), gzip(1), bzip2(1), lzop(1), zstd(1), zgrep(1) + + + +Tukaani 2022-07-19 XZGREP(1) diff --git a/doc/man/txt/xzless.txt b/doc/man/txt/xzless.txt new file mode 100644 index 0000000..5c14c80 --- /dev/null +++ b/doc/man/txt/xzless.txt @@ -0,0 +1,39 @@ +XZLESS(1) XZ Utils XZLESS(1) + + + +NAME + xzless, lzless - view xz or lzma compressed (text) files + +SYNOPSIS + xzless [file...] + lzless [file...] + +DESCRIPTION + xzless is a filter that displays text from compressed files to a termi- + nal. It works on files compressed with xz(1) or lzma(1). If no files + are given, xzless reads from standard input. + + xzless uses less(1) to present its output. Unlike xzmore, its choice + of pager cannot be altered by setting an environment variable. Com- + mands are based on both more(1) and vi(1) and allow back and forth + movement and searching. See the less(1) manual for more information. + + The command named lzless is provided for backward compatibility with + LZMA Utils. + +ENVIRONMENT + LESSMETACHARS + A list of characters special to the shell. Set by xzless unless + it is already set in the environment. + + LESSOPEN + Set to a command line to invoke the xz(1) decompressor for pre- + processing the input files to less(1). + +SEE ALSO + less(1), xz(1), xzmore(1), zless(1) + + + +Tukaani 2010-09-27 XZLESS(1) diff --git a/doc/man/txt/xzmore.txt b/doc/man/txt/xzmore.txt new file mode 100644 index 0000000..5a9d86c --- /dev/null +++ b/doc/man/txt/xzmore.txt @@ -0,0 +1,34 @@ +XZMORE(1) XZ Utils XZMORE(1) + + + +NAME + xzmore, lzmore - view xz or lzma compressed (text) files + +SYNOPSIS + xzmore [file...] + lzmore [file...] + +DESCRIPTION + xzmore is a filter which allows examination of xz(1) or lzma(1) com- + pressed text files one screenful at a time on a soft-copy terminal. + + To use a pager other than the default more, set environment variable + PAGER to the name of the desired program. The name lzmore is provided + for backward compatibility with LZMA Utils. + + e or q When the prompt --More--(Next file: file) is printed, this com- + mand causes xzmore to exit. + + s When the prompt --More--(Next file: file) is printed, this com- + mand causes xzmore to skip the next file and continue. + + For list of keyboard commands supported while actually viewing the con- + tent of a file, refer to manual of the pager you use, usually more(1). + +SEE ALSO + more(1), xz(1), xzless(1), zmore(1) + + + +Tukaani 2013-06-30 XZMORE(1) diff --git a/doc/xz-file-format.txt b/doc/xz-file-format.txt new file mode 100644 index 0000000..09c83e0 --- /dev/null +++ b/doc/xz-file-format.txt @@ -0,0 +1,1165 @@ + +The .xz File Format +=================== + +Version 1.1.0 (2022-12-11) + + + 0. Preface + 0.1. Notices and Acknowledgements + 0.2. Getting the Latest Version + 0.3. Version History + 1. Conventions + 1.1. Byte and Its Representation + 1.2. Multibyte Integers + 2. Overall Structure of .xz File + 2.1. Stream + 2.1.1. Stream Header + 2.1.1.1. Header Magic Bytes + 2.1.1.2. Stream Flags + 2.1.1.3. CRC32 + 2.1.2. Stream Footer + 2.1.2.1. CRC32 + 2.1.2.2. Backward Size + 2.1.2.3. Stream Flags + 2.1.2.4. Footer Magic Bytes + 2.2. Stream Padding + 3. Block + 3.1. Block Header + 3.1.1. Block Header Size + 3.1.2. Block Flags + 3.1.3. Compressed Size + 3.1.4. Uncompressed Size + 3.1.5. List of Filter Flags + 3.1.6. Header Padding + 3.1.7. CRC32 + 3.2. Compressed Data + 3.3. Block Padding + 3.4. Check + 4. Index + 4.1. Index Indicator + 4.2. Number of Records + 4.3. List of Records + 4.3.1. Unpadded Size + 4.3.2. Uncompressed Size + 4.4. Index Padding + 4.5. CRC32 + 5. Filter Chains + 5.1. Alignment + 5.2. Security + 5.3. Filters + 5.3.1. LZMA2 + 5.3.2. Branch/Call/Jump Filters for Executables + 5.3.3. Delta + 5.3.3.1. Format of the Encoded Output + 5.4. Custom Filter IDs + 5.4.1. Reserved Custom Filter ID Ranges + 6. Cyclic Redundancy Checks + 7. References + + +0. Preface + + This document describes the .xz file format (filename suffix + ".xz", MIME type "application/x-xz"). It is intended that this + this format replace the old .lzma format used by LZMA SDK and + LZMA Utils. + + +0.1. Notices and Acknowledgements + + This file format was designed by Lasse Collin + and Igor Pavlov. + + Special thanks for helping with this document goes to + Ville Koskinen. Thanks for helping with this document goes to + Mark Adler, H. Peter Anvin, Mikko Pouru, and Lars Wirzenius. + + This document has been put into the public domain. + + +0.2. Getting the Latest Version + + The latest official version of this document can be downloaded + from . + + Specific versions of this document have a filename + xz-file-format-X.Y.Z.txt where X.Y.Z is the version number. + For example, the version 1.0.0 of this document is available + at . + + +0.3. Version History + + Version Date Description + + 1.1.0 2022-12-11 Added ARM64 filter and clarified 32-bit + ARM endianness in Section 5.3.2, + language improvements in Section 5.4 + + 1.0.4 2009-08-27 Language improvements in Sections 1.2, + 2.1.1.2, 3.1.1, 3.1.2, and 5.3.1 + + 1.0.3 2009-06-05 Spelling fixes in Sections 5.1 and 5.4 + + 1.0.2 2009-06-04 Typo fixes in Sections 4 and 5.3.1 + + 1.0.1 2009-06-01 Typo fix in Section 0.3 and minor + clarifications to Sections 2, 2.2, + 3.3, 4.4, and 5.3.2 + + 1.0.0 2009-01-14 The first official version + + +1. Conventions + + The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", + "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in [RFC-2119]. + + Indicating a warning means displaying a message, returning + appropriate exit status, or doing something else to let the + user know that something worth warning occurred. The operation + SHOULD still finish if a warning is indicated. + + Indicating an error means displaying a message, returning + appropriate exit status, or doing something else to let the + user know that something prevented successfully finishing the + operation. The operation MUST be aborted once an error has + been indicated. + + +1.1. Byte and Its Representation + + In this document, byte is always 8 bits. + + A "null byte" has all bits unset. That is, the value of a null + byte is 0x00. + + To represent byte blocks, this document uses notation that + is similar to the notation used in [RFC-1952]: + + +-------+ + | Foo | One byte. + +-------+ + + +---+---+ + | Foo | Two bytes; that is, some of the vertical bars + +---+---+ can be missing. + + +=======+ + | Foo | Zero or more bytes. + +=======+ + + In this document, a boxed byte or a byte sequence declared + using this notation is called "a field". The example field + above would be called "the Foo field" or plain "Foo". + + If there are many fields, they may be split to multiple lines. + This is indicated with an arrow ("--->"): + + +=====+ + | Foo | + +=====+ + + +=====+ + ---> | Bar | + +=====+ + + The above is equivalent to this: + + +=====+=====+ + | Foo | Bar | + +=====+=====+ + + +1.2. Multibyte Integers + + Multibyte integers of static length, such as CRC values, + are stored in little endian byte order (least significant + byte first). + + When smaller values are more likely than bigger values (for + example file sizes), multibyte integers are encoded in a + variable-length representation: + - Numbers in the range [0, 127] are copied as is, and take + one byte of space. + - Bigger numbers will occupy two or more bytes. All but the + last byte of the multibyte representation have the highest + (eighth) bit set. + + For now, the value of the variable-length integers is limited + to 63 bits, which limits the encoded size of the integer to + nine bytes. These limits may be increased in the future if + needed. + + The following C code illustrates encoding and decoding of + variable-length integers. The functions return the number of + bytes occupied by the integer (1-9), or zero on error. + + #include + #include + + size_t + encode(uint8_t buf[static 9], uint64_t num) + { + if (num > UINT64_MAX / 2) + return 0; + + size_t i = 0; + + while (num >= 0x80) { + buf[i++] = (uint8_t)(num) | 0x80; + num >>= 7; + } + + buf[i++] = (uint8_t)(num); + + return i; + } + + size_t + decode(const uint8_t buf[], size_t size_max, uint64_t *num) + { + if (size_max == 0) + return 0; + + if (size_max > 9) + size_max = 9; + + *num = buf[0] & 0x7F; + size_t i = 0; + + while (buf[i++] & 0x80) { + if (i >= size_max || buf[i] == 0x00) + return 0; + + *num |= (uint64_t)(buf[i] & 0x7F) << (i * 7); + } + + return i; + } + + +2. Overall Structure of .xz File + + A standalone .xz files consist of one or more Streams which may + have Stream Padding between or after them: + + +========+================+========+================+ + | Stream | Stream Padding | Stream | Stream Padding | ... + +========+================+========+================+ + + The sizes of Stream and Stream Padding are always multiples + of four bytes, thus the size of every valid .xz file MUST be + a multiple of four bytes. + + While a typical file contains only one Stream and no Stream + Padding, a decoder handling standalone .xz files SHOULD support + files that have more than one Stream or Stream Padding. + + In contrast to standalone .xz files, when the .xz file format + is used as an internal part of some other file format or + communication protocol, it usually is expected that the decoder + stops after the first Stream, and doesn't look for Stream + Padding or possibly other Streams. + + +2.1. Stream + + +-+-+-+-+-+-+-+-+-+-+-+-+=======+=======+ +=======+ + | Stream Header | Block | Block | ... | Block | + +-+-+-+-+-+-+-+-+-+-+-+-+=======+=======+ +=======+ + + +=======+-+-+-+-+-+-+-+-+-+-+-+-+ + ---> | Index | Stream Footer | + +=======+-+-+-+-+-+-+-+-+-+-+-+-+ + + All the above fields have a size that is a multiple of four. If + Stream is used as an internal part of another file format, it + is RECOMMENDED to make the Stream start at an offset that is + a multiple of four bytes. + + Stream Header, Index, and Stream Footer are always present in + a Stream. The maximum size of the Index field is 16 GiB (2^34). + + There are zero or more Blocks. The maximum number of Blocks is + limited only by the maximum size of the Index field. + + Total size of a Stream MUST be less than 8 EiB (2^63 bytes). + The same limit applies to the total amount of uncompressed + data stored in a Stream. + + If an implementation supports handling .xz files with multiple + concatenated Streams, it MAY apply the above limits to the file + as a whole instead of limiting per Stream basis. + + +2.1.1. Stream Header + + +---+---+---+---+---+---+-------+------+--+--+--+--+ + | Header Magic Bytes | Stream Flags | CRC32 | + +---+---+---+---+---+---+-------+------+--+--+--+--+ + + +2.1.1.1. Header Magic Bytes + + The first six (6) bytes of the Stream are so called Header + Magic Bytes. They can be used to identify the file type. + + Using a C array and ASCII: + const uint8_t HEADER_MAGIC[6] + = { 0xFD, '7', 'z', 'X', 'Z', 0x00 }; + + In plain hexadecimal: + FD 37 7A 58 5A 00 + + Notes: + - The first byte (0xFD) was chosen so that the files cannot + be erroneously detected as being in .lzma format, in which + the first byte is in the range [0x00, 0xE0]. + - The sixth byte (0x00) was chosen to prevent applications + from misdetecting the file as a text file. + + If the Header Magic Bytes don't match, the decoder MUST + indicate an error. + + +2.1.1.2. Stream Flags + + The first byte of Stream Flags is always a null byte. In the + future, this byte may be used to indicate a new Stream version + or other Stream properties. + + The second byte of Stream Flags is a bit field: + + Bit(s) Mask Description + 0-3 0x0F Type of Check (see Section 3.4): + ID Size Check name + 0x00 0 bytes None + 0x01 4 bytes CRC32 + 0x02 4 bytes (Reserved) + 0x03 4 bytes (Reserved) + 0x04 8 bytes CRC64 + 0x05 8 bytes (Reserved) + 0x06 8 bytes (Reserved) + 0x07 16 bytes (Reserved) + 0x08 16 bytes (Reserved) + 0x09 16 bytes (Reserved) + 0x0A 32 bytes SHA-256 + 0x0B 32 bytes (Reserved) + 0x0C 32 bytes (Reserved) + 0x0D 64 bytes (Reserved) + 0x0E 64 bytes (Reserved) + 0x0F 64 bytes (Reserved) + 4-7 0xF0 Reserved for future use; MUST be zero for now. + + Implementations SHOULD support at least the Check IDs 0x00 + (None) and 0x01 (CRC32). Supporting other Check IDs is + OPTIONAL. If an unsupported Check is used, the decoder SHOULD + indicate a warning or error. + + If any reserved bit is set, the decoder MUST indicate an error. + It is possible that there is a new field present which the + decoder is not aware of, and can thus parse the Stream Header + incorrectly. + + +2.1.1.3. CRC32 + + The CRC32 is calculated from the Stream Flags field. It is + stored as an unsigned 32-bit little endian integer. If the + calculated value does not match the stored one, the decoder + MUST indicate an error. + + The idea is that Stream Flags would always be two bytes, even + if new features are needed. This way old decoders will be able + to verify the CRC32 calculated from Stream Flags, and thus + distinguish between corrupt files (CRC32 doesn't match) and + files that the decoder doesn't support (CRC32 matches but + Stream Flags has reserved bits set). + + +2.1.2. Stream Footer + + +-+-+-+-+---+---+---+---+-------+------+----------+---------+ + | CRC32 | Backward Size | Stream Flags | Footer Magic Bytes | + +-+-+-+-+---+---+---+---+-------+------+----------+---------+ + + +2.1.2.1. CRC32 + + The CRC32 is calculated from the Backward Size and Stream Flags + fields. It is stored as an unsigned 32-bit little endian + integer. If the calculated value does not match the stored one, + the decoder MUST indicate an error. + + The reason to have the CRC32 field before the Backward Size and + Stream Flags fields is to keep the four-byte fields aligned to + a multiple of four bytes. + + +2.1.2.2. Backward Size + + Backward Size is stored as a 32-bit little endian integer, + which indicates the size of the Index field as multiple of + four bytes, minimum value being four bytes: + + real_backward_size = (stored_backward_size + 1) * 4; + + If the stored value does not match the real size of the Index + field, the decoder MUST indicate an error. + + Using a fixed-size integer to store Backward Size makes + it slightly simpler to parse the Stream Footer when the + application needs to parse the Stream backwards. + + +2.1.2.3. Stream Flags + + This is a copy of the Stream Flags field from the Stream + Header. The information stored to Stream Flags is needed + when parsing the Stream backwards. The decoder MUST compare + the Stream Flags fields in both Stream Header and Stream + Footer, and indicate an error if they are not identical. + + +2.1.2.4. Footer Magic Bytes + + As the last step of the decoding process, the decoder MUST + verify the existence of Footer Magic Bytes. If they don't + match, an error MUST be indicated. + + Using a C array and ASCII: + const uint8_t FOOTER_MAGIC[2] = { 'Y', 'Z' }; + + In hexadecimal: + 59 5A + + The primary reason to have Footer Magic Bytes is to make + it easier to detect incomplete files quickly, without + uncompressing. If the file does not end with Footer Magic Bytes + (excluding Stream Padding described in Section 2.2), it cannot + be undamaged, unless someone has intentionally appended garbage + after the end of the Stream. + + +2.2. Stream Padding + + Only the decoders that support decoding of concatenated Streams + MUST support Stream Padding. + + Stream Padding MUST contain only null bytes. To preserve the + four-byte alignment of consecutive Streams, the size of Stream + Padding MUST be a multiple of four bytes. Empty Stream Padding + is allowed. If these requirements are not met, the decoder MUST + indicate an error. + + Note that non-empty Stream Padding is allowed at the end of the + file; there doesn't need to be a new Stream after non-empty + Stream Padding. This can be convenient in certain situations + [GNU-tar]. + + The possibility of Stream Padding MUST be taken into account + when designing an application that parses Streams backwards, + and the application supports concatenated Streams. + + +3. Block + + +==============+=================+===============+=======+ + | Block Header | Compressed Data | Block Padding | Check | + +==============+=================+===============+=======+ + + +3.1. Block Header + + +-------------------+-------------+=================+ + | Block Header Size | Block Flags | Compressed Size | + +-------------------+-------------+=================+ + + +===================+======================+ + ---> | Uncompressed Size | List of Filter Flags | + +===================+======================+ + + +================+--+--+--+--+ + ---> | Header Padding | CRC32 | + +================+--+--+--+--+ + + +3.1.1. Block Header Size + + This field overlaps with the Index Indicator field (see + Section 4.1). + + This field contains the size of the Block Header field, + including the Block Header Size field itself. Valid values are + in the range [0x01, 0xFF], which indicate the size of the Block + Header as multiples of four bytes, minimum size being eight + bytes: + + real_header_size = (encoded_header_size + 1) * 4; + + If a Block Header bigger than 1024 bytes is needed in the + future, a new field can be added between the Block Header and + Compressed Data fields. The presence of this new field would + be indicated in the Block Header field. + + +3.1.2. Block Flags + + The Block Flags field is a bit field: + + Bit(s) Mask Description + 0-1 0x03 Number of filters (1-4) + 2-5 0x3C Reserved for future use; MUST be zero for now. + 6 0x40 The Compressed Size field is present. + 7 0x80 The Uncompressed Size field is present. + + If any reserved bit is set, the decoder MUST indicate an error. + It is possible that there is a new field present which the + decoder is not aware of, and can thus parse the Block Header + incorrectly. + + +3.1.3. Compressed Size + + This field is present only if the appropriate bit is set in + the Block Flags field (see Section 3.1.2). + + The Compressed Size field contains the size of the Compressed + Data field, which MUST be non-zero. Compressed Size is stored + using the encoding described in Section 1.2. If the Compressed + Size doesn't match the size of the Compressed Data field, the + decoder MUST indicate an error. + + +3.1.4. Uncompressed Size + + This field is present only if the appropriate bit is set in + the Block Flags field (see Section 3.1.2). + + The Uncompressed Size field contains the size of the Block + after uncompressing. Uncompressed Size is stored using the + encoding described in Section 1.2. If the Uncompressed Size + does not match the real uncompressed size, the decoder MUST + indicate an error. + + Storing the Compressed Size and Uncompressed Size fields serves + several purposes: + - The decoder knows how much memory it needs to allocate + for a temporary buffer in multithreaded mode. + - Simple error detection: wrong size indicates a broken file. + - Seeking forwards to a specific location in streamed mode. + + It should be noted that the only reliable way to determine + the real uncompressed size is to uncompress the Block, + because the Block Header and Index fields may contain + (intentionally or unintentionally) invalid information. + + +3.1.5. List of Filter Flags + + +================+================+ +================+ + | Filter 0 Flags | Filter 1 Flags | ... | Filter n Flags | + +================+================+ +================+ + + The number of Filter Flags fields is stored in the Block Flags + field (see Section 3.1.2). + + The format of each Filter Flags field is as follows: + + +===========+====================+===================+ + | Filter ID | Size of Properties | Filter Properties | + +===========+====================+===================+ + + Both Filter ID and Size of Properties are stored using the + encoding described in Section 1.2. Size of Properties indicates + the size of the Filter Properties field as bytes. The list of + officially defined Filter IDs and the formats of their Filter + Properties are described in Section 5.3. + + Filter IDs greater than or equal to 0x4000_0000_0000_0000 + (2^62) are reserved for implementation-specific internal use. + These Filter IDs MUST never be used in List of Filter Flags. + + +3.1.6. Header Padding + + This field contains as many null byte as it is needed to make + the Block Header have the size specified in Block Header Size. + If any of the bytes are not null bytes, the decoder MUST + indicate an error. It is possible that there is a new field + present which the decoder is not aware of, and can thus parse + the Block Header incorrectly. + + +3.1.7. CRC32 + + The CRC32 is calculated over everything in the Block Header + field except the CRC32 field itself. It is stored as an + unsigned 32-bit little endian integer. If the calculated + value does not match the stored one, the decoder MUST indicate + an error. + + By verifying the CRC32 of the Block Header before parsing the + actual contents allows the decoder to distinguish between + corrupt and unsupported files. + + +3.2. Compressed Data + + The format of Compressed Data depends on Block Flags and List + of Filter Flags. Excluding the descriptions of the simplest + filters in Section 5.3, the format of the filter-specific + encoded data is out of scope of this document. + + +3.3. Block Padding + + Block Padding MUST contain 0-3 null bytes to make the size of + the Block a multiple of four bytes. This can be needed when + the size of Compressed Data is not a multiple of four. If any + of the bytes in Block Padding are not null bytes, the decoder + MUST indicate an error. + + +3.4. Check + + The type and size of the Check field depends on which bits + are set in the Stream Flags field (see Section 2.1.1.2). + + The Check, when used, is calculated from the original + uncompressed data. If the calculated Check does not match the + stored one, the decoder MUST indicate an error. If the selected + type of Check is not supported by the decoder, it SHOULD + indicate a warning or error. + + +4. Index + + +-----------------+===================+ + | Index Indicator | Number of Records | + +-----------------+===================+ + + +=================+===============+-+-+-+-+ + ---> | List of Records | Index Padding | CRC32 | + +=================+===============+-+-+-+-+ + + Index serves several purposes. Using it, one can + - verify that all Blocks in a Stream have been processed; + - find out the uncompressed size of a Stream; and + - quickly access the beginning of any Block (random access). + + +4.1. Index Indicator + + This field overlaps with the Block Header Size field (see + Section 3.1.1). The value of Index Indicator is always 0x00. + + +4.2. Number of Records + + This field indicates how many Records there are in the List + of Records field, and thus how many Blocks there are in the + Stream. The value is stored using the encoding described in + Section 1.2. If the decoder has decoded all the Blocks of the + Stream, and then notices that the Number of Records doesn't + match the real number of Blocks, the decoder MUST indicate an + error. + + +4.3. List of Records + + List of Records consists of as many Records as indicated by the + Number of Records field: + + +========+========+ + | Record | Record | ... + +========+========+ + + Each Record contains information about one Block: + + +===============+===================+ + | Unpadded Size | Uncompressed Size | + +===============+===================+ + + If the decoder has decoded all the Blocks of the Stream, it + MUST verify that the contents of the Records match the real + Unpadded Size and Uncompressed Size of the respective Blocks. + + Implementation hint: It is possible to verify the Index with + constant memory usage by calculating for example SHA-256 of + both the real size values and the List of Records, then + comparing the hash values. Implementing this using + non-cryptographic hash like CRC32 SHOULD be avoided unless + small code size is important. + + If the decoder supports random-access reading, it MUST verify + that Unpadded Size and Uncompressed Size of every completely + decoded Block match the sizes stored in the Index. If only + partial Block is decoded, the decoder MUST verify that the + processed sizes don't exceed the sizes stored in the Index. + + +4.3.1. Unpadded Size + + This field indicates the size of the Block excluding the Block + Padding field. That is, Unpadded Size is the size of the Block + Header, Compressed Data, and Check fields. Unpadded Size is + stored using the encoding described in Section 1.2. The value + MUST never be zero; with the current structure of Blocks, the + actual minimum value for Unpadded Size is five. + + Implementation note: Because the size of the Block Padding + field is not included in Unpadded Size, calculating the total + size of a Stream or doing random-access reading requires + calculating the actual size of the Blocks by rounding Unpadded + Sizes up to the next multiple of four. + + The reason to exclude Block Padding from Unpadded Size is to + ease making a raw copy of Compressed Data without Block + Padding. This can be useful, for example, if someone wants + to convert Streams to some other file format quickly. + + +4.3.2. Uncompressed Size + + This field indicates the Uncompressed Size of the respective + Block as bytes. The value is stored using the encoding + described in Section 1.2. + + +4.4. Index Padding + + This field MUST contain 0-3 null bytes to pad the Index to + a multiple of four bytes. If any of the bytes are not null + bytes, the decoder MUST indicate an error. + + +4.5. CRC32 + + The CRC32 is calculated over everything in the Index field + except the CRC32 field itself. The CRC32 is stored as an + unsigned 32-bit little endian integer. If the calculated + value does not match the stored one, the decoder MUST indicate + an error. + + +5. Filter Chains + + The Block Flags field defines how many filters are used. When + more than one filter is used, the filters are chained; that is, + the output of one filter is the input of another filter. The + following figure illustrates the direction of data flow. + + v Uncompressed Data ^ + | Filter 0 | + Encoder | Filter 1 | Decoder + | Filter n | + v Compressed Data ^ + + +5.1. Alignment + + Alignment of uncompressed input data is usually the job of + the application producing the data. For example, to get the + best results, an archiver tool should make sure that all + PowerPC executable files in the archive stream start at + offsets that are multiples of four bytes. + + Some filters, for example LZMA2, can be configured to take + advantage of specified alignment of input data. Note that + taking advantage of aligned input can be beneficial also when + a filter is not the first filter in the chain. For example, + if you compress PowerPC executables, you may want to use the + PowerPC filter and chain that with the LZMA2 filter. Because + not only the input but also the output alignment of the PowerPC + filter is four bytes, it is now beneficial to set LZMA2 + settings so that the LZMA2 encoder can take advantage of its + four-byte-aligned input data. + + The output of the last filter in the chain is stored to the + Compressed Data field, which is is guaranteed to be aligned + to a multiple of four bytes relative to the beginning of the + Stream. This can increase + - speed, if the filtered data is handled multiple bytes at + a time by the filter-specific encoder and decoder, + because accessing aligned data in computer memory is + usually faster; and + - compression ratio, if the output data is later compressed + with an external compression tool. + + +5.2. Security + + If filters would be allowed to be chained freely, it would be + possible to create malicious files, that would be very slow to + decode. Such files could be used to create denial of service + attacks. + + Slow files could occur when multiple filters are chained: + + v Compressed input data + | Filter 1 decoder (last filter) + | Filter 0 decoder (non-last filter) + v Uncompressed output data + + The decoder of the last filter in the chain produces a lot of + output from little input. Another filter in the chain takes the + output of the last filter, and produces very little output + while consuming a lot of input. As a result, a lot of data is + moved inside the filter chain, but the filter chain as a whole + gets very little work done. + + To prevent this kind of slow files, there are restrictions on + how the filters can be chained. These restrictions MUST be + taken into account when designing new filters. + + The maximum number of filters in the chain has been limited to + four, thus there can be at maximum of three non-last filters. + Of these three non-last filters, only two are allowed to change + the size of the data. + + The non-last filters, that change the size of the data, MUST + have a limit how much the decoder can compress the data: the + decoder SHOULD produce at least n bytes of output when the + filter is given 2n bytes of input. This limit is not + absolute, but significant deviations MUST be avoided. + + The above limitations guarantee that if the last filter in the + chain produces 4n bytes of output, the chain as a whole will + produce at least n bytes of output. + + +5.3. Filters + +5.3.1. LZMA2 + + LZMA (Lempel-Ziv-Markov chain-Algorithm) is a general-purpose + compression algorithm with high compression ratio and fast + decompression. LZMA is based on LZ77 and range coding + algorithms. + + LZMA2 is an extension on top of the original LZMA. LZMA2 uses + LZMA internally, but adds support for flushing the encoder, + uncompressed chunks, eases stateful decoder implementations, + and improves support for multithreading. Thus, the plain LZMA + will not be supported in this file format. + + Filter ID: 0x21 + Size of Filter Properties: 1 byte + Changes size of data: Yes + Allow as a non-last filter: No + Allow as the last filter: Yes + + Preferred alignment: + Input data: Adjustable to 1/2/4/8/16 byte(s) + Output data: 1 byte + + The format of the one-byte Filter Properties field is as + follows: + + Bits Mask Description + 0-5 0x3F Dictionary Size + 6-7 0xC0 Reserved for future use; MUST be zero for now. + + Dictionary Size is encoded with one-bit mantissa and five-bit + exponent. The smallest dictionary size is 4 KiB and the biggest + is 4 GiB. + + Raw value Mantissa Exponent Dictionary size + 0 2 11 4 KiB + 1 3 11 6 KiB + 2 2 12 8 KiB + 3 3 12 12 KiB + 4 2 13 16 KiB + 5 3 13 24 KiB + 6 2 14 32 KiB + ... ... ... ... + 35 3 27 768 MiB + 36 2 28 1024 MiB + 37 3 29 1536 MiB + 38 2 30 2048 MiB + 39 3 30 3072 MiB + 40 2 31 4096 MiB - 1 B + + Instead of having a table in the decoder, the dictionary size + can be decoded using the following C code: + + const uint8_t bits = get_dictionary_flags() & 0x3F; + if (bits > 40) + return DICTIONARY_TOO_BIG; // Bigger than 4 GiB + + uint32_t dictionary_size; + if (bits == 40) { + dictionary_size = UINT32_MAX; + } else { + dictionary_size = 2 | (bits & 1); + dictionary_size <<= bits / 2 + 11; + } + + +5.3.2. Branch/Call/Jump Filters for Executables + + These filters convert relative branch, call, and jump + instructions to their absolute counterparts in executable + files. This conversion increases redundancy and thus + compression ratio. + + Size of Filter Properties: 0 or 4 bytes + Changes size of data: No + Allow as a non-last filter: Yes + Allow as the last filter: No + + Below is the list of filters in this category. The alignment + is the same for both input and output data. + + Filter ID Alignment Description + 0x04 1 byte x86 filter (BCJ) + 0x05 4 bytes PowerPC (big endian) filter + 0x06 16 bytes IA64 filter + 0x07 4 bytes ARM filter [1] + 0x08 2 bytes ARM Thumb filter [1] + 0x09 4 bytes SPARC filter + 0x0A 4 bytes ARM64 filter [2] + + [1] These are for little endian instruction encoding. + This must not be confused with data endianness. + A processor configured for big endian data access + may still use little endian instruction encoding. + The filters don't care about the data endianness. + + [2] 4096-byte alignment gives the best results + because the address in the ADRP instruction + is a multiple of 4096 bytes. + + If the size of Filter Properties is four bytes, the Filter + Properties field contains the start offset used for address + conversions. It is stored as an unsigned 32-bit little endian + integer. The start offset MUST be a multiple of the alignment + of the filter as listed in the table above; if it isn't, the + decoder MUST indicate an error. If the size of Filter + Properties is zero, the start offset is zero. + + Setting the start offset may be useful if an executable has + multiple sections, and there are many cross-section calls. + Taking advantage of this feature usually requires usage of + the Subblock filter, whose design is not complete yet. + + +5.3.3. Delta + + The Delta filter may increase compression ratio when the value + of the next byte correlates with the value of an earlier byte + at specified distance. + + Filter ID: 0x03 + Size of Filter Properties: 1 byte + Changes size of data: No + Allow as a non-last filter: Yes + Allow as the last filter: No + + Preferred alignment: + Input data: 1 byte + Output data: Same as the original input data + + The Properties byte indicates the delta distance, which can be + 1-256 bytes backwards from the current byte: 0x00 indicates + distance of 1 byte and 0xFF distance of 256 bytes. + + +5.3.3.1. Format of the Encoded Output + + The code below illustrates both encoding and decoding with + the Delta filter. + + // Distance is in the range [1, 256]. + const unsigned int distance = get_properties_byte() + 1; + uint8_t pos = 0; + uint8_t delta[256]; + + memset(delta, 0, sizeof(delta)); + + while (1) { + const int byte = read_byte(); + if (byte == EOF) + break; + + uint8_t tmp = delta[(uint8_t)(distance + pos)]; + if (is_encoder) { + tmp = (uint8_t)(byte) - tmp; + delta[pos] = (uint8_t)(byte); + } else { + tmp = (uint8_t)(byte) + tmp; + delta[pos] = tmp; + } + + write_byte(tmp); + --pos; + } + + +5.4. Custom Filter IDs + + If a developer wants to use custom Filter IDs, there are two + choices. The first choice is to contact Lasse Collin and ask + him to allocate a range of IDs for the developer. + + The second choice is to generate a 40-bit random integer + which the developer can use as a personal Developer ID. + To minimize the risk of collisions, Developer ID has to be + a randomly generated integer, not manually selected "hex word". + The following command, which works on many free operating + systems, can be used to generate Developer ID: + + dd if=/dev/urandom bs=5 count=1 | hexdump + + The developer can then use the Developer ID to create unique + (well, hopefully unique) Filter IDs. + + Bits Mask Description + 0-15 0x0000_0000_0000_FFFF Filter ID + 16-55 0x00FF_FFFF_FFFF_0000 Developer ID + 56-62 0x3F00_0000_0000_0000 Static prefix: 0x3F + + The resulting 63-bit integer will use 9 bytes of space when + stored using the encoding described in Section 1.2. To get + a shorter ID, see the beginning of this Section how to + request a custom ID range. + + +5.4.1. Reserved Custom Filter ID Ranges + + Range Description + 0x0000_0300 - 0x0000_04FF Reserved to ease .7z compatibility + 0x0002_0000 - 0x0007_FFFF Reserved to ease .7z compatibility + 0x0200_0000 - 0x07FF_FFFF Reserved to ease .7z compatibility + + +6. Cyclic Redundancy Checks + + There are several incompatible variations to calculate CRC32 + and CRC64. For simplicity and clarity, complete examples are + provided to calculate the checks as they are used in this file + format. Implementations MAY use different code as long as it + gives identical results. + + The program below reads data from standard input, calculates + the CRC32 and CRC64 values, and prints the calculated values + as big endian hexadecimal strings to standard output. + + #include + #include + #include + + uint32_t crc32_table[256]; + uint64_t crc64_table[256]; + + void + init(void) + { + static const uint32_t poly32 = UINT32_C(0xEDB88320); + static const uint64_t poly64 + = UINT64_C(0xC96C5795D7870F42); + + for (size_t i = 0; i < 256; ++i) { + uint32_t crc32 = i; + uint64_t crc64 = i; + + for (size_t j = 0; j < 8; ++j) { + if (crc32 & 1) + crc32 = (crc32 >> 1) ^ poly32; + else + crc32 >>= 1; + + if (crc64 & 1) + crc64 = (crc64 >> 1) ^ poly64; + else + crc64 >>= 1; + } + + crc32_table[i] = crc32; + crc64_table[i] = crc64; + } + } + + uint32_t + crc32(const uint8_t *buf, size_t size, uint32_t crc) + { + crc = ~crc; + for (size_t i = 0; i < size; ++i) + crc = crc32_table[buf[i] ^ (crc & 0xFF)] + ^ (crc >> 8); + return ~crc; + } + + uint64_t + crc64(const uint8_t *buf, size_t size, uint64_t crc) + { + crc = ~crc; + for (size_t i = 0; i < size; ++i) + crc = crc64_table[buf[i] ^ (crc & 0xFF)] + ^ (crc >> 8); + return ~crc; + } + + int + main() + { + init(); + + uint32_t value32 = 0; + uint64_t value64 = 0; + uint64_t total_size = 0; + uint8_t buf[8192]; + + while (1) { + const size_t buf_size + = fread(buf, 1, sizeof(buf), stdin); + if (buf_size == 0) + break; + + total_size += buf_size; + value32 = crc32(buf, buf_size, value32); + value64 = crc64(buf, buf_size, value64); + } + + printf("Bytes: %" PRIu64 "\n", total_size); + printf("CRC-32: 0x%08" PRIX32 "\n", value32); + printf("CRC-64: 0x%016" PRIX64 "\n", value64); + + return 0; + } + + +7. References + + LZMA SDK - The original LZMA implementation + http://7-zip.org/sdk.html + + LZMA Utils - LZMA adapted to POSIX-like systems + http://tukaani.org/lzma/ + + XZ Utils - The next generation of LZMA Utils + http://tukaani.org/xz/ + + [RFC-1952] + GZIP file format specification version 4.3 + http://www.ietf.org/rfc/rfc1952.txt + - Notation of byte boxes in section "2.1. Overall conventions" + + [RFC-2119] + Key words for use in RFCs to Indicate Requirement Levels + http://www.ietf.org/rfc/rfc2119.txt + + [GNU-tar] + GNU tar 1.21 manual + http://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html + - Node 9.4.2 "Blocking Factor", paragraph that begins + "gzip will complain about trailing garbage" + - Note that this URL points to the latest version of the + manual, and may some day not contain the note which is in + 1.21. For the exact version of the manual, download GNU + tar 1.21: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.21.tar.gz + diff --git a/dos/INSTALL.txt b/dos/INSTALL.txt new file mode 100644 index 0000000..e5ba85b --- /dev/null +++ b/dos/INSTALL.txt @@ -0,0 +1,78 @@ + +Building XZ Utils for DOS +========================= + +Introduction + + This document explains how to build XZ Utils for DOS using DJGPP. + The resulting binaries should run at least on various DOS versions + and under Windows 95/98/98SE/ME. + + This is somewhat experimental and has got very little testing. + + Note: Makefile and config.h are updated only now and then. This + means that if you checked out a development version, building for + DOS might not work without updating Makefile and config.h first. + + +Getting and Installing DJGPP + + You may use to help + deciding what to download. If you are only interested in building + XZ Utils, the zip-picker may list files that you don't strictly + need. However, using the zip-picker can still be worth it to get a + nice short summary of installation instructions (they can be found + from readme.1st too). + + For a more manual method, first select a mirror from + and go the + subdirectory named "current". You need the following files: + + unzip32.exe (if you don't already have a LFN-capable unzipper) + v2/djdev205.zip + v2gnu/bnu234b.zip + v2gnu/gcc920b.zip + v2gnu/mak43b.zip + v2misc/csdpmi7b.zip + + If newer versions are available, probably you should try them first. + Note that versions older than djdev205.zip aren't supported. Also + note that you want csdpmi7b.zip even if you run under Windows or + DOSEMU because the XZ Utils Makefile will embed cwsdstub.exe to + the resulting xz.exe. + + See the instructions in readme.1st found from djdev205.zip. Here's + a short summary, but you should still read readme.1st. + + C:\> mkdir DJGPP + C:\> cd DJGPP + C:\DJGPP> c:\download\unzip32 c:\download\djdev205.zip + C:\DJGPP> c:\download\unzip32 c:\download\bnu234b.zip + C:\DJGPP> c:\download\unzip32 c:\download\gcc920b.zip + C:\DJGPP> c:\download\unzip32 c:\download\mak43b.zip + C:\DJGPP> c:\download\unzip32 c:\download\csdpmi7b.zip + + C:\DJGPP> set PATH=C:\DJGPP\BIN;%PATH% + C:\DJGPP> set DJGPP=C:\DJGPP\DJGPP.ENV + + You may want to add the last two lines into AUTOEXEC.BAT or have, + for example, DJGPP.BAT which you can run before using DJGPP. + + Make sure you use completely upper case path in the DJGPP environment + variable. This is not required by DJGPP, but the XZ Utils Makefile is + a bit stupid and expects that everything in DJGPP environment variable + is uppercase. + + +Building + + You need to have an environment that supports long filenames (LFN). + Once you have built XZ Utils, the resulting binaries can be run + without long filename support. + + Run "make" in this directory (the directory containing this + INSTALL.txt). You should get xz.exe (and a bunch of temporary files). + Other tools are not built. Having e.g. xzdec.exe doesn't save much + space compared to xz.exe because the DJGPP runtime makes the .exe + quite big anyway. + diff --git a/dos/Makefile b/dos/Makefile new file mode 100644 index 0000000..793adc1 --- /dev/null +++ b/dos/Makefile @@ -0,0 +1,149 @@ +############################################################################### +# +# Makefile to build XZ Utils using DJGPP +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +# For debugging, set comment "#define NDEBUG 1" from config.h to enable +# the assert() macro, set STRIP=rem to disable stripping, and finally +# e.g. CFLAGS="-g -O0". +CC = gcc +STRIP = strip +CPPFLAGS = +CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2 +LDFLAGS = -lemu + +ALL_CFLAGS = -std=gnu99 + +ALL_CPPFLAGS = \ + -I. \ + -I../lib \ + -I../src/common \ + -I../src/liblzma/api \ + -I../src/liblzma/common \ + -I../src/liblzma/check \ + -I../src/liblzma/rangecoder \ + -I../src/liblzma/lz \ + -I../src/liblzma/lzma \ + -I../src/liblzma/delta \ + -I../src/liblzma/simple \ + -DHAVE_CONFIG_H + +ALL_CPPFLAGS += $(CPPFLAGS) +ALL_CFLAGS += $(CFLAGS) + +.PHONY: all +all: xz.exe + +SRCS_C = \ + ../lib/getopt.c \ + ../lib/getopt1.c \ + ../src/common/tuklib_cpucores.c \ + ../src/common/tuklib_exit.c \ + ../src/common/tuklib_mbstr_fw.c \ + ../src/common/tuklib_mbstr_width.c \ + ../src/common/tuklib_open_stdxxx.c \ + ../src/common/tuklib_physmem.c \ + ../src/common/tuklib_progname.c \ + ../src/liblzma/check/check.c \ + ../src/liblzma/check/crc32_table.c \ + ../src/liblzma/check/crc64_table.c \ + ../src/liblzma/check/sha256.c \ + ../src/liblzma/common/alone_decoder.c \ + ../src/liblzma/common/alone_encoder.c \ + ../src/liblzma/common/block_decoder.c \ + ../src/liblzma/common/block_encoder.c \ + ../src/liblzma/common/block_header_decoder.c \ + ../src/liblzma/common/block_header_encoder.c \ + ../src/liblzma/common/block_util.c \ + ../src/liblzma/common/common.c \ + ../src/liblzma/common/file_info.c \ + ../src/liblzma/common/filter_common.c \ + ../src/liblzma/common/filter_decoder.c \ + ../src/liblzma/common/filter_encoder.c \ + ../src/liblzma/common/filter_flags_decoder.c \ + ../src/liblzma/common/filter_flags_encoder.c \ + ../src/liblzma/common/hardware_physmem.c \ + ../src/liblzma/common/index.c \ + ../src/liblzma/common/index_decoder.c \ + ../src/liblzma/common/index_encoder.c \ + ../src/liblzma/common/index_hash.c \ + ../src/liblzma/common/lzip_decoder.c \ + ../src/liblzma/common/stream_decoder.c \ + ../src/liblzma/common/stream_encoder.c \ + ../src/liblzma/common/stream_flags_common.c \ + ../src/liblzma/common/stream_flags_decoder.c \ + ../src/liblzma/common/stream_flags_encoder.c \ + ../src/liblzma/common/string_conversion.c \ + ../src/liblzma/common/vli_decoder.c \ + ../src/liblzma/common/vli_encoder.c \ + ../src/liblzma/common/vli_size.c \ + ../src/liblzma/delta/delta_common.c \ + ../src/liblzma/delta/delta_decoder.c \ + ../src/liblzma/delta/delta_encoder.c \ + ../src/liblzma/lz/lz_decoder.c \ + ../src/liblzma/lz/lz_encoder.c \ + ../src/liblzma/lz/lz_encoder_mf.c \ + ../src/liblzma/lzma/fastpos_table.c \ + ../src/liblzma/lzma/lzma2_decoder.c \ + ../src/liblzma/lzma/lzma2_encoder.c \ + ../src/liblzma/lzma/lzma_decoder.c \ + ../src/liblzma/lzma/lzma_encoder.c \ + ../src/liblzma/lzma/lzma_encoder_optimum_fast.c \ + ../src/liblzma/lzma/lzma_encoder_optimum_normal.c \ + ../src/liblzma/lzma/lzma_encoder_presets.c \ + ../src/liblzma/rangecoder/price_table.c \ + ../src/liblzma/simple/arm.c \ + ../src/liblzma/simple/arm64.c \ + ../src/liblzma/simple/armthumb.c \ + ../src/liblzma/simple/ia64.c \ + ../src/liblzma/simple/powerpc.c \ + ../src/liblzma/simple/simple_coder.c \ + ../src/liblzma/simple/simple_decoder.c \ + ../src/liblzma/simple/simple_encoder.c \ + ../src/liblzma/simple/sparc.c \ + ../src/liblzma/simple/x86.c \ + ../src/xz/args.c \ + ../src/xz/coder.c \ + ../src/xz/file_io.c \ + ../src/xz/hardware.c \ + ../src/xz/list.c \ + ../src/xz/main.c \ + ../src/xz/message.c \ + ../src/xz/mytime.c \ + ../src/xz/options.c \ + ../src/xz/signals.c \ + ../src/xz/suffix.c \ + ../src/xz/util.c +SRCS_ASM = \ + ../src/liblzma/check/crc32_x86.S \ + ../src/liblzma/check/crc64_x86.S + +OBJS_C = $(SRCS_C:.c=.o) +OBJS_ASM = $(SRCS_ASM:.S=.o) +OBJS = $(OBJS_C) $(OBJS_ASM) + +getopt.h: + update ../lib/getopt.in.h getopt.h + +$(OBJS): getopt.h + +$(OBJS_C): %.o: %.c + $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $< + +$(OBJS_ASM): %.o: %.S + $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $< + +# Make xz.exe not depend on an external DPMI server. +xz.exe: $(OBJS) + $(CC) $(ALL_CFLAGS) $(OBJS) $(LDFLAGS) -o $@ + $(STRIP) --strip-all $@ + exe2coff $@ + del $@ + copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@ + del $(@:.exe=) diff --git a/dos/README.txt b/dos/README.txt new file mode 100644 index 0000000..0e8f6c0 --- /dev/null +++ b/dos/README.txt @@ -0,0 +1,123 @@ + +XZ Utils on DOS +=============== + +DOS-specific filename handling + + xz detects at runtime if long filename (LFN) support is + available and will use it by default. It can be disabled by + setting an environment variable: + + set lfn=n + + When xz is in LFN mode, it behaves pretty much the same as it + does on other operating systems. Examples: + + xz foo.tar -> foo.tar.xz + xz -d foo.tar.xz -> foo.tar + + xz -F lzma foo.tar -> foo.tar.lzma + xz -d foo.tar.lzma -> foo.tar + + When LFN support isn't available or it is disabled with LFN=n + environment setting, xz works in short filename (SFN) mode. This + affects filename suffix handling when compressing. + + When compressing to the .xz format in SFN mode: + + - Files without an extension get .xz just like on LFN systems. + + - *.tar files become *.txz (shorthand for *.tar.xz). *.txz + is recognized by xz on all supported operating systems. + (Try to avoid confusing this with gzipped .txt files.) + + - Files with 1-3 character extension have their extension modified + so that the last character is a dash ("-"). If the extension + is already three characters, the last character is lost. The + resulting *.?- or *.??- filename is recognized in LFN mode, but + it isn't recognized by xz on other operating systems. + + Examples: + + xz foo -> foo.xz | xz -d foo.xz -> foo + xz foo.tar -> foo.txz | xz -d foo.txz -> foo.tar + xz foo.c -> foo.c- | xz -d foo.c- -> foo.c + xz read.me -> read.me- | xz -d read.me- -> read.me + xz foo.txt -> foo.tx- | xz -d foo.tx- -> foo.tx ! + + Note that in the last example above, the third character of the + filename extension is lost. + + When compressing to the legacy .lzma format in SFN mode: + + - *.tar files become *.tlz (shorthand for *.tar.lzma). *.tlz + is recognized by xz on all supported operating systems. + + - Other files become *.lzm. The original filename extension + is lost. *.lzm is recognized also in LFN mode, but it is not + recognized by xz on other operating systems. + + Examples: + + xz -F lzma foo -> foo.lzm | xz -d foo.lzm -> foo + xz -F lzma foo.tar -> foo.tlz | xz -d foo.tlz -> foo.tar + xz -F lzma foo.c -> foo.lzm | xz -d foo.lzm -> foo ! + xz -F lzma read.me -> read.lzm | xz -d read.lzm -> read ! + xz -F lzma foo.txt -> foo.lzm | xz -d foo.lzm -> foo ! + + When compressing with a custom suffix (-S .SUF, --suffix=.SUF) to + any file format: + + - If the suffix begins with a dot, the filename extension is + replaced with the new suffix. The original extension is lost. + + - If the suffix doesn't begin with a dot and the filename has no + extension and the filename given on the command line doesn't + have a dot at the end, the custom suffix is appended just like + on LFN systems. + + - If the suffix doesn't begin with a dot and the filename has + an extension (or an extension-less filename is given with a dot + at the end), the last 1-3 characters of the filename extension + may get overwritten to fit the given custom suffix. + + Examples: + + xz -S x foo -> foox | xz -dS x foox -> foo + xz -S x foo. -> foo.x | xz -dS x foo.x -> foo + xz -S .x foo -> foo.x | xz -dS .x foo.x -> foo + xz -S .x foo. -> foo.x | xz -dS .x foo.x -> foo + xz -S x.y foo -> foox.y | xz -dS x.y foox.y -> foo + xz -S .a foo.c -> foo.a | xz -dS .a foo.a -> foo ! + xz -S a foo.c -> foo.ca | xz -dS a foo.ca -> foo.c + xz -S ab foo.c -> foo.cab | xz -dS ab foo.cab -> foo.c + xz -S ab read.me -> read.mab | xz -dS ab read.mab -> read.m ! + xz -S ab foo.txt -> foo.tab | xz -dS ab foo.tab -> foo.t ! + xz -S abc foo.txt -> foo.abc | xz -dS abc foo.abc -> foo ! + + When decompressing, the suffix handling in SFN mode is the same as + in LFN mode. The DOS-specific filenames *.lzm, *.?-, and *.??- are + recognized also in LFN mode. + + xz handles certain uncommon situations safely: + + - If the generated output filename refers to the same file as + the input file, xz detects this and refuses to compress or + decompress the input file even if --force is used. This can + happen when giving an overlong filename in SFN mode. E.g. + "xz -S x foo.texinfo" would try to write to foo.tex which on + SFN system is the same file as foo.texinfo. + + - If the generated output filename is a special file like "con" + or "prn", xz detects this and refuses to compress or decompress + the input file even if --force is used. + + +Bugs + + xz doesn't necessarily work in Dosbox. It should work in DOSEMU. + + Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file + when running under Windows XP Command Prompt (something goes wrong + with SIGINT handling). It works correctly under Windows 95/98/98SE/ME. + diff --git a/dos/config.h b/dos/config.h new file mode 100644 index 0000000..67b72f8 --- /dev/null +++ b/dos/config.h @@ -0,0 +1,153 @@ +/* How many MiB of RAM to assume if the real amount cannot be determined. */ +#define ASSUME_RAM 32 + +/* Define to 1 if crc32 integrity check is enabled. */ +#define HAVE_CHECK_CRC32 1 + +/* Define to 1 if crc64 integrity check is enabled. */ +#define HAVE_CHECK_CRC64 1 + +/* Define to 1 if sha256 integrity check is enabled. */ +#define HAVE_CHECK_SHA256 1 + +/* Define to 1 if any of HAVE_DECODER_foo have been defined. */ +#define HAVE_DECODERS 1 + +/* Define to 1 if arm decoder is enabled. */ +#define HAVE_DECODER_ARM 1 + +/* Define to 1 if arm64 decoder is enabled. */ +#define HAVE_DECODER_ARM64 1 + +/* Define to 1 if armthumb decoder is enabled. */ +#define HAVE_DECODER_ARMTHUMB 1 + +/* Define to 1 if delta decoder is enabled. */ +#define HAVE_DECODER_DELTA 1 + +/* Define to 1 if ia64 decoder is enabled. */ +#define HAVE_DECODER_IA64 1 + +/* Define to 1 if lzma1 decoder is enabled. */ +#define HAVE_DECODER_LZMA1 1 + +/* Define to 1 if lzma2 decoder is enabled. */ +#define HAVE_DECODER_LZMA2 1 + +/* Define to 1 if powerpc decoder is enabled. */ +#define HAVE_DECODER_POWERPC 1 + +/* Define to 1 if sparc decoder is enabled. */ +#define HAVE_DECODER_SPARC 1 + +/* Define to 1 if x86 decoder is enabled. */ +#define HAVE_DECODER_X86 1 + +/* Define to 1 if any of HAVE_ENCODER_foo have been defined. */ +#define HAVE_ENCODERS 1 + +/* Define to 1 if arm encoder is enabled. */ +#define HAVE_ENCODER_ARM 1 + +/* Define to 1 if arm64 encoder is enabled. */ +#define HAVE_ENCODER_ARM64 1 + +/* Define to 1 if armthumb encoder is enabled. */ +#define HAVE_ENCODER_ARMTHUMB 1 + +/* Define to 1 if delta encoder is enabled. */ +#define HAVE_ENCODER_DELTA 1 + +/* Define to 1 if ia64 encoder is enabled. */ +#define HAVE_ENCODER_IA64 1 + +/* Define to 1 if lzma1 encoder is enabled. */ +#define HAVE_ENCODER_LZMA1 1 + +/* Define to 1 if lzma2 encoder is enabled. */ +#define HAVE_ENCODER_LZMA2 1 + +/* Define to 1 if powerpc encoder is enabled. */ +#define HAVE_ENCODER_POWERPC 1 + +/* Define to 1 if sparc encoder is enabled. */ +#define HAVE_ENCODER_SPARC 1 + +/* Define to 1 if x86 encoder is enabled. */ +#define HAVE_ENCODER_X86 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if .lz (lzip) decompression support is enabled. */ +#define HAVE_LZIP_DECODER 1 + +/* Define to 1 to enable bt2 match finder. */ +#define HAVE_MF_BT2 1 + +/* Define to 1 to enable bt3 match finder. */ +#define HAVE_MF_BT3 1 + +/* Define to 1 to enable bt4 match finder. */ +#define HAVE_MF_BT4 1 + +/* Define to 1 to enable hc3 match finder. */ +#define HAVE_MF_HC3 1 + +/* Define to 1 to enable hc4 match finder. */ +#define HAVE_MF_HC4 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the `utimes' function. */ +#define HAVE_UTIMES 1 + +/* Define to 1 or 0, depending whether the compiler supports simple visibility + declarations. */ +#define HAVE_VISIBILITY 0 + +/* Define to 1 if the system has the type `_Bool'. */ +#define HAVE__BOOL 1 + +/* Define to 1 if the GNU C extension __builtin_assume_aligned is supported. + */ +#define HAVE___BUILTIN_ASSUME_ALIGNED 1 + +/* Define to 1 if the GNU C extensions __builtin_bswap16/32/64 are supported. + */ +#define HAVE___BUILTIN_BSWAPXX 1 + +/* Define to 1 to disable debugging code. */ +#define NDEBUG 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "xz@tukaani.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "XZ Utils" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://tukaani.org/xz/" + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* Define to 1 if the system supports fast unaligned access to 16-bit and + 32-bit integers. */ +#define TUKLIB_FAST_UNALIGNED_ACCESS 1 diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile new file mode 100644 index 0000000..14350cf --- /dev/null +++ b/doxygen/Doxyfile @@ -0,0 +1,2687 @@ +# Doxyfile 1.9.6 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "liblzma (XZ Utils)" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ../doc + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = ../src/liblzma/api + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = NO + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../src/liblzma/api + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.h + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = YES + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# ANamespace::AClass, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = NO + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = api + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 210 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 180 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 110 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/ + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /