aboutsummaryrefslogtreecommitdiff
path: root/windows/README
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--windows/README155
-rw-r--r--windows/README-Windows.txt115
2 files changed, 115 insertions, 155 deletions
diff --git a/windows/README b/windows/README
deleted file mode 100644
index 0e529de9..00000000
--- a/windows/README
+++ /dev/null
@@ -1,155 +0,0 @@
-
-XZ Utils on Windows
-===================
-
-Introduction
-
- This document explains how to build XZ Utils for Microsoft Windows
- using MinGW (Minimalist GNU for Windows).
-
- This is currently experimental and has got very little testing.
- No ABI stability is promised for liblzma.dll.
-
-
-Why MinGW
-
- XZ Utils code is C99. It should be possible to compile at least
- liblzma using any C99 compiler. Compiling the command line tools may
- need a little extra work to get them built on new systems, because
- they use some features that aren't standardized in POSIX.
-
- MinGW is free software. MinGW runtime provides some functions that
- made porting the command line tools easier. Most(?) of the MinGW
- runtime, which gets linked into the resulting binaries, is in the
- public domain.
-
- While most C compilers nowadays support C99 well enough (including
- most compilers for Windows), MSVC doesn't. It seems that Microsoft
- has no plans to ever support C99. Thus, it is not possible to build
- XZ Utils using MSVC without doing a lot of work to convert the code.
- Using prebuilt liblzma from MSVC is possible though, since the
- liblzma API headers are in C89 and contain some non-standard extra
- hacks required by MSVC.
-
-
-Getting and Installing MinGW
-
- You can download MinGW for 32-bit Windows from Sourceforge:
-
- http://sourceforge.net/project/showfiles.php?group_id=2435
-
- It is enough to pick Automated MinGW Installer and MSYS Base System.
- Using the automated installer, select at least runtime, w32api,
- core compiler, and MinGW make. From MSYS you actually need only
- certain tools, but it is easiest to just install the whole MSYS.
-
- To build for x86-64 version of Windows, you can download a snapshot
- of MinGW targeting for 64-bit Windows:
-
- http://sourceforge.net/project/showfiles.php?group_id=202880
-
- You can use the 32-bit MSYS also for 64-bit build, since we don't
- link against anything in MSYS, just use the tools from it. You may
- use the make tool from 32-bit MinGW (mingw32-make.exe) although
- probably the make.exe from MSYS works too.
-
- Naturally you can pick the components manually, for example to try
- the latest available GCC. It is also possible to use a cross-compiler
- to build Windows binaries for example on GNU/Linux, or use Wine to
- run the Windows binaries. However, these instructions focus on
- building on Windows.
-
-
-Building for 32-bit Windows
-
- Add MinGW and MSYS to PATH (adjust if you installed to non-default
- location):
-
- set PATH=C:\MinGW\bin;C:\MSYS\1.0\bin;%PATH%
-
- Then it should be enough to just run mingw32-make in this directory
- (the directory containing this README):
-
- mingw32-make
-
-
-Building for 64-bit Windows
-
- For 64-bit build the PATH has to point to 64-bit MinGW:
-
- set PATH=C:\MinGW64\bin;C:\MSYS\1.0\bin;%PATH%
-
- You need to pass W64=1 to mingw32-make (or make if you don't have
- mingw32-make):
-
- mingw32-make W64=1
-
-
-Additional Make Flags and Targets
-
- You may want to try some additional optimizations, which may or
- may not make the code faster (and may or may not hit possible
- compiler bugs more easily):
-
- mingw32-make CFLAGS="-O3 -fomit-frame-pointer -funroll-loops"
-
- If you want to enable assertions (the assert() macro), use DEBUG=1.
- You may want to disable optimizations too if you plan to actually
- debug the code. Never use DEBUG=1 for production builds!
-
- mingw32-make DEBUG=1 CFLAGS="-g -O0"
-
- To copy the built binaries and required headers into a clean
- directory, use the pkg target:
-
- mingw32-make pkg
-
- It first removes a possibly existing pkg directory, and then
- recreates it with the required files.
-
- TODO: The pkg target doesn't copy any license or other copyright
- related information into the pkg directory.
-
-
-Creating an Import Library for MSVC
-
- The included Makefile creates import library liblzma.a which works
- only(?) with MinGW. To use liblzma.dll for MSVC, you need to create
- liblzma.lib using the lib command from MSVC:
-
- lib /def:liblzma.def /out:liblzma.lib /machine:ix86
-
- On x86-64, the /machine argument has to naturally be changed:
-
- lib /def:liblzma.def /out:liblzma.lib /machine:x64
-
-
-To Do
-
- - Test Win64 support and add instructions about getting x86-64
- version of MinGW.
-
- - Creating the import library for other compilers/linkers
-
- - Building with other compilers for Windows
-
- - liblzma currently uses cdecl. Would stdcall be more compatible?
-
- - Support building more size-optimized liblzma (the HAVE_SMALL
- define and other things that are needed)
-
- - Support selecting which parts of liblzma to build to make the
- library even smaller.
-
- - Use the configure script on Windows just like it is used on all
- the other systems?
-
-
-Bugs
-
- Report bugs to <lasse.collin@tukaani.org> (in English or Finnish).
-
- Take into account that I don't have MSVC and I cannot very easily
- test anything on Windows. As of writing, I have tried MinGW and the
- resulting binaries only under 32-bit Wine.
-
diff --git a/windows/README-Windows.txt b/windows/README-Windows.txt
new file mode 100644
index 00000000..536d08f5
--- /dev/null
+++ b/windows/README-Windows.txt
@@ -0,0 +1,115 @@
+
+XZ Utils for Windows
+====================
+
+Introduction
+------------
+
+ This package includes command line tools (xz.exe and a few others)
+ and the liblzma compression library from XZ Utils. You can find the
+ latest version and full source code from <http://tukaani.org/xz/>.
+
+ The parts of the XZ Utils source code, that are relevant to this
+ binary package, are in the public domain. XZ Utils have been built
+ for this package with MinGW and linked statically against the MinGW
+ runtime and w32api packages.
+
+ FIXME: Add license info about MinGW runtime and w32api.
+
+
+Package contents
+----------------
+
+ All executables and libraries in this package require msvcrt.dll.
+ It's included in all recent Windows versions. On Windows 95 it
+ might be missing, but once you get it somewhere, XZ Utils should
+ run even on Windows 95.
+
+ There are two different versions of the executable and library files.
+ There is one directory for each type of binaries:
+
+ bin_i486 32-bit x86 (i486 and up), Windows 95 and later
+ bin_x86-64 64-bit x86-64, Windows XP and later
+
+ Each of the above directories have the following files:
+
+ *.exe Command line tools. (It's useless to double-click
+ these; use the command prompt instead.) These have
+ been linked statically against liblzma, so they
+ don't require liblzma.dll. Thus, you can copy e.g.
+ xz.exe to a directory that is in PATH without copying
+ any other files from this package.
+
+ liblzma.dll Shared version of the liblzma compression library.
+ This file is mostly useful to developers, although
+ some non-developers might use it to upgrade their
+ copy of liblzma.
+
+ liblzma.a Static version of the liblzma compression library.
+ This file is useful only for developers.
+
+ The rest of the directories contain architecture-independent files:
+
+ doc Documentation in the plain text (TXT) format. The
+ manuals of the command line tools are provided also
+ in the PDF format. liblzma.def is in this directory
+ too.
+
+ include C header files for liblzma. These should be
+ compatible with most C and C++ compilers. If you
+ have problems, try to fix it and send your fixes
+ upstream, or at least report a bug, thanks.
+
+
+Linking against liblzma
+-----------------------
+
+MinGW
+
+ If you use MinGW, linking against liblzma.dll or liblzma.a should
+ be straightforward. You don't need an import library to link
+ against liblzma.dll, and for static linking, you don't need to
+ worry about the LZMA_API_STATIC macro.
+
+ Note that the MinGW distribution includes liblzma. If you are
+ building packages that will be part of the MinGW distribution, you
+ probably should use the version of liblzma shipped in MinGW instead
+ of this package.
+
+
+Microsoft Visual C++
+
+ To link against liblzma.dll, you need to create an import library
+ first. You need the "lib" command from MSVC and liblzma.def from
+ the "doc" directory of this package. Here is the command that works
+ on 32-bit x86:
+
+ lib /def:liblzma.def /out:liblzma.lib /machine:ix86
+
+ On x86-64, the /machine argument has to naturally be changed:
+
+ lib /def:liblzma.def /out:liblzma.lib /machine:x64
+
+ Linking against static liblzma should work too. Rename liblzma.a
+ to e.g. liblzma_static.lib and tell MSVC to link against it. You
+ also need to tell lzma.h to not use __declspec(dllimport) by defining
+ the macro LZMA_API_STATIC. You can do it either in the C/C++ code
+
+ #define LZMA_API_STATIC
+ #include <lzma.h>
+
+ or by adding it to compiler options.
+
+
+Other compilers
+
+ If you are using some other compiler, see its documentation how to
+ create an import library (if it is needed). If it is simple, I
+ might consider including the instructions here.
+
+
+Reporting bugs
+--------------
+
+ Report bugs to <lasse.collin@tukaani.org> (in English or Finnish).
+