lib: Update getopt1.c from Gnulib.
[xz.git] / windows / README-Windows.txt
blob87e8f46435559d7adfff69d7efb557cf2c93206c
2 XZ Utils for Windows
3 ====================
5 Introduction
6 ------------
8     This package includes command line tools (xz.exe and a few others)
9     and the liblzma compression library from XZ Utils. You can find the
10     latest version and full source code from <https://tukaani.org/xz/>.
12     The parts of the XZ Utils source code, that are relevant to this
13     binary package, are in the public domain. XZ Utils have been built
14     for this package with MinGW-w64 and linked statically against its
15     runtime libraries. See COPYING-Windows.txt for the copyright and
16     license information that applies to the MinGW-w64 runtime. You must
17     include it when redistributing these XZ Utils binaries.
20 Package contents
21 ----------------
23     All executables and libraries in this package require msvcrt.dll,
24     not Universal CRT (UCRT).
26     There is a SSE2 optimization in the compression code but this
27     version of XZ Utils doesn't include run-time processor detection.
28     This is why there is a separate i686-SSE2 version.
30     There is one directory for each type of executable and library files:
32         bin_i686        32-bit x86 (i686 and newer), Windows 2000 and later
33         bin_i686-sse2   32-bit x86 (i686 with SSE2), Windows 2000 and later
34         bin_x86-64      64-bit x86-64, Windows Vista and later
36     Each of the above directories have the following files:
38         *.exe       Command line tools. (It's useless to double-click
39                     these; use the command prompt instead.) These have
40                     been linked statically against liblzma, so they
41                     don't require liblzma.dll. Thus, you can copy e.g.
42                     xz.exe to a directory that is in PATH without copying
43                     any other files from this package.
45         liblzma.dll Shared version of the liblzma compression library.
46                     This file is mostly useful to developers, although
47                     some non-developers might use it to upgrade their
48                     copy of liblzma.
50         liblzma.a   Static version of the liblzma compression library.
51                     This file is useful only for developers.
53     The rest of the directories contain architecture-independent files:
55         doc         Documentation in the plain text (TXT) format. The
56                     manuals of the command line tools are provided also
57                     in the PDF format. liblzma.def is in this directory
58                     too.
60         include     C header files for liblzma. These should be
61                     compatible with most C and C++ compilers. If you
62                     have problems, try to fix it and send your fixes
63                     upstream, or at least report a bug, thanks.
66 Linking against liblzma
67 -----------------------
69 MinGW
71     If you use MinGW, linking against liblzma.dll or liblzma.a should
72     be straightforward. You don't need an import library to link
73     against liblzma.dll, and for static linking, you don't need to
74     worry about the LZMA_API_STATIC macro.
76     Note that the MinGW distribution includes liblzma. If you are
77     building packages that will be part of the MinGW distribution, you
78     probably should use the version of liblzma shipped in MinGW instead
79     of this package.
82 Microsoft Visual C++
84     To link against liblzma.dll, you need to create an import library
85     first. You need the "lib" command from MSVC and liblzma.def from
86     the "doc" directory of this package. Here is the command that works
87     on 32-bit x86:
89         lib /def:liblzma.def /out:liblzma.lib /machine:ix86
91     On x86-64, the /machine argument has to naturally be changed:
93         lib /def:liblzma.def /out:liblzma.lib /machine:x64
95     If you need to link statically against liblzma, you should build
96     liblzma with MSVC 2013 update 2 or later. Alternatively, if having
97     a decompressor is enough, consider using XZ Embedded or LZMA SDK.
99     When you plan to link against static liblzma, you need to tell
100     lzma.h to not use __declspec(dllimport) by defining the macro
101     LZMA_API_STATIC. You can do it either in the C/C++ code
103         #define LZMA_API_STATIC
104         #include <lzma.h>
106     or by adding it to compiler options.
109 Other compilers
111     If you are using some other compiler, see its documentation how to
112     create an import library (if it is needed). If it is simple, I
113     might consider including the instructions here.
116 Reporting bugs
117 --------------
119     Report bugs to <xz@tukaani.org>.