2 ## Author: Lasse Collin
4 ## This file has been put into the public domain.
5 ## You can do whatever you want with this file.
14 lib_LTLIBRARIES = liblzma.la
16 liblzma_la_CPPFLAGS = \
17 -I$(top_srcdir)/src/liblzma/api \
18 -I$(top_srcdir)/src/liblzma/common \
19 -I$(top_srcdir)/src/liblzma/check \
20 -I$(top_srcdir)/src/liblzma/lz \
21 -I$(top_srcdir)/src/liblzma/rangecoder \
22 -I$(top_srcdir)/src/liblzma/lzma \
23 -I$(top_srcdir)/src/liblzma/delta \
24 -I$(top_srcdir)/src/liblzma/simple \
25 -I$(top_srcdir)/src/common \
26 -DTUKLIB_SYMBOL_PREFIX=lzma_
27 liblzma_la_LDFLAGS = -no-undefined -version-info 7:4:2
29 EXTRA_DIST += liblzma.map validate_map.sh
31 liblzma_la_LDFLAGS += \
32 -Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma.map
35 liblzma_la_SOURCES += ../common/tuklib_physmem.c
38 liblzma_la_SOURCES += ../common/tuklib_cpucores.c
41 include $(srcdir)/common/Makefile.inc
42 include $(srcdir)/check/Makefile.inc
45 include $(srcdir)/lz/Makefile.inc
49 include $(srcdir)/lzma/Makefile.inc
50 include $(srcdir)/rangecoder/Makefile.inc
54 include $(srcdir)/delta/Makefile.inc
58 include $(srcdir)/simple/Makefile.inc
62 ## Windows-specific stuff
64 # Windows resource compiler support. libtool knows what to do with .rc
65 # files, but Automake (<= 1.11 at least) doesn't know.
67 # We want the resource file only in shared liblzma. To avoid linking it into
68 # static liblzma, we overwrite the static object file with an object file
69 # compiled from empty input. Note that GNU-specific features are OK here,
70 # because on Windows we are compiled with the GNU toolchain.
72 $(LIBTOOL) --mode=compile $(RC) $(DEFS) $(DEFAULT_INCLUDES) \
73 $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) \
76 $(COMPILE) -c empty.c -o $(*D)/$(*F).o
78 # Remove ordinals from the generated .def file. People must link by name,
79 # not by ordinal, because no one is going to track the ordinal numbers.
80 liblzma.def: liblzma.la liblzma.def.in
81 sed 's/ \+@ *[0-9]\+//' liblzma.def.in > liblzma.def
83 # Creating liblzma.def.in is a side effect of linking the library.
84 liblzma.def.in: liblzma.la
87 CLEANFILES += liblzma.def liblzma.def.in empty.c
88 liblzma_la_SOURCES += liblzma_w32res.rc
89 liblzma_la_LDFLAGS += -Xlinker --output-def -Xlinker liblzma.def.in
91 ## liblzma.def.in is created only when building shared liblzma, so don't
92 ## try to create liblzma.def when not building shared liblzma.
94 doc_DATA += liblzma.def
100 pkgconfigdir = $(libdir)/pkgconfig
101 pkgconfig_DATA = liblzma.pc
102 EXTRA_DIST += liblzma.pc.in
104 pc_verbose = $(pc_verbose_@AM_V@)
105 pc_verbose_ = $(pc_verbose_@AM_DEFAULT_V@)
106 pc_verbose_0 = @echo " PC " $@;
108 liblzma.pc: $(srcdir)/liblzma.pc.in
111 -e 's,@prefix[@],$(prefix),g' \
112 -e 's,@exec_prefix[@],$(exec_prefix),g' \
113 -e 's,@libdir[@],$(libdir),g' \
114 -e 's,@includedir[@],$(includedir),g' \
115 -e 's,@PACKAGE_URL[@],$(PACKAGE_URL),g' \
116 -e 's,@PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
117 -e 's,@PTHREAD_CFLAGS[@],$(PTHREAD_CFLAGS),g' \
118 -e 's,@LIBS[@],$(LIBS),g' \
119 < $(srcdir)/liblzma.pc.in > $@ || { rm -f $@; exit 1; }