INSTALL 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. XZ Utils Installation
  2. =====================
  3. 0. Preface
  4. 1. Supported platforms
  5. 1.1. Compilers
  6. 1.2. Platform-specific notes
  7. 1.2.1. AIX
  8. 1.2.2. IRIX
  9. 1.2.3. MINIX 3
  10. 1.2.4. OpenVMS
  11. 1.2.5. Solaris, OpenSolaris, and derivatives
  12. 1.2.6. Tru64
  13. 1.2.7. Windows
  14. 1.2.8. DOS
  15. 1.2.9. z/OS
  16. 1.3. Adding support for new platforms
  17. 2. configure options
  18. 2.1. Static vs. dynamic linking of liblzma
  19. 2.2. Optimizing xzdec and lzmadec
  20. 3. xzgrep and other scripts
  21. 3.1. Dependencies
  22. 3.2. PATH
  23. 4. Troubleshooting
  24. 4.1. "No C99 compiler was found."
  25. 4.2. "No POSIX conforming shell (sh) was found."
  26. 4.3. configure works but build fails at crc32_x86.S
  27. 4.4. Lots of warnings about symbol visibility
  28. 4.5. "make check" fails
  29. 4.6. liblzma.so (or similar) not found when running xz
  30. 0. Preface
  31. ----------
  32. If you aren't familiar with building packages that use GNU Autotools,
  33. see the file INSTALL.generic for generic instructions before reading
  34. further.
  35. If you are going to build a package for distribution, see also the
  36. file PACKAGERS. It contains information that should help making the
  37. binary packages as good as possible, but the information isn't very
  38. interesting to those making local builds for private use or for use
  39. in special situations like embedded systems.
  40. 1. Supported platforms
  41. ----------------------
  42. XZ Utils are developed on GNU/Linux, but they should work on many
  43. POSIX-like operating systems like *BSDs and Solaris, and even on
  44. a few non-POSIX operating systems.
  45. 1.1. Compilers
  46. A C99 compiler is required to compile XZ Utils. If you use GCC, you
  47. need at least version 3.x.x. GCC version 2.xx.x doesn't support some
  48. C99 features used in XZ Utils source code, thus GCC 2 won't compile
  49. XZ Utils.
  50. XZ Utils takes advantage of some GNU C extensions when building
  51. with GCC. Because these extensions are used only when building
  52. with GCC, it should be possible to use any C99 compiler.
  53. 1.2. Platform-specific notes
  54. 1.2.1. AIX
  55. If you use IBM XL C compiler, pass CC=xlc_r to configure. If
  56. you use CC=xlc instead, you must disable threading support
  57. with --disable-threads (usually not recommended).
  58. 1.2.2. IRIX
  59. MIPSpro 7.4.4m has been reported to produce broken code if using
  60. the -O2 optimization flag ("make check" fails). Using -O1 should
  61. work.
  62. A problem has been reported when using shared liblzma. Passing
  63. --disable-shared to configure works around this. Alternatively,
  64. putting "-64" to CFLAGS to build a 64-bit version might help too.
  65. 1.2.3. MINIX 3
  66. The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
  67. which doesn't support C99. Install GCC to compile XZ Utils.
  68. MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has
  69. to be patched before XZ Utils can be compiled correctly. See
  70. <http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
  71. MINIX 3.2.0 and later use a different libc and aren't affected by
  72. the above bug.
  73. XZ Utils doesn't have code to detect the amount of physical RAM and
  74. number of CPU cores on MINIX 3.
  75. See section 4.4 in this file about symbol visibility warnings (you
  76. may want to pass gl_cv_cc_visibility=no to configure).
  77. 1.2.4. OpenVMS
  78. XZ Utils can be built for OpenVMS, but the build system files
  79. are not included in the XZ Utils source package. The required
  80. OpenVMS-specific files are maintained by Jouk Jansen and can be
  81. downloaded here:
  82. http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils
  83. 1.2.5. Solaris, OpenSolaris, and derivatives
  84. The following linker error has been reported on some x86 systems:
  85. ld: fatal: relocation error: R_386_GOTOFF: ...
  86. This can be worked around by passing gl_cv_cc_visibility=no
  87. as an argument to the configure script.
  88. test_scripts.sh in "make check" may fail if good enough tools are
  89. missing from PATH (/usr/xpg4/bin or /usr/xpg6/bin). Nowadays
  90. /usr/xpg4/bin is added to the script PATH by default on Solaris
  91. (see --enable-path-for-scripts=PREFIX in section 2), but old xz
  92. releases needed extra steps. See sections 4.5 and 3.2 for more
  93. information.
  94. 1.2.6. Tru64
  95. If you try to use the native C compiler on Tru64 (passing CC=cc to
  96. configure), you may need the workaround mention in section 4.1 in
  97. this file (pass also ac_cv_prog_cc_c99= to configure).
  98. 1.2.7. Windows
  99. If it is enough to build liblzma (no command line tools):
  100. - There is CMake support. It should be good enough to build
  101. static liblzma or liblzma.dll with Visual Studio. The CMake
  102. support may work with MinGW or MinGW-w64. Read the comment
  103. in the beginning of CMakeLists.txt before running CMake!
  104. - There are Visual Studio project files under the "windows"
  105. directory. See windows/INSTALL-MSVC.txt. In the future the
  106. project files will be removed when CMake support is good
  107. enough. Thus, please test the CMake version and help fix
  108. possible issues.
  109. To build also the command line tools:
  110. - MinGW-w64 + MSYS (32-bit and 64-bit x86): This is used
  111. for building the official binary packages for Windows.
  112. There is windows/build.bash to ease packaging XZ Utils with
  113. MinGW(-w64) + MSYS into a redistributable .zip or .7z file.
  114. See windows/INSTALL-MinGW.txt for more information.
  115. - MinGW + MSYS (32-bit x86): I haven't recently tested this.
  116. - Cygwin 1.7.35 and later: NOTE that using XZ Utils >= 5.2.0
  117. under Cygwin older than 1.7.35 can lead to DATA LOSS! If
  118. you must use an old Cygwin version, stick to XZ Utils 5.0.x
  119. which is safe under older Cygwin versions. You can check
  120. the Cygwin version with the command "cygcheck -V".
  121. It may be possible to build liblzma with other toolchains too, but
  122. that will probably require writing a separate makefile. Building
  123. the command line tools with non-GNU toolchains will be harder than
  124. building only liblzma.
  125. Even if liblzma is built with MinGW(-w64), the resulting DLL can
  126. be used by other compilers and linkers, including MSVC. See
  127. windows/README-Windows.txt for details.
  128. 1.2.8. DOS
  129. There is a Makefile in the "dos" directory to build XZ Utils on
  130. DOS using DJGPP. Support for long file names (LFN) is needed at
  131. build time but the resulting xz.exe works without LFN support too.
  132. See dos/INSTALL.txt and dos/README.txt for more information.
  133. 1.2.9. z/OS
  134. To build XZ Utils on z/OS UNIX System Services using xlc, pass
  135. these options to the configure script: CC='xlc -qhaltonmsg=CCN3296'
  136. CPPFLAS='-D_UNIX03_THREADS -D_XOPEN_SOURCE=600'. The first makes
  137. xlc throw an error if a header file is missing, which is required
  138. to make the tests in configure work. The CPPFLAGS are needed to
  139. get pthread support (some other CPPFLAGS may work too; if there
  140. are problems, try -D_UNIX95_THREADS instead of -D_UNIX03_THREADS).
  141. test_scripts.sh in "make check" will fail even if the scripts
  142. actually work because the test data includes compressed files
  143. with US-ASCII text.
  144. No other tests should fail. If test_files.sh fails, check that
  145. the included .xz test files weren't affected by EBCDIC conversion.
  146. XZ Utils doesn't have code to detect the amount of physical RAM and
  147. number of CPU cores on z/OS.
  148. 1.3. Adding support for new platforms
  149. If you have written patches to make XZ Utils to work on previously
  150. unsupported platform, please send the patches to me! I will consider
  151. including them to the official version. It's nice to minimize the
  152. need of third-party patching.
  153. One exception: Don't request or send patches to change the whole
  154. source package to C89. I find C99 substantially nicer to write and
  155. maintain. However, the public library headers must be in C89 to
  156. avoid frustrating those who maintain programs, which are strictly
  157. in C89 or C++.
  158. 2. configure options
  159. --------------------
  160. In most cases, the defaults are what you want. Many of the options
  161. below are useful only when building a size-optimized version of
  162. liblzma or command line tools.
  163. --enable-encoders=LIST
  164. --disable-encoders
  165. Specify a comma-separated LIST of filter encoders to
  166. build. See "./configure --help" for exact list of
  167. available filter encoders. The default is to build all
  168. supported encoders.
  169. If LIST is empty or --disable-encoders is used, no filter
  170. encoders will be built and also the code shared between
  171. encoders will be omitted.
  172. Disabling encoders will remove some symbols from the
  173. liblzma ABI, so this option should be used only when it
  174. is known to not cause problems.
  175. --enable-decoders=LIST
  176. --disable-decoders
  177. This is like --enable-encoders but for decoders. The
  178. default is to build all supported decoders.
  179. --enable-match-finders=LIST
  180. liblzma includes two categories of match finders:
  181. hash chains and binary trees. Hash chains (hc3 and hc4)
  182. are quite fast but they don't provide the best compression
  183. ratio. Binary trees (bt2, bt3 and bt4) give excellent
  184. compression ratio, but they are slower and need more
  185. memory than hash chains.
  186. You need to enable at least one match finder to build the
  187. LZMA1 or LZMA2 filter encoders. Usually hash chains are
  188. used only in the fast mode, while binary trees are used to
  189. when the best compression ratio is wanted.
  190. The default is to build all the match finders if LZMA1
  191. or LZMA2 filter encoders are being built.
  192. --enable-checks=LIST
  193. liblzma support multiple integrity checks. CRC32 is
  194. mandatory, and cannot be omitted. See "./configure --help"
  195. for exact list of available integrity check types.
  196. liblzma and the command line tools can decompress files
  197. which use unsupported integrity check type, but naturally
  198. the file integrity cannot be verified in that case.
  199. Disabling integrity checks may remove some symbols from
  200. the liblzma ABI, so this option should be used only when
  201. it is known to not cause problems.
  202. --enable-external-sha256
  203. Try to use SHA-256 code from the operating system libc
  204. or similar base system libraries. This doesn't try to
  205. use OpenSSL or libgcrypt or such libraries.
  206. The reasons to use this option:
  207. - It makes liblzma slightly smaller.
  208. - It might improve SHA-256 speed if the implementation
  209. in the operating is very good (but see below).
  210. External SHA-256 is disabled by default for two reasons:
  211. - On some operating systems the symbol names of the
  212. SHA-256 functions conflict with OpenSSL's libcrypto.
  213. This causes weird problems such as decompression
  214. errors if an application is linked against both
  215. liblzma and libcrypto. This problem affects at least
  216. FreeBSD 10 and older and MINIX 3.3.0 and older, but
  217. other OSes that provide a function "SHA256_Init" might
  218. also be affected. FreeBSD 11 has the problem fixed.
  219. NetBSD had the problem but it was fixed it in 2009
  220. already. OpenBSD uses "SHA256Init" and thus never had
  221. a conflict with libcrypto.
  222. - The SHA-256 code in liblzma is faster than the SHA-256
  223. code provided by some operating systems. If you are
  224. curious, build two copies of xz (internal and external
  225. SHA-256) and compare the decompression (xz --test)
  226. times:
  227. dd if=/dev/zero bs=1024k count=1024 \
  228. | xz -v -0 -Csha256 > foo.xz
  229. time xz --test foo.xz
  230. --disable-microlzma
  231. Don't build MicroLZMA encoder and decoder. This omits
  232. lzma_microlzma_encoder() and lzma_microlzma_decoder()
  233. API functions from liblzma. These functions are needed
  234. by specific applications only. They were written for
  235. erofs-utils but they may be used by others too.
  236. --disable-lzip-decoder
  237. Disable decompression support for .lz (lzip) files.
  238. This omits the API function lzma_lzip_decoder() from
  239. liblzma and .lz support from the xz tool.
  240. --disable-xz
  241. --disable-xzdec
  242. --disable-lzmadec
  243. --disable-lzmainfo
  244. Don't build and install the command line tool mentioned
  245. in the option name.
  246. NOTE: Disabling xz will skip some tests in "make check".
  247. NOTE: If xzdec is disabled and lzmadec is left enabled,
  248. a dangling man page symlink lzmadec.1 -> xzdec.1 is
  249. created.
  250. --disable-lzma-links
  251. Don't create symlinks for LZMA Utils compatibility.
  252. This includes lzma, unlzma, and lzcat. If scripts are
  253. installed, also lzdiff, lzcmp, lzgrep, lzegrep, lzfgrep,
  254. lzmore, and lzless will be omitted if this option is used.
  255. --disable-scripts
  256. Don't install the scripts xzdiff, xzgrep, xzmore, xzless,
  257. and their symlinks.
  258. --disable-doc
  259. Don't install the documentation files to $docdir
  260. (often /usr/doc/xz or /usr/local/doc/xz). Man pages
  261. will still be installed. The $docdir can be changed
  262. with --docdir=DIR.
  263. --disable-assembler
  264. liblzma includes some assembler optimizations. Currently
  265. there is only assembler code for CRC32 and CRC64 for
  266. 32-bit x86.
  267. All the assembler code in liblzma is position-independent
  268. code, which is suitable for use in shared libraries and
  269. position-independent executables. So far only i386
  270. instructions are used, but the code is optimized for i686
  271. class CPUs. If you are compiling liblzma exclusively for
  272. pre-i686 systems, you may want to disable the assembler
  273. code.
  274. --disable-clmul-crc
  275. Disable the use carryless multiplication for CRC
  276. calculation even if compiler support for it is detected.
  277. The code uses runtime detection of SSSE3, SSE4.1, and
  278. CLMUL instructions on x86. On 32-bit x86 this currently
  279. is used only if --disable-assembler is used (this might
  280. be fixed in the future). The code works on E2K too.
  281. If using compiler options that unconditionally allow the
  282. required extensions (-msse4.1 -mpclmul) then runtime
  283. detection isn't used and the generic code is omitted.
  284. --enable-unaligned-access
  285. Allow liblzma to use unaligned memory access for 16-bit,
  286. 32-bit, and 64-bit loads and stores. This should be
  287. enabled only when the hardware supports this, that is,
  288. when unaligned access is fast. Some operating system
  289. kernels emulate unaligned access, which is extremely
  290. slow. This option shouldn't be used on systems that
  291. rely on such emulation.
  292. Unaligned access is enabled by default on x86, x86-64,
  293. big endian PowerPC, some ARM, and some ARM64 systems.
  294. --enable-unsafe-type-punning
  295. This enables use of code like
  296. uint8_t *buf8 = ...;
  297. *(uint32_t *)buf8 = ...;
  298. which violates strict aliasing rules and may result
  299. in broken code. There should be no need to use this
  300. option with recent GCC or Clang versions on any
  301. arch as just as fast code can be generated in a safe
  302. way too (using __builtin_assume_aligned + memcpy).
  303. However, this option might improve performance in some
  304. other cases, especially with old compilers (for example,
  305. GCC 3 and early 4.x on x86, GCC < 6 on ARMv6 and ARMv7).
  306. --enable-small
  307. Reduce the size of liblzma by selecting smaller but
  308. semantically equivalent version of some functions, and
  309. omit precomputed lookup tables. This option tends to
  310. make liblzma slightly slower.
  311. Note that while omitting the precomputed tables makes
  312. liblzma smaller on disk, the tables are still needed at
  313. run time, and need to be computed at startup. This also
  314. means that the RAM holding the tables won't be shared
  315. between applications linked against shared liblzma.
  316. This option doesn't modify CFLAGS to tell the compiler
  317. to optimize for size. You need to add -Os or equivalent
  318. flag(s) to CFLAGS manually.
  319. --enable-assume-ram=SIZE
  320. On the most common operating systems, XZ Utils is able to
  321. detect the amount of physical memory on the system. This
  322. information is used by the options --memlimit-compress,
  323. --memlimit-decompress, and --memlimit when setting the
  324. limit to a percentage of total RAM.
  325. On some systems, there is no code to detect the amount of
  326. RAM though. Using --enable-assume-ram one can set how much
  327. memory to assume on these systems. SIZE is given as MiB.
  328. The default is 128 MiB.
  329. Feel free to send patches to add support for detecting
  330. the amount of RAM on the operating system you use. See
  331. src/common/tuklib_physmem.c for details.
  332. --enable-threads=METHOD
  333. Threading support is enabled by default so normally there
  334. is no need to specify this option.
  335. Supported values for METHOD:
  336. yes Autodetect the threading method. If none
  337. is found, configure will give an error.
  338. posix Use POSIX pthreads. This is the default
  339. except on Windows outside Cygwin.
  340. win95 Use Windows 95 compatible threads. This
  341. is compatible with Windows XP and later
  342. too. This is the default for 32-bit x86
  343. Windows builds. The `win95' threading is
  344. incompatible with --enable-small.
  345. vista Use Windows Vista compatible threads. The
  346. resulting binaries won't run on Windows XP
  347. or older. This is the default for Windows
  348. excluding 32-bit x86 builds (that is, on
  349. x86-64 the default is `vista').
  350. no Disable threading support. This is the
  351. same as using --disable-threads.
  352. NOTE: If combined with --enable-small
  353. and the compiler doesn't support
  354. __attribute__((__constructor__)), the
  355. resulting liblzma won't be thread safe,
  356. that is, if a multi-threaded application
  357. calls any liblzma functions from more than
  358. one thread, something bad may happen.
  359. --enable-sandbox=METHOD
  360. There is limited sandboxing support in the xz tool. If
  361. built with sandbox support, it's used automatically when
  362. (de)compressing exactly one file to standard output and
  363. the options --files or --files0 weren't used. This is a
  364. common use case, for example, (de)compressing .tar.xz
  365. files via GNU tar. The sandbox is also used for
  366. single-file `xz --test' or `xz --list'.
  367. Supported METHODs:
  368. auto Look for a supported sandboxing method
  369. and use it if found. If no method is
  370. found, then sandboxing isn't used.
  371. This is the default.
  372. no Disable sandboxing support.
  373. capsicum
  374. Use Capsicum (FreeBSD >= 10) for
  375. sandboxing. If no Capsicum support
  376. is found, configure will give an error.
  377. pledge Use pledge(2) (OpenBSD >= 5.9) for
  378. sandboxing. If pledge(2) isn't found,
  379. configure will give an error.
  380. --enable-symbol-versions
  381. Use symbol versioning for liblzma. This is enabled by
  382. default on GNU/Linux, other GNU-based systems, and
  383. FreeBSD.
  384. --enable-debug
  385. This enables the assert() macro and possibly some other
  386. run-time consistency checks. It makes the code slower, so
  387. you normally don't want to have this enabled.
  388. --enable-werror
  389. If building with GCC, make all compiler warnings an error,
  390. that abort the compilation. This may help catching bugs,
  391. and should work on most systems. This has no effect on the
  392. resulting binaries.
  393. --enable-path-for-scripts=PREFIX
  394. If PREFIX isn't empty, PATH=PREFIX:$PATH will be set in
  395. the beginning of the scripts (xzgrep and others).
  396. The default is empty except on Solaris the default is
  397. /usr/xpg4/bin.
  398. This can be useful if the default PATH doesn't contain
  399. modern POSIX tools (as can be the case on Solaris) or if
  400. one wants to ensure that the correct xz binary is in the
  401. PATH for the scripts. Note that the latter use can break
  402. "make check" if the prefixed PATH causes a wrong xz binary
  403. (other than the one that was just built) to be used.
  404. Older xz releases support a different method for setting
  405. the PATH for the scripts. It is described in section 3.2
  406. and is supported in this xz version too.
  407. 2.1. Static vs. dynamic linking of liblzma
  408. On 32-bit x86, linking against static liblzma can give a minor
  409. speed improvement. Static libraries on x86 are usually compiled as
  410. position-dependent code (non-PIC) and shared libraries are built as
  411. position-independent code (PIC). PIC wastes one register, which can
  412. make the code slightly slower compared to a non-PIC version. (Note
  413. that this doesn't apply to x86-64.)
  414. If you want to link xz against static liblzma, the simplest way
  415. is to pass --disable-shared to configure. If you want also shared
  416. liblzma, run configure again and run "make install" only for
  417. src/liblzma.
  418. 2.2. Optimizing xzdec and lzmadec
  419. xzdec and lzmadec are intended to be relatively small instead of
  420. optimizing for the best speed. Thus, it is a good idea to build
  421. xzdec and lzmadec separately:
  422. - To link the tools against static liblzma, pass --disable-shared
  423. to configure.
  424. - To select somewhat size-optimized variant of some things in
  425. liblzma, pass --enable-small to configure.
  426. - Tell the compiler to optimize for size instead of speed.
  427. For example, with GCC, put -Os into CFLAGS.
  428. - xzdec and lzmadec will never use multithreading capabilities of
  429. liblzma. You can avoid dependency on libpthread by passing
  430. --disable-threads to configure.
  431. - There are and will be no translated messages for xzdec and
  432. lzmadec, so it is fine to pass also --disable-nls to configure.
  433. - Only decoder code is needed, so you can speed up the build
  434. slightly by passing --disable-encoders to configure. This
  435. shouldn't affect the final size of the executables though,
  436. because the linker is able to omit the encoder code anyway.
  437. If you have no use for xzdec or lzmadec, you can disable them with
  438. --disable-xzdec and --disable-lzmadec.
  439. 3. xzgrep and other scripts
  440. ---------------------------
  441. 3.1. Dependencies
  442. POSIX shell (sh) and bunch of other standard POSIX tools are required
  443. to run the scripts. The configure script tries to find a POSIX
  444. compliant sh, but if it fails, you can force the shell by passing
  445. gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
  446. script.
  447. xzdiff (xzcmp/lzdiff/lzcmp) may use mktemp if it is available. As
  448. a fallback xzdiff will use mkdir to securely create a temporary
  449. directory. Having mktemp available is still recommended since the
  450. mkdir fallback method isn't as robust as mktemp is. The original
  451. mktemp can be found from <http://www.mktemp.org/>. On GNU, most will
  452. use the mktemp program from GNU coreutils instead of the original
  453. implementation. Both mktemp versions are fine.
  454. In addition to using xz to decompress .xz files, xzgrep and xzdiff
  455. use gzip, bzip2, and lzop to support .gz, bz2, and .lzo files.
  456. 3.2. PATH
  457. The method described below is supported by older xz releases.
  458. It is supported by the current version too, but the newer
  459. --enable-path-for-scripts=PREFIX described in section 2 may be
  460. more convenient.
  461. The scripts assume that the required tools (standard POSIX utilities,
  462. mktemp, and xz) are in PATH; the scripts don't set the PATH themselves
  463. (except as described for --enable-path-for-scripts=PREFIX). Some
  464. people like this while some think this is a bug. Those in the latter
  465. group can easily patch the scripts before running the configure script
  466. by taking advantage of a placeholder line in the scripts.
  467. For example, to make the scripts prefix /usr/bin:/bin to PATH:
  468. perl -pi -e 's|^#SET_PATH.*$|PATH=/usr/bin:/bin:\$PATH|' \
  469. src/scripts/xz*.in
  470. 4. Troubleshooting
  471. ------------------
  472. 4.1. "No C99 compiler was found."
  473. You need a C99 compiler to build XZ Utils. If the configure script
  474. cannot find a C99 compiler and you think you have such a compiler
  475. installed, set the compiler command by passing CC=/path/to/c99 as
  476. an argument to the configure script.
  477. If you get this error even when you think your compiler supports C99,
  478. you can override the test by passing ac_cv_prog_cc_c99= as an argument
  479. to the configure script. The test for C99 compiler is not perfect (and
  480. it is not as easy to make it perfect as it sounds), so sometimes this
  481. may be needed. You will get a compile error if your compiler doesn't
  482. support enough C99.
  483. 4.2. "No POSIX conforming shell (sh) was found."
  484. xzgrep and other scripts need a shell that (roughly) conforms
  485. to POSIX. The configure script tries to find such a shell. If
  486. it fails, you can force the shell to be used by passing
  487. gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
  488. script. Alternatively you can omit the installation of scripts and
  489. this error by passing --disable-scripts to configure.
  490. 4.3. configure works but build fails at crc32_x86.S
  491. The easy fix is to pass --disable-assembler to the configure script.
  492. The configure script determines if assembler code can be used by
  493. looking at the configure triplet; there is currently no check if
  494. the assembler code can actually actually be built. The x86 assembler
  495. code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
  496. Cygwin, and DJGPP. On other x86 systems, there may be problems and
  497. the assembler code may need to be disabled with the configure option.
  498. If you get this error when building for x86-64, you have specified or
  499. the configure script has misguessed your architecture. Pass the
  500. correct configure triplet using the --build=CPU-COMPANY-SYSTEM option
  501. (see INSTALL.generic).
  502. 4.4. Lots of warnings about symbol visibility
  503. On some systems where symbol visibility isn't supported, GCC may
  504. still accept the visibility options and attributes, which will make
  505. configure think that visibility is supported. This will result in
  506. many compiler warnings. You can avoid the warnings by forcing the
  507. visibility support off by passing gl_cv_cc_visibility=no as an
  508. argument to the configure script. This has no effect on the
  509. resulting binaries, but fewer warnings looks nicer and may allow
  510. using --enable-werror.
  511. 4.5. "make check" fails
  512. If the other tests pass but test_scripts.sh fails, then the problem
  513. is in the scripts in src/scripts. Comparing the contents of
  514. tests/xzgrep_test_output to tests/xzgrep_expected_output might
  515. give a good idea about problems in xzgrep. One possibility is that
  516. some tools are missing from the current PATH or the tools lack
  517. support for some POSIX features. This can happen at least on
  518. Solaris where the tools in /bin may be ancient but good enough
  519. tools are available in /usr/xpg4/bin or /usr/xpg6/bin. For possible
  520. fixes, see --enable-path-for-scripts=PREFIX in section 2 and the
  521. older alternative method described in section 3.2 of this file.
  522. If tests other than test_scripts.sh fail, a likely reason is that
  523. libtool links the test programs against an installed version of
  524. liblzma instead of the version that was just built. This is
  525. obviously a bug which seems to happen on some platforms.
  526. A workaround is to uninstall the old liblzma versions first.
  527. If the problem isn't any of those described above, then it's likely
  528. a bug in XZ Utils or in the compiler. See the platform-specific
  529. notes in this file for possible known problems. Please report
  530. a bug if you cannot solve the problem. See README for contact
  531. information.
  532. 4.6. liblzma.so (or similar) not found when running xz
  533. If you installed the package with "make install" and get an error
  534. about liblzma.so (or a similarly named file) being missing, try
  535. running "ldconfig" to update the run-time linker cache (if your
  536. operating system has such a command).