OLD | NEW |
1 | 1 |
2 XZ Utils Installation | 2 XZ Utils Installation |
3 ===================== | 3 ===================== |
4 | 4 |
5 0. Preface | 5 0. Preface |
6 1. Supported platforms | 6 1. Supported platforms |
7 1.1. Compilers | 7 1.1. Compilers |
8 1.2. Platform-specific notes | 8 1.2. Platform-specific notes |
9 1.2.1. IRIX | 9 1.2.1. IRIX |
10 1.2.2. Tru64 | 10 1.2.2. MINIX 3 |
11 1.2.3. Windows | 11 1.2.3. OpenVMS |
12 1.2.4. DOS | 12 1.2.4. Solaris, OpenSolaris, and derivatives |
13 1.2.5. OS/2 | 13 1.2.5. Tru64 |
14 1.2.6. OpenVMS | 14 1.2.6. Windows |
| 15 1.2.7. DOS |
15 1.3. Adding support for new platforms | 16 1.3. Adding support for new platforms |
16 2. configure options | 17 2. configure options |
| 18 2.1. Static vs. dynamic linking of liblzma |
| 19 2.2. Optimizing xzdec and lzmadec |
17 3. xzgrep and other scripts | 20 3. xzgrep and other scripts |
18 3.1. Dependencies | 21 3.1. Dependencies |
19 3.2. PATH | 22 3.2. PATH |
20 4. Troubleshooting | 23 4. Troubleshooting |
21 4.1. "No C99 compiler was found." | 24 4.1. "No C99 compiler was found." |
22 4.1. "No POSIX conforming shell (sh) was found." | 25 4.2. "No POSIX conforming shell (sh) was found." |
23 4.2. configure works but build fails at crc32_x86.S | 26 4.3. configure works but build fails at crc32_x86.S |
| 27 4.4. Lots of warnings about symbol visibility |
24 | 28 |
25 | 29 |
26 0. Preface | 30 0. Preface |
27 ---------- | 31 ---------- |
28 | 32 |
29 If you aren't familiar with building packages that use GNU Autotools, | 33 If you aren't familiar with building packages that use GNU Autotools, |
30 see the file INSTALL.generic for generic instructions before reading | 34 see the file INSTALL.generic for generic instructions before reading |
31 further. | 35 further. |
32 | 36 |
33 If you are going to build a package for distribution, see also the | 37 If you are going to build a package for distribution, see also the |
(...skipping 24 matching lines...) Expand all Loading... |
58 | 62 |
59 | 63 |
60 1.2. Platform-specific notes | 64 1.2. Platform-specific notes |
61 | 65 |
62 1.2.1. IRIX | 66 1.2.1. IRIX |
63 | 67 |
64 MIPSpro 7.4.4m has been reported to produce broken code if using | 68 MIPSpro 7.4.4m has been reported to produce broken code if using |
65 the -O2 optimization flag ("make check" fails). Using -O1 should | 69 the -O2 optimization flag ("make check" fails). Using -O1 should |
66 work. | 70 work. |
67 | 71 |
| 72 A problem has been reported when using shared liblzma. Passing |
| 73 --disable-shared to configure works around this. Alternatively, |
| 74 putting "-64" to CFLAGS to build a 64-bit version might help too. |
68 | 75 |
69 1.2.2. Tru64 | 76 |
| 77 1.2.2. MINIX 3 |
| 78 |
| 79 The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK), |
| 80 which doesn't support C99. Install GCC to compile XZ Utils. |
| 81 |
| 82 MINIX 3.1.8 (and possibly some other versions too) has bugs in |
| 83 /usr/include/stdint.h, which has to be patched before XZ Utils |
| 84 can be compiled correctly. See |
| 85 <http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tra
cker_item_id=537>. |
| 86 |
| 87 XZ Utils doesn't have code to detect the amount of physical RAM and |
| 88 number of CPU cores on MINIX 3. |
| 89 |
| 90 See section 4.4 in this file about symbol visibility warnings (you |
| 91 may want to pass gl_cv_cc_visibility=no to configure). |
| 92 |
| 93 |
| 94 1.2.3. OpenVMS |
| 95 |
| 96 XZ Utils can be built for OpenVMS, but the build system files |
| 97 are not included in the XZ Utils source package. The required |
| 98 OpenVMS-specific files are maintained by Jouk Jansen and can be |
| 99 downloaded here: |
| 100 |
| 101 http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils |
| 102 |
| 103 |
| 104 1.2.4. Solaris, OpenSolaris, and derivatives |
| 105 |
| 106 The following linker error has been reported on some x86 systems: |
| 107 |
| 108 ld: fatal: relocation error: R_386_GOTOFF: ... |
| 109 |
| 110 This can be worked around by passing gl_cv_cc_visibility=no |
| 111 as an argument to the configure script. |
| 112 |
| 113 |
| 114 1.2.5. Tru64 |
70 | 115 |
71 If you try to use the native C compiler on Tru64 (passing CC=cc to | 116 If you try to use the native C compiler on Tru64 (passing CC=cc to |
72 configure), it is possible that the configure script will complain | 117 configure), you may need the workaround mention in section 4.1 in |
73 that no C99 compiler was found even when the native compiler supports | 118 this file (pass also ac_cv_prog_cc_c99= to configure). |
74 C99. You can safely override the test for C99 compiler by passing | |
75 ac_cv_prog_cc_c99= as the argument to the configure script. | |
76 | 119 |
77 | 120 |
78 1.2.3. Windows | 121 1.2.6. Windows |
79 | 122 |
80 Building XZ Utils on Windows is supported under MinGW + MSYS and | 123 Building XZ Utils on Windows is supported under MinGW + MSYS, |
81 Cygwin. There is windows/build.sh to ease packaging XZ Utils with | 124 MinGW-w64 + MSYS, and Cygwin. There is windows/build.bash to |
82 MinGW + MSYS into a redistributable .zip or .7z file. See | 125 ease packaging XZ Utils with MinGW(-w64) + MSYS into a |
83 windows/INSTALL-Windows.txt for more information. | 126 redistributable .zip or .7z file. See windows/INSTALL-Windows.txt |
| 127 for more information. |
84 | 128 |
85 It might be possible to build liblzma with a non-GNU toolchain too, | 129 It might be possible to build liblzma with a non-GNU toolchain too, |
86 but that will probably require writing a separate makefile. Building | 130 but that will probably require writing a separate makefile. Building |
87 the command line tools with non-GNU toolchains will be harder than | 131 the command line tools with non-GNU toolchains will be harder than |
88 building only liblzma. | 132 building only liblzma. |
89 | 133 |
90 Even if liblzma is built with MinGW, the resulting DLL or static | 134 Even if liblzma is built with MinGW, the resulting DLL or static |
91 library can be used by other compilers and linkers, including MSVC. | 135 library can be used by other compilers and linkers, including MSVC. |
92 Thus, it shouldn't be a problem to use MinGW to build liblzma even | 136 Thus, it shouldn't be a problem to use MinGW to build liblzma even |
93 if you cannot use MinGW to build the rest of your project. See | 137 if you cannot use MinGW to build the rest of your project. See |
94 windows/README-Windows.txt for details. | 138 windows/README-Windows.txt for details. |
95 | 139 |
96 | 140 |
97 1.2.4. DOS | 141 1.2.7. DOS |
98 | 142 |
99 There is an experimental Makefile in the "dos" directory to build | 143 There is an experimental Makefile in the "dos" directory to build |
100 XZ Utils on DOS using DJGPP. Support for long file names (LFN) is | 144 XZ Utils on DOS using DJGPP. Support for long file names (LFN) is |
101 needed. See dos/README for more information. | 145 needed. See dos/README for more information. |
102 | 146 |
103 GNU Autotools based build hasn't been tried on DOS. If you try, I | 147 GNU Autotools based build hasn't been tried on DOS. If you try, I |
104 would like to hear if it worked. | 148 would like to hear if it worked. |
105 | 149 |
106 | 150 |
107 1.2.5. OS/2 | |
108 | |
109 To omit large number of harmless warnings about visibility support, | |
110 pass gl_cv_cc_visibility=no as an argument to the configure script. | |
111 This isn't mandatory since it should have no effect on the resulting | |
112 binaries. | |
113 | |
114 | |
115 1.2.6. OpenVMS | |
116 | |
117 XZ Utils can be built for OpenVMS, but the build system files are | |
118 currently not included in the XZ Utils source package. The required | |
119 OpenVMS-specific files are maintained by Jouk Jansen and can be | |
120 downloaded here: | |
121 | |
122 http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils | |
123 | |
124 | |
125 1.3. Adding support for new platforms | 151 1.3. Adding support for new platforms |
126 | 152 |
127 If you have written patches to make XZ Utils to work on previously | 153 If you have written patches to make XZ Utils to work on previously |
128 unsupported platform, please send the patches to me! I will consider | 154 unsupported platform, please send the patches to me! I will consider |
129 including them to the official version. It's nice to minimize the | 155 including them to the official version. It's nice to minimize the |
130 need of third-party patching. | 156 need of third-party patching. |
131 | 157 |
132 One exception: Don't request or send patches to change the whole | 158 One exception: Don't request or send patches to change the whole |
133 source package to C89. I find C99 substantially nicer to write and | 159 source package to C89. I find C99 substantially nicer to write and |
134 maintain. However, the public library headers must be in C89 to | 160 maintain. However, the public library headers must be in C89 to |
135 avoid frustrating those who maintain programs, which are strictly | 161 avoid frustrating those who maintain programs, which are strictly |
136 in C89 or C++. | 162 in C89 or C++. |
137 | 163 |
138 | 164 |
139 2. configure options | 165 2. configure options |
140 -------------------- | 166 -------------------- |
141 | 167 |
142 In most cases, the defaults are what you want. Most of the options | 168 In most cases, the defaults are what you want. Many of the options |
143 below are useful only when building a size-optimized version of | 169 below are useful only when building a size-optimized version of |
144 liblzma or command line tools. | 170 liblzma or command line tools. |
145 | 171 |
146 --enable-encoders=LIST | 172 --enable-encoders=LIST |
147 --disable-encoders | 173 --disable-encoders |
148 Specify a comma-separated LIST of filter encoders to | 174 Specify a comma-separated LIST of filter encoders to |
149 build. See "./configure --help" for exact list of | 175 build. See "./configure --help" for exact list of |
150 available filter encoders. The default is to build all | 176 available filter encoders. The default is to build all |
151 supported encoders. | 177 supported encoders. |
152 | 178 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 for exact list of available integrity check types. | 211 for exact list of available integrity check types. |
186 | 212 |
187 liblzma and the command line tools can decompress files | 213 liblzma and the command line tools can decompress files |
188 which use unsupported integrity check type, but naturally | 214 which use unsupported integrity check type, but naturally |
189 the file integrity cannot be verified in that case. | 215 the file integrity cannot be verified in that case. |
190 | 216 |
191 Disabling integrity checks may remove some symbols from | 217 Disabling integrity checks may remove some symbols from |
192 the liblzma ABI, so this option should be used only when | 218 the liblzma ABI, so this option should be used only when |
193 it is known to not cause problems. | 219 it is known to not cause problems. |
194 | 220 |
| 221 --disable-xz |
| 222 --disable-xzdec |
| 223 --disable-lzmadec |
| 224 --disable-lzmainfo |
| 225 Don't build and install the command line tool mentioned |
| 226 in the option name. |
| 227 |
| 228 NOTE: Disabling xz will skip some tests in "make check". |
| 229 |
| 230 NOTE: If xzdec is disabled and lzmadec is left enabled, |
| 231 a dangling man page symlink lzmadec.1 -> xzdec.1 is |
| 232 created. |
| 233 |
| 234 --disable-lzma-links |
| 235 Don't create symlinks for LZMA Utils compatibility. |
| 236 This includes lzma, unlzma, and lzcat. If scripts are |
| 237 installed, also lzdiff, lzcmp, lzgrep, lzegrep, lzfgrep, |
| 238 lzmore, and lzless will be omitted if this option is used. |
| 239 |
| 240 --disable-scripts |
| 241 Don't install the scripts xzdiff, xzgrep, xzmore, xzless, |
| 242 and their symlinks. |
| 243 |
195 --disable-assembler | 244 --disable-assembler |
196 liblzma includes some assembler optimizations. Currently | 245 liblzma includes some assembler optimizations. Currently |
197 there is only assembler code for CRC32 and CRC64 for | 246 there is only assembler code for CRC32 and CRC64 for |
198 32-bit x86. | 247 32-bit x86. |
199 | 248 |
200 All the assembler code in liblzma is position-independent | 249 All the assembler code in liblzma is position-independent |
201 code, which is suitable for use in shared libraries and | 250 code, which is suitable for use in shared libraries and |
202 position-independent executables. So far only i386 | 251 position-independent executables. So far only i386 |
203 instructions are used, but the code is optimized for i686 | 252 instructions are used, but the code is optimized for i686 |
204 class CPUs. If you are compiling liblzma exclusively for | 253 class CPUs. If you are compiling liblzma exclusively for |
(...skipping 23 matching lines...) Expand all Loading... |
228 means that the RAM holding the tables won't be shared | 277 means that the RAM holding the tables won't be shared |
229 between applications linked against shared liblzma. | 278 between applications linked against shared liblzma. |
230 | 279 |
231 This option doesn't modify CFLAGS to tell the compiler | 280 This option doesn't modify CFLAGS to tell the compiler |
232 to optimize for size. You need to add -Os or equivalent | 281 to optimize for size. You need to add -Os or equivalent |
233 flag(s) to CFLAGS manually. | 282 flag(s) to CFLAGS manually. |
234 | 283 |
235 --enable-assume-ram=SIZE | 284 --enable-assume-ram=SIZE |
236 On the most common operating systems, XZ Utils is able to | 285 On the most common operating systems, XZ Utils is able to |
237 detect the amount of physical memory on the system. This | 286 detect the amount of physical memory on the system. This |
238 information is used to set the default memory usage limit. | 287 information is used by the options --memlimit-compress, |
| 288 --memlimit-decompress, and --memlimit when setting the |
| 289 limit to a percentage of total RAM. |
239 | 290 |
240 On some systems, there is no code to detect the amount of | 291 On some systems, there is no code to detect the amount of |
241 RAM though. Using --enable-assume-ram one can set how much | 292 RAM though. Using --enable-assume-ram one can set how much |
242 memory to assume on these systems. SIZE is given as MiB. | 293 memory to assume on these systems. SIZE is given as MiB. |
243 The default is 128 MiB, which allows decompressing files | 294 The default is 128 MiB. |
244 created with "xz -9". | |
245 | 295 |
246 Feel free to send patches to add support for detecting | 296 Feel free to send patches to add support for detecting |
247 the amount of RAM on the operating system you use. See | 297 the amount of RAM on the operating system you use. See |
248 src/common/tuklib_physmem.c for details. | 298 src/common/tuklib_physmem.c for details. |
249 | 299 |
250 --disable-threads | 300 --disable-threads |
251 Disable threading support. This makes some things | 301 Disable threading support. This makes some things |
252 thread-unsafe, meaning that if multithreaded application | 302 thread-unsafe, meaning that if multithreaded application |
253 calls liblzma functions from more than one thread, | 303 calls liblzma functions from more than one thread, |
254 something bad may happen. | 304 something bad may happen. |
255 | 305 |
256 Use this option if threading support causes you trouble, | 306 Use this option if threading support causes you trouble, |
257 or if you know that you will use liblzma only from | 307 or if you know that you will use liblzma only from |
258 single-threaded applications and want to avoid dependency | 308 single-threaded applications and want to avoid dependency |
259 on libpthread. | 309 on libpthread. |
260 | 310 |
261 --enable-dynamic=TYPE | |
262 Specify how command line tools should be linked against | |
263 liblzma. Possible TYPES: | |
264 | |
265 yes All command line tools are linked against | |
266 shared liblzma (if shared liblzma was built). | |
267 This is equivalent to --enable-dynamic (i.e. | |
268 no =TYPE). | |
269 | |
270 mixed Some tools are linked against static liblzma | |
271 and some against shared liblzma. This is the | |
272 default and recommended way. | |
273 | |
274 no All command line tools are linked against | |
275 static liblzma (if static liblzma was built). | |
276 This is equivalent to --disable-dynamic. | |
277 | |
278 This option is mostly useful for packagers, if distro | |
279 policy requires linking against shared libaries. See the | |
280 file PACKAGERS for more information about pros and cons | |
281 of this option. | |
282 | |
283 --enable-debug | 311 --enable-debug |
284 This enables the assert() macro and possibly some other | 312 This enables the assert() macro and possibly some other |
285 run-time consistency checks. It makes the code slower, so | 313 run-time consistency checks. It makes the code slower, so |
286 you normally don't want to have this enabled. | 314 you normally don't want to have this enabled. |
287 | 315 |
288 --enable-werror | 316 --enable-werror |
289 If building with GCC, make all compiler warnings an error, | 317 If building with GCC, make all compiler warnings an error, |
290 that abort the compilation. This may help catching bugs, | 318 that abort the compilation. This may help catching bugs, |
291 and should work on most systems. This has no effect on the | 319 and should work on most systems. This has no effect on the |
292 resulting binaries. | 320 resulting binaries. |
293 | 321 |
294 | 322 |
| 323 2.1. Static vs. dynamic linking of liblzma |
| 324 |
| 325 On 32-bit x86, linking against static liblzma can give a minor |
| 326 speed improvement. Static libraries on x86 are usually compiled as |
| 327 position-dependent code (non-PIC) and shared libraries are built as |
| 328 position-independent code (PIC). PIC wastes one register, which can |
| 329 make the code slightly slower compared to a non-PIC version. (Note |
| 330 that this doesn't apply to x86-64.) |
| 331 |
| 332 If you want to link xz against static liblzma, the simplest way |
| 333 is to pass --disable-shared to configure. If you want also shared |
| 334 liblzma, run configure again and run "make install" only for |
| 335 src/liblzma. |
| 336 |
| 337 |
| 338 2.2. Optimizing xzdec and lzmadec |
| 339 |
| 340 xzdec and lzmadec are intended to be relatively small instead of |
| 341 optimizing for the best speed. Thus, it is a good idea to build |
| 342 xzdec and lzmadec separately: |
| 343 |
| 344 - To link the tools against static liblzma, pass --disable-shared |
| 345 to configure. |
| 346 |
| 347 - To select somewhat size-optimized variant of some things in |
| 348 liblzma, pass --enable-small to configure. |
| 349 |
| 350 - Tell the compiler to optimize for size instead of speed. |
| 351 E.g. with GCC, put -Os into CFLAGS. |
| 352 |
| 353 - xzdec and lzmadec will never use multithreading capabilities of |
| 354 liblzma. You can avoid dependency on libpthread by passing |
| 355 --disable-threads to configure. |
| 356 |
| 357 - There are and will be no translated messages for xzdec and |
| 358 lzmadec, so it is fine to pass also --disable-nls to configure. |
| 359 |
| 360 - Only decoder code is needed, so you can speed up the build |
| 361 slightly by passing --disable-encoders to configure. This |
| 362 shouldn't affect the final size of the executables though, |
| 363 because the linker is able to omit the encoder code anyway. |
| 364 |
| 365 If you have no use for xzdec or lzmadec, you can disable them with |
| 366 --disable-xzdec and --disable-lzmadec. |
| 367 |
| 368 |
295 3. xzgrep and other scripts | 369 3. xzgrep and other scripts |
296 --------------------------- | 370 --------------------------- |
297 | 371 |
298 3.1. Dependencies | 372 3.1. Dependencies |
299 | 373 |
300 POSIX shell (sh) and bunch of other standard POSIX tools are required | 374 POSIX shell (sh) and bunch of other standard POSIX tools are required |
301 to run the scripts. The configure script tries to find a POSIX | 375 to run the scripts. The configure script tries to find a POSIX |
302 compliant sh, but if it fails, you can force the shell by passing | 376 compliant sh, but if it fails, you can force the shell by passing |
303 gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure | 377 gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure |
304 script. | 378 script. |
(...skipping 30 matching lines...) Expand all Loading... |
335 an argument to the configure script. | 409 an argument to the configure script. |
336 | 410 |
337 If you get this error even when you think your compiler supports C99, | 411 If you get this error even when you think your compiler supports C99, |
338 you can override the test by passing ac_cv_prog_cc_c99= as an argument | 412 you can override the test by passing ac_cv_prog_cc_c99= as an argument |
339 to the configure script. The test for C99 compiler is not perfect (and | 413 to the configure script. The test for C99 compiler is not perfect (and |
340 it is not as easy to make it perfect as it sounds), so sometimes this | 414 it is not as easy to make it perfect as it sounds), so sometimes this |
341 may be needed. You will get a compile error if your compiler doesn't | 415 may be needed. You will get a compile error if your compiler doesn't |
342 support enough C99. | 416 support enough C99. |
343 | 417 |
344 | 418 |
345 4.1. "No POSIX conforming shell (sh) was found." | 419 4.2. "No POSIX conforming shell (sh) was found." |
346 | 420 |
347 xzgrep and other scripts need a shell that (roughly) conforms | 421 xzgrep and other scripts need a shell that (roughly) conforms |
348 to POSIX. The configure script tries to find such a shell. If | 422 to POSIX. The configure script tries to find such a shell. If |
349 it fails, you can force the shell to be used by passing | 423 it fails, you can force the shell to be used by passing |
350 gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure | 424 gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure |
351 script. | 425 script. |
352 | 426 |
353 | 427 |
354 4.2. configure works but build fails at crc32_x86.S | 428 4.3. configure works but build fails at crc32_x86.S |
355 | 429 |
356 The easy fix is to pass --disable-assembler to the configure script. | 430 The easy fix is to pass --disable-assembler to the configure script. |
357 | 431 |
358 The configure script determines if assembler code can be used by | 432 The configure script determines if assembler code can be used by |
359 looking at the configure triplet; there is currently no check if | 433 looking at the configure triplet; there is currently no check if |
360 the assembler code can actually actually be built. The x86 assembler | 434 the assembler code can actually actually be built. The x86 assembler |
361 code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW, | 435 code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW, |
362 Cygwin, and DJGPP. On other x86 systems, there may be problems and | 436 Cygwin, and DJGPP. On other x86 systems, there may be problems and |
363 the assembler code may need to be disabled with the configure option. | 437 the assembler code may need to be disabled with the configure option. |
364 | 438 |
365 If you get this error when building for x86-64, you have specified or | 439 If you get this error when building for x86-64, you have specified or |
366 the configure script has misguessed your architecture. Pass the | 440 the configure script has misguessed your architecture. Pass the |
367 correct configure triplet using the --build=CPU-COMPANY-SYSTEM option | 441 correct configure triplet using the --build=CPU-COMPANY-SYSTEM option |
368 (see INSTALL.generic). | 442 (see INSTALL.generic). |
369 | 443 |
| 444 |
| 445 4.4. Lots of warnings about symbol visibility |
| 446 |
| 447 On some systems where symbol visibility isn't supported, GCC may |
| 448 still accept the visibility options and attributes, which will make |
| 449 configure think that visibility is supported. This will result in |
| 450 many compiler warnings. You can avoid the warnings by forcing the |
| 451 visibility support off by passing gl_cv_cc_visibility=no as an |
| 452 argument to the configure script. This has no effect on the |
| 453 resulting binaries, but fewer warnings looks nicer and may allow |
| 454 using --enable-werror. |
| 455 |
OLD | NEW |