diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2009-06-30 17:09:57 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2009-06-30 17:09:57 +0300 |
commit | f42ee981668b545ab6d06c6072e262c29605273c (patch) | |
tree | 3c629000a91b0b0dccf11bacdd1878cea508be73 /configure.ac | |
parent | Added a comment about "autoconf -fi" to autogen.sh. (diff) | |
download | xz-f42ee981668b545ab6d06c6072e262c29605273c.tar.xz |
Build system fixes
Don't use libtool convenience libraries to avoid recently
discovered long-standing subtle but somewhat severe bugs
in libtool (at least 1.5.22 and 2.2.6 are affected). It
was found when porting XZ Utils to Windows
<http://lists.gnu.org/archive/html/libtool/2009-06/msg00070.html>
but the problem is significant also e.g. on GNU/Linux.
Unless --disable-shared is passed to configure, static
library built from a set of convenience libraries will
contain PIC objects. That is, while libtool builds non-PIC
objects too, only PIC objects will be used from the
convenience libraries. On 32-bit x86 (tested on mobile XP2400+),
using PIC instead of non-PIC makes the decompressor 10 % slower
with the default CFLAGS.
So while xz was linked against static liblzma by default,
it got the slower PIC objects unless --disable-shared was
used. I tend develop and benchmark with --disable-shared
due to faster build time, so I hadn't noticed the problem
in benchmarks earlier.
This commit also adds support for building Windows resources
into liblzma and executables.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index ad43e4fb..b1961eca 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,13 @@ echo "System type:" # This is needed to know if assembler optimizations can be used. AC_CANONICAL_HOST +# We do some special things on Windows (32-bit or 64-bit) builds. +case $host_os in + mingw* | cygwin*) is_w32=yes ;; + *) is_w32=no ;; +esac +AM_CONDITIONAL([COND_W32], [test "$is_w32" = yes]) + echo echo "Configure options:" @@ -436,6 +443,12 @@ dnl lines can be replaced with these: dnl LT_INIT([win32-dll]) dnl LT_LANG([Windows Resource]) +# This is a bit wrong since it is possible to request that only some libs +# are built as shared. Using that feature isn't so common though, and this +# breaks only on Windows (at least for now) if the user enables only some +# libs as shared. +AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno]) + ############################################################################### # Checks for libraries. @@ -544,9 +557,16 @@ lc_CPUCORES if test "x$GCC" = xyes ; then echo echo "GCC extensions:" - gl_VISIBILITY - if test -n "$CFLAG_VISIBILITY" ; then - AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY" + + # Avoid checking for visibility support on Windows, because the test + # may succeed even though visibility isn't supported. Windows has + # a different way to export only the required symbols from the + # libraries. + if test "$is_w32" = no; then + gl_VISIBILITY + if test -n "$CFLAG_VISIBILITY" ; then + AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY" + fi fi # Enable as much warnings as possible. These commented warnings won't @@ -627,14 +647,6 @@ AC_CONFIG_FILES([ src/liblzma/liblzma.pc src/liblzma/Makefile src/liblzma/api/Makefile - src/liblzma/common/Makefile - src/liblzma/check/Makefile - src/liblzma/rangecoder/Makefile - src/liblzma/lz/Makefile - src/liblzma/lzma/Makefile - src/liblzma/subblock/Makefile - src/liblzma/delta/Makefile - src/liblzma/simple/Makefile src/xz/Makefile src/xzdec/Makefile src/scripts/Makefile |