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