1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

Windows: Update the build script and README-Windows.txt.

The 32-bit build is now for i686 or newer because the
prebuilt MinGW-w64 toolchains include i686 code in the
executables even if one uses -march=i486.

The build script builds 32-bit SSE2 enabled version too.
Run-time detection of SSE2 support would be nice (on any OS)
but it's not implemented in XZ Utils yet.
This commit is contained in:
Lasse Collin 2014-12-20 20:41:48 +02:00
parent 4a1f6133ee
commit 0152f72bf6
2 changed files with 30 additions and 23 deletions

View file

@ -21,14 +21,18 @@ 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.
It's included in all recent Windows versions. (On Windows 95 it
might be missing, but once you get it somewhere, the i686 binaries
should run even on Windows 95 if the processor is new enough.)
There are two different versions of the executable and library files.
There is one directory for each type of binaries:
There is a SSE2 optimization in the compression code but this
version of XZ Utils doesn't include run-time processor detection.
This is why there is a separate i686-SSE2 version.
bin_i486 32-bit x86 (i486 and up), Windows 95 and later
There is one directory for each type of executable and library files:
bin_i686 32-bit x86 (i686 and newer), Windows 95 and later
bin_i686-sse2 32-bit x86 (i686 with SSE2), Windows 98 and later
bin_x86-64 64-bit x86-64, Windows Vista and later
Each of the above directories have the following files:
@ -90,15 +94,13 @@ Microsoft Visual C++
lib /def:liblzma.def /out:liblzma.lib /machine:x64
Linking against static liblzma might work too, but usually you
should use liblzma.dll if possible. (Or, if having a decompressor
is enough, consider using XZ Embedded or LZMA SDK which can be
compiled with MSVC.)
If you need to link statically against liblzma, you should build
liblzma with MSVC 2013 update 2 or later. Alternatively, if having
a decompressor is enough, consider using XZ Embedded or LZMA SDK.
To try linking against static liblzma, 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
When you plan to link against static liblzma, you 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>

View file

@ -75,6 +75,8 @@ buildit()
# threading. So I don't include a size-optimized liblzma for now.
./configure \
--prefix= \
--enable-silent-rules \
--disable-dependency-tracking \
--disable-nls \
--disable-scripts \
--disable-threads \
@ -89,9 +91,12 @@ buildit()
make distclean
# Build the normal speed-optimized binaries.
# Build the normal speed-optimized binaries. The type of threading
# (win95 vs. vista) will be autodetect from the target architecture.
./configure \
--prefix= \
--enable-silent-rules \
--disable-dependency-tracking \
--disable-nls \
--disable-scripts \
--build="$BUILD" \
@ -125,19 +130,19 @@ txtcp()
done
}
# FIXME: Make sure that we don't get i686 or i586 code from the runtime.
# Or if we do, update the strings here to match the generated code.
# i686 has cmov which can help like maybe 1 % in performance but things
# like SSE don't help, so i486 isn't horrible for performance.
#
# FIXME: Using i486 in the configure triplet may be wrong.
if [ -d "$MINGW_W32_DIR" ]; then
# 32-bit x86, Win95 or later, using MinGW-w32
PATH=$MINGW_W32_DIR/bin:$MINGW_W32_DIR/i686-w64-mingw32/bin:$PATH \
buildit \
pkg/bin_i486 \
i486-w64-mingw32 \
'-march=i486 -mtune=generic'
i686-w64-mingw32 \
'-march=i686 -mtune=generic'
# 32-bit x86 with SSE2, Win98 or later, using MinGW-w32
PATH=$MINGW_W32_DIR/bin:$MINGW_W32_DIR/i686-w64-mingw32/bin:$PATH \
buildit \
pkg/bin_i686-sse2 \
i686-w64-mingw32 \
'-march=i686 -msse2 -mfpmath=sse -mtune=generic'
elif [ -d "$MINGW_DIR" ]; then
# 32-bit x86, Win95 or later, using MinGW
PATH=$MINGW_DIR/bin:$PATH \