From f42ee981668b545ab6d06c6072e262c29605273c Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Tue, 30 Jun 2009 17:09:57 +0300 Subject: 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 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. --- src/xzdec/Makefile.am | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/xzdec') diff --git a/src/xzdec/Makefile.am b/src/xzdec/Makefile.am index bdcc12bb..25517f0e 100644 --- a/src/xzdec/Makefile.am +++ b/src/xzdec/Makefile.am @@ -5,9 +5,21 @@ ## You can do whatever you want with this file. ## +# Windows resource compiler support. It's fine to use xz_CPPFLAGS +# also for lzmadec. +.rc.o: + $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(xzdec_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) -i $< -o $@ + + bin_PROGRAMS = xzdec lzmadec xzdec_SOURCES = xzdec.c + +if COND_W32 +xzdec_SOURCES += xzdec_w32res.rc +endif + xzdec_CPPFLAGS = \ -I$(top_srcdir)/src/common \ -I$(top_srcdir)/src/liblzma/api \ @@ -23,11 +35,17 @@ endif xzdec_LDADD += $(LTLIBINTL) -lzmadec_SOURCES = $(xzdec_SOURCES) +lzmadec_SOURCES = xzdec.c + +if COND_W32 +lzmadec_SOURCES += lzmadec_w32res.rc +endif + lzmadec_CPPFLAGS = $(xzdec_CPPFLAGS) -DLZMADEC lzmadec_LDFLAGS = $(xzdec_LDFLAGS) lzmadec_LDADD = $(xzdec_LDADD) + dist_man_MANS = xzdec.1 install-data-hook: -- cgit v1.2.3