8 1.2. Platform-specific notes
9 1.2.1. Darwin (Mac OS X)
14 1.3. Adding support for new platforms
16 3. xzgrep and other scripts
20 4.1. "No C99 compiler was found."
21 4.1. "No POSIX conforming shell (sh) was found."
22 4.2. configure works but build fails at crc32_x86.S
28 If you aren't familiar with building packages that use GNU Autotools,
29 see the file INSTALL.generic for generic instructions before reading
32 If you are going to build a package for distribution, see also the
33 file PACKAGERS. It contains information that should help making the
34 binary packages as good as possible, but the information isn't very
35 interesting to those making local builds for private use or for use
36 in special situations like embedded systems.
39 1. Supported platforms
40 ----------------------
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.
49 A C99 compiler is required to compile XZ Utils. If you use GCC, you
50 need at least version 3.x.x. GCC version 2.xx.x doesn't support some
51 C99 features used in XZ Utils source code, thus GCC 2 won't compile
54 XZ Utils takes advantage of some GNU C extensions when building
55 with GCC. Because these extensions are used only when building
56 with GCC, it should be possible to use any C99 compiler.
59 1.2. Platform-specific notes
61 1.2.1. Darwin (Mac OS X)
63 You may need --disable-assembler if building universal binaries on
64 Darwin. This is because different files are built when assembler is
65 enabled, and there's no way to make it work with universal build.
66 If you want to keep the assembler code, consider building one
67 architecture at a time, and then combining the results to create
68 universal binaries (see lipo(1)).
73 If you try to use the native C compiler on Tru64 (passing CC=cc to
74 configure), it is possible that the configure script will complain
75 that no C99 compiler was found even when the native compiler supports
76 C99. You can safely override the test for C99 compiler by passing
77 ac_cv_prog_cc_c99= as the argument to the configure script.
82 Building XZ Utils on Windows is supported under MinGW and Cygwin.
83 If the Autotools based build gives you trouble with MinGW, you may
84 want try the alternative method found from the "windows" directory.
86 MSVC doesn't support C99, thus it is not possible to use MSVC to
87 compile XZ Utils. However, it is possible to use liblzma.dll from
88 MSVC once liblzma.dll has been built with MinGW. The required
89 import library for MSVC can be created from liblzma.def using the
90 "lib" command shipped in MSVC:
92 lib /def:liblzma.def /out:liblzma.lib /machine:ix86
94 On x86-64, the /machine argument has to naturally be changed:
96 lib /def:liblzma.def /out:liblzma.lib /machine:x64
101 There is an experimental Makefile in the "dos" directory to build
102 XZ Utils on DOS using DJGPP. Support for long file names (LFN) is
105 GNU Autotools based build hasn't been tried on DOS.
110 You will need to pass --disable-assembler to configure when building
113 To omit large number of harmless warnings about visibility support,
114 pass gl_cv_cc_visibility=no as an argument to the configure script.
115 This isn't mandatory since it should have no effect on the resulting
119 1.3. Adding support for new platforms
121 If you have written patches to make XZ Utils to work on previously
122 unsupported platform, please send the patches to me! I will consider
123 including them to the official version. It's nice to minimize the
124 need of third-party patching.
126 One exception: Don't request or send patches to change the whole
127 source package to C89. I find C99 substantially nicer to write and
128 maintain. However, the public library headers must be in C89 to
129 avoid frustrating those who maintain programs, which are strictly
136 In most cases, the defaults are what you want. Most of the options
137 below are useful only when building a size-optimized version of
138 liblzma or command line tools.
140 --enable-encoders=LIST
142 Specify a comma-separated LIST of filter encoders to
143 build. See "./configure --help" for exact list of
144 available filter encoders. The default is to build all
147 If LIST is empty or --disable-encoders is used, no filter
148 encoders will be built and also the code shared between
149 encoders will be omitted.
151 Disabling encoders will remove some symbols from the
152 liblzma ABI, so this option should be used only when it
153 is known to not cause problems.
155 --enable-decoders=LIST
157 This is like --enable-encoders but for decoders. The
158 default is to build all supported decoders.
160 --enable-match-finders=LIST
161 liblzma includes two categories of match finders:
162 hash chains and binary trees. Hash chains (hc3 and hc4)
163 are quite fast but they don't provide the best compression
164 ratio. Binary trees (bt2, bt3 and bt4) give excellent
165 compression ratio, but they are slower and need more
166 memory than hash chains.
168 You need to enable at least one match finder to build the
169 LZMA1 or LZMA2 filter encoders. Usually hash chains are
170 used only in the fast mode, while binary trees are used to
171 when the best compression ratio is wanted.
173 The default is to build all the match finders if LZMA1
174 or LZMA2 filter encoders are being built.
177 liblzma support multiple integrity checks. CRC32 is
178 mandatory, and cannot be omitted. See "./configure --help"
179 for exact list of available integrity check types.
181 liblzma and the command line tools can decompress files
182 which use unsupported integrity check type, but naturally
183 the file integrity cannot be verified in that case.
185 Disabling integrity checks may remove some symbols from
186 the liblzma ABI, so this option should be used only when
187 it is known to not cause problems.
190 liblzma includes some assembler optimizations. Currently
191 there is only assembler code for CRC32 and CRC64 for
194 All the assembler code in liblzma is position-independent
195 code, which is suitable for use in shared libraries and
196 position-independent executables. So far only i386
197 instructions are used, but the code is optimized for i686
198 class CPUs. If you are compiling liblzma exclusively for
199 pre-i686 systems, you may want to disable the assembler
202 --enable-unaligned-access
203 Allow liblzma to use unaligned memory access for 16-bit
204 and 32-bit loads and stores. This should be enabled only
205 when the hardware supports this, i.e. when unaligned
206 access is fast. Some operating system kernels emulate
207 unaligned access, which is extremely slow. This option
208 shouldn't be used on systems that rely on such emulation.
210 Unaligned access is enabled by default on x86, x86-64,
211 and big endian PowerPC.
214 Reduce the size of liblzma by selecting smaller but
215 semantically equivalent version of some functions, and
216 omit precomputed lookup tables. This option tends to
217 make liblzma slightly slower.
219 Note that while omitting the precomputed tables makes
220 liblzma smaller on disk, the tables are still needed at
221 run time, and need to be computed at startup. This also
222 means that the RAM holding the tables won't be shared
223 between applications linked against shared liblzma.
225 This option doesn't modify CFLAGS to tell the compiler
226 to optimize for size. You need to add -Os or equivalent
227 flag(s) to CFLAGS manually.
230 Disable threading support. This makes some things
231 thread-unsafe, meaning that if multithreaded application
232 calls liblzma functions from more than one thread,
233 something bad may happen.
235 Use this option if threading support causes you trouble,
236 or if you know that you will use liblzma only from
237 single-threaded applications and want to avoid dependency
240 --enable-dynamic=TYPE
241 Specify how command line tools should be linked against
242 liblzma. Possible TYPES:
244 yes All command line tools are linked against
245 shared liblzma (if shared liblzma was built).
246 This is equivalent to --enable-dynamic (i.e.
249 mixed Some tools are linked against static liblzma
250 and some against shared liblzma. This is the
251 default and recommended way.
253 no All command line tools are linked against
254 static liblzma (if static liblzma was built).
255 This is equivalent to --disable-dynamic.
257 This option is mostly useful for packagers, if distro
258 policy requires linking against shared libaries. See the
259 file PACKAGERS for more information about pros and cons
263 This enables the assert() macro and possibly some other
264 run-time consistency checks. It makes the code slower, so
265 you normally don't want to have this enabled.
268 If building with GCC, make all compiler warnings an error,
269 that abort the compilation. This may help catching bugs,
270 and should work on most systems. This has no effect on the
274 3. xzgrep and other scripts
275 ---------------------------
279 POSIX shell (sh) and bunch of other standard POSIX tools are required
280 to run the scripts. The configure script tries to find a POSIX
281 compliant sh, but if it fails, you can force the shell by passing
282 gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
285 Some of the scripts require also mktemp. The original mktemp can be
286 found from <http://www.mktemp.org/>. On GNU, most will use the mktemp
287 program from GNU coreutils instead of the original implementation.
288 Both mktemp versions are fine for XZ Utils (and practically for
289 everything else too).
294 The scripts assume that the required tools (standard POSIX utilities,
295 mktemp, and xz) are in PATH; the scripts don't set the PATH themselves.
296 Some people like this while some think this is a bug. Those in the
297 latter group can easily patch the scripts before running the configure
298 script by taking advantage of a placeholder line in the scripts.
300 For example, to make the scripts prefix /usr/bin:/bin to PATH:
302 perl -pi -e 's|^#SET_PATH.*$|PATH=/usr/bin:/bin:\$PATH|' \
309 4.1. "No C99 compiler was found."
311 You need a C99 compiler to build XZ Utils. If the configure script
312 cannot find a C99 compiler and you think you have such a compiler
313 installed, set the compiler command by passing CC=/path/to/c99 as
314 an argument to the configure script.
316 If you get this error even when you think your compiler supports C99,
317 you can override the test by passing ac_cv_prog_cc_c99= as an argument
318 to the configure script. The test for C99 compiler is not perfect (and
319 it is not as easy to make it perfect as it sounds), so sometimes this
320 may be needed. You will get a compile error if your compiler doesn't
324 4.1. "No POSIX conforming shell (sh) was found."
326 xzgrep and other scripts need a shell that (roughly) conforms
327 to POSIX. The configure script tries to find such a shell. If
328 it fails, you can force the shell to be used by passing
329 gl_cv_posix_shell=/path/to/posix-sh as an argument to the configure
333 4.2. configure works but build fails at crc32_x86.S
335 The easy fix is to pass --disable-assembler to the configure script.
337 The configure script determines if assembler code can be used by
338 looking at the configure triplet; there is currently no check if
339 the assembler code can actually actually be built. The x86 assembler
340 code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
341 Cygwin, and DJGPP. On other x86 systems, there may be problems and
342 the assembler code may need to be disabled with the configure option.
344 If you get this error when building for x86-64, you have specified or
345 the configure script has misguessed your architecture. Pass the
346 correct configure triplet using the --build=CPU-COMPANY-SYSTEM option
347 (see INSTALL.generic).