]> icculus.org git repositories - icculus/xz.git/blob - INSTALL
Added OpenVMS-specific information to INSTALL.
[icculus/xz.git] / INSTALL
1
2 XZ Utils Installation
3 =====================
4
5     0. Preface
6     1. Supported platforms
7        1.1. Compilers
8        1.2. Platform-specific notes
9             1.2.1. Darwin (Mac OS X)
10             1.2.2. Tru64
11             1.2.3. Windows
12             1.2.4. DOS
13             1.2.5. OS/2
14             1.2.6. OpenVMS
15        1.3. Adding support for new platforms
16     2. configure options
17     3. xzgrep and other scripts
18        3.1. Dependencies
19        3.2. PATH
20     4. Troubleshooting
21        4.1. "No C99 compiler was found."
22        4.1. "No POSIX conforming shell (sh) was found."
23        4.2. configure works but build fails at crc32_x86.S
24
25
26 0. Preface
27 ----------
28
29     If you aren't familiar with building packages that use GNU Autotools,
30     see the file INSTALL.generic for generic instructions before reading
31     further.
32
33     If you are going to build a package for distribution, see also the
34     file PACKAGERS. It contains information that should help making the
35     binary packages as good as possible, but the information isn't very
36     interesting to those making local builds for private use or for use
37     in special situations like embedded systems.
38
39
40 1. Supported platforms
41 ----------------------
42
43     XZ Utils are developed on GNU/Linux, but they should work on many
44     POSIX-like operating systems like *BSDs and Solaris, and even on
45     a few non-POSIX operating systems.
46
47
48 1.1. Compilers
49
50     A C99 compiler is required to compile XZ Utils. If you use GCC, you
51     need at least version 3.x.x. GCC version 2.xx.x doesn't support some
52     C99 features used in XZ Utils source code, thus GCC 2 won't compile
53     XZ Utils.
54
55     XZ Utils takes advantage of some GNU C extensions when building
56     with GCC. Because these extensions are used only when building
57     with GCC, it should be possible to use any C99 compiler.
58
59
60 1.2. Platform-specific notes
61
62 1.2.1. Darwin (Mac OS X)
63
64     You may need --disable-assembler if building universal binaries on
65     Darwin. This is because different files are built when assembler is
66     enabled, and there's no way to make it work with universal build.
67     If you want to keep the assembler code, consider building one
68     architecture at a time, and then combining the results to create
69     universal binaries (see lipo(1)).
70
71
72 1.2.2. Tru64
73
74     If you try to use the native C compiler on Tru64 (passing CC=cc to
75     configure), it is possible that the configure script will complain
76     that no C99 compiler was found even when the native compiler supports
77     C99. You can safely override the test for C99 compiler by passing
78     ac_cv_prog_cc_c99= as the argument to the configure script.
79
80
81 1.2.3. Windows
82
83     Building XZ Utils on Windows is supported under MinGW and Cygwin.
84     If the Autotools based build gives you trouble with MinGW, you may
85     want try the alternative method found from the "windows" directory.
86
87     MSVC doesn't support C99, thus it is not possible to use MSVC to
88     compile XZ Utils. However, it is possible to use liblzma.dll from
89     MSVC once liblzma.dll has been built with MinGW. The required
90     import library for MSVC can be created from liblzma.def using the
91     "lib" command shipped in MSVC:
92
93         lib /def:liblzma.def /out:liblzma.lib /machine:ix86
94
95     On x86-64, the /machine argument has to naturally be changed:
96
97         lib /def:liblzma.def /out:liblzma.lib /machine:x64
98
99
100 1.2.4. DOS
101
102     There is an experimental Makefile in the "dos" directory to build
103     XZ Utils on DOS using DJGPP. Support for long file names (LFN) is
104     needed.
105
106     GNU Autotools based build hasn't been tried on DOS.
107
108
109 1.2.5. OS/2
110
111     You will need to pass --disable-assembler to configure when building
112     on OS/2.
113
114     To omit large number of harmless warnings about visibility support,
115     pass gl_cv_cc_visibility=no as an argument to the configure script.
116     This isn't mandatory since it should have no effect on the resulting
117     binaries.
118
119
120 1.2.6. OpenVMS
121
122     XZ Utils can be built for OpenVMS, but the build system files are
123     currently not included in the XZ Utils source package. The required
124     OpenVMS-specific files are maintained by Jouk Jansen and can be
125     downloaded here:
126
127         http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils
128
129
130 1.3. Adding support for new platforms
131
132     If you have written patches to make XZ Utils to work on previously
133     unsupported platform, please send the patches to me! I will consider
134     including them to the official version. It's nice to minimize the
135     need of third-party patching.
136
137     One exception: Don't request or send patches to change the whole
138     source package to C89. I find C99 substantially nicer to write and
139     maintain. However, the public library headers must be in C89 to
140     avoid frustrating those who maintain programs, which are strictly
141     in C89 or C++.
142
143
144 2. configure options
145 --------------------
146
147     In most cases, the defaults are what you want. Most of the options
148     below are useful only when building a size-optimized version of
149     liblzma or command line tools.
150
151     --enable-encoders=LIST
152     --disable-encoders
153                 Specify a comma-separated LIST of filter encoders to
154                 build. See "./configure --help" for exact list of
155                 available filter encoders. The default is to build all
156                 supported encoders.
157
158                 If LIST is empty or --disable-encoders is used, no filter
159                 encoders will be built and also the code shared between
160                 encoders will be omitted.
161
162                 Disabling encoders will remove some symbols from the
163                 liblzma ABI, so this option should be used only when it
164                 is known to not cause problems.
165
166     --enable-decoders=LIST
167     --disable-decoders
168                 This is like --enable-encoders but for decoders. The
169                 default is to build all supported decoders.
170
171     --enable-match-finders=LIST
172                 liblzma includes two categories of match finders:
173                 hash chains and binary trees. Hash chains (hc3 and hc4)
174                 are quite fast but they don't provide the best compression
175                 ratio. Binary trees (bt2, bt3 and bt4) give excellent
176                 compression ratio, but they are slower and need more
177                 memory than hash chains.
178
179                 You need to enable at least one match finder to build the
180                 LZMA1 or LZMA2 filter encoders. Usually hash chains are
181                 used only in the fast mode, while binary trees are used to
182                 when the best compression ratio is wanted.
183
184                 The default is to build all the match finders if LZMA1
185                 or LZMA2 filter encoders are being built.
186
187     --enable-checks=LIST
188                 liblzma support multiple integrity checks. CRC32 is
189                 mandatory, and cannot be omitted. See "./configure --help"
190                 for exact list of available integrity check types.
191
192                 liblzma and the command line tools can decompress files
193                 which use unsupported integrity check type, but naturally
194                 the file integrity cannot be verified in that case.
195
196                 Disabling integrity checks may remove some symbols from
197                 the liblzma ABI, so this option should be used only when
198                 it is known to not cause problems.
199
200     --disable-assembler
201                 liblzma includes some assembler optimizations. Currently
202                 there is only assembler code for CRC32 and CRC64 for
203                 32-bit x86.
204
205                 All the assembler code in liblzma is position-independent
206                 code, which is suitable for use in shared libraries and
207                 position-independent executables. So far only i386
208                 instructions are used, but the code is optimized for i686
209                 class CPUs. If you are compiling liblzma exclusively for
210                 pre-i686 systems, you may want to disable the assembler
211                 code.
212
213     --enable-unaligned-access
214                 Allow liblzma to use unaligned memory access for 16-bit
215                 and 32-bit loads and stores. This should be enabled only
216                 when the hardware supports this, i.e. when unaligned
217                 access is fast. Some operating system kernels emulate
218                 unaligned access, which is extremely slow. This option
219                 shouldn't be used on systems that rely on such emulation.
220
221                 Unaligned access is enabled by default on x86, x86-64,
222                 and big endian PowerPC.
223
224     --enable-small
225                 Reduce the size of liblzma by selecting smaller but
226                 semantically equivalent version of some functions, and
227                 omit precomputed lookup tables. This option tends to
228                 make liblzma slightly slower.
229
230                 Note that while omitting the precomputed tables makes
231                 liblzma smaller on disk, the tables are still needed at
232                 run time, and need to be computed at startup. This also
233                 means that the RAM holding the tables won't be shared
234                 between applications linked against shared liblzma.
235
236                 This option doesn't modify CFLAGS to tell the compiler
237                 to optimize for size. You need to add -Os or equivalent
238                 flag(s) to CFLAGS manually.
239
240     --disable-threads
241                 Disable threading support. This makes some things
242                 thread-unsafe, meaning that if multithreaded application
243                 calls liblzma functions from more than one thread,
244                 something bad may happen.
245
246                 Use this option if threading support causes you trouble,
247                 or if you know that you will use liblzma only from
248                 single-threaded applications and want to avoid dependency
249                 on libpthread.
250
251     --enable-dynamic=TYPE
252                 Specify how command line tools should be linked against
253                 liblzma. Possible TYPES:
254
255                     yes     All command line tools are linked against
256                             shared liblzma (if shared liblzma was built).
257                             This is equivalent to --enable-dynamic (i.e.
258                             no =TYPE).
259
260                     mixed   Some tools are linked against static liblzma
261                             and some against shared liblzma. This is the
262                             default and recommended way.
263
264                     no      All command line tools are linked against
265                             static liblzma (if static liblzma was built).
266                             This is equivalent to --disable-dynamic.
267
268                 This option is mostly useful for packagers, if distro
269                 policy requires linking against shared libaries. See the
270                 file PACKAGERS for more information about pros and cons
271                 of this option.
272
273     --enable-debug
274                 This enables the assert() macro and possibly some other
275                 run-time consistency checks. It makes the code slower, so
276                 you normally don't want to have this enabled.
277
278     --enable-werror
279                 If building with GCC, make all compiler warnings an error,
280                 that abort the compilation. This may help catching bugs,
281                 and should work on most systems. This has no effect on the
282                 resulting binaries.
283
284
285 3. xzgrep and other scripts
286 ---------------------------
287
288 3.1. Dependencies
289
290     POSIX shell (sh) and bunch of other standard POSIX tools are required
291     to run the scripts. The configure script tries to find a POSIX
292     compliant sh, but if it fails, you can force the shell by passing
293     gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
294     script.
295
296     Some of the scripts require also mktemp. The original mktemp can be
297     found from <http://www.mktemp.org/>. On GNU, most will use the mktemp
298     program from GNU coreutils instead of the original implementation.
299     Both mktemp versions are fine for XZ Utils (and practically for
300     everything else too).
301
302
303 3.2. PATH
304
305     The scripts assume that the required tools (standard POSIX utilities,
306     mktemp, and xz) are in PATH; the scripts don't set the PATH themselves.
307     Some people like this while some think this is a bug. Those in the
308     latter group can easily patch the scripts before running the configure
309     script by taking advantage of a placeholder line in the scripts.
310
311     For example, to make the scripts prefix /usr/bin:/bin to PATH:
312
313         perl -pi -e 's|^#SET_PATH.*$|PATH=/usr/bin:/bin:\$PATH|' \
314                 src/scripts/xz*.in
315
316
317 4. Troubleshooting
318 ------------------
319
320 4.1. "No C99 compiler was found."
321
322     You need a C99 compiler to build XZ Utils. If the configure script
323     cannot find a C99 compiler and you think you have such a compiler
324     installed, set the compiler command by passing CC=/path/to/c99 as
325     an argument to the configure script.
326
327     If you get this error even when you think your compiler supports C99,
328     you can override the test by passing ac_cv_prog_cc_c99= as an argument
329     to the configure script. The test for C99 compiler is not perfect (and
330     it is not as easy to make it perfect as it sounds), so sometimes this
331     may be needed. You will get a compile error if your compiler doesn't
332     support enough C99.
333
334
335 4.1. "No POSIX conforming shell (sh) was found."
336
337     xzgrep and other scripts need a shell that (roughly) conforms
338     to POSIX. The configure script tries to find such a shell. If
339     it fails, you can force the shell to be used by passing
340     gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
341     script.
342
343
344 4.2. configure works but build fails at crc32_x86.S
345
346     The easy fix is to pass --disable-assembler to the configure script.
347
348     The configure script determines if assembler code can be used by
349     looking at the configure triplet; there is currently no check if
350     the assembler code can actually actually be built. The x86 assembler
351     code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
352     Cygwin, and DJGPP. On other x86 systems, there may be problems and
353     the assembler code may need to be disabled with the configure option.
354
355     If you get this error when building for x86-64, you have specified or
356     the configure script has misguessed your architecture. Pass the
357     correct configure triplet using the --build=CPU-COMPANY-SYSTEM option
358     (see INSTALL.generic).
359