LZX, LZMS: Annotate unaligned memory accesses in x86 filtering
[wimlib] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 AM_CPPFLAGS     = -I$(top_srcdir)/include $(WINDOWS_CPPFLAGS) \
4                   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
5
6 AM_CFLAGS       = -std=gnu99 -Wmissing-prototypes -Wstrict-prototypes   \
7                   -Werror-implicit-function-declaration                 \
8                   -fno-common -Wundef -Wno-pointer-sign
9
10 if WINDOWS_NATIVE_BUILD
11 # This option is needed to make packed structures work as expected
12 # with gcc 4.7+ (mingw) on Windows.
13 AM_CFLAGS += -mno-ms-bitfields
14 endif
15
16 lib_LTLIBRARIES = libwim.la
17
18 libwim_la_LDFLAGS = -version-info 17:0:2 $(WINDOWS_LDFLAGS)
19
20 libwim_la_SOURCES =             \
21         src/add_image.c         \
22         src/avl_tree.c          \
23         src/capture_common.c    \
24         src/compress.c          \
25         src/compress_common.c   \
26         src/compress_parallel.c \
27         src/compress_serial.c   \
28         src/decompress.c        \
29         src/decompress_common.c \
30         src/delete_image.c      \
31         src/dentry.c            \
32         src/divsufsort.c        \
33         src/encoding.c          \
34         src/export_image.c      \
35         src/extract.c           \
36         src/file_io.c           \
37         src/header.c            \
38         src/inode.c             \
39         src/inode_fixup.c       \
40         src/integrity.c         \
41         src/iterate_dir.c       \
42         src/join.c              \
43         src/lookup_table.c      \
44         src/lz_binary_trees.c   \
45         src/lz_hash_chains.c    \
46         src/lz_lcp_interval_tree.c      \
47         src/lz_linked_suffix_array.c    \
48         src/lz_mf.c             \
49         src/lz_null.c           \
50         src/lz_repsearch.c      \
51         src/lz_suffix_array_utils.c     \
52         src/lzms-common.c       \
53         src/lzms-compress.c     \
54         src/lzms-decompress.c   \
55         src/lzx-common.c        \
56         src/lzx-compress.c      \
57         src/lzx-decompress.c    \
58         src/metadata_resource.c \
59         src/mount_image.c       \
60         src/pathlist.c          \
61         src/paths.c             \
62         src/progress.c          \
63         src/resource.c          \
64         src/reference.c         \
65         src/security.c          \
66         src/sha1.c              \
67         src/split.c             \
68         src/reparse.c           \
69         src/tagged_items.c      \
70         src/template.c          \
71         src/textfile.c          \
72         src/timestamp.c         \
73         src/update_image.c      \
74         src/util.c              \
75         src/verify.c            \
76         src/wildcard.c          \
77         src/wim.c               \
78         src/write.c             \
79         src/xml.c               \
80         src/xpress-compress.c   \
81         src/xpress-decompress.c \
82         include/wimlib/apply.h          \
83         include/wimlib/assert.h         \
84         include/wimlib/avl_tree.h       \
85         include/wimlib/callback.h       \
86         include/wimlib/capture.h        \
87         include/wimlib/case.h           \
88         include/wimlib/compiler.h       \
89         include/wimlib/compressor_ops.h \
90         include/wimlib/compress_common.h        \
91         include/wimlib/chunk_compressor.h       \
92         include/wimlib/decompressor_ops.h       \
93         include/wimlib/decompress_common.h      \
94         include/wimlib/dentry.h         \
95         include/wimlib/divsufsort.h     \
96         include/wimlib/encoding.h       \
97         include/wimlib/endianness.h     \
98         include/wimlib/error.h          \
99         include/wimlib/file_io.h        \
100         include/wimlib/glob.h           \
101         include/wimlib/header.h         \
102         include/wimlib/inode.h          \
103         include/wimlib/inode_table.h    \
104         include/wimlib/integrity.h      \
105         include/wimlib/list.h           \
106         include/wimlib/lookup_table.h   \
107         include/wimlib/lz_extend.h      \
108         include/wimlib/lz_hash3.h       \
109         include/wimlib/lz_mf.h          \
110         include/wimlib/lz_mf_ops.h      \
111         include/wimlib/lz_repsearch.h   \
112         include/wimlib/lz_suffix_array_utils.h  \
113         include/wimlib/lzms.h           \
114         include/wimlib/lzms_constants.h \
115         include/wimlib/lzx.h            \
116         include/wimlib/lzx_constants.h  \
117         include/wimlib/metadata.h       \
118         include/wimlib/pathlist.h       \
119         include/wimlib/paths.h          \
120         include/wimlib/progress.h       \
121         include/wimlib/reparse.h        \
122         include/wimlib/resource.h       \
123         include/wimlib/security.h       \
124         include/wimlib/security_descriptor.h    \
125         include/wimlib/sha1.h           \
126         include/wimlib/textfile.h       \
127         include/wimlib/timestamp.h      \
128         include/wimlib/types.h          \
129         include/wimlib/unaligned.h      \
130         include/wimlib/unix_data.h      \
131         include/wimlib/util.h           \
132         include/wimlib/version.h        \
133         include/wimlib/wildcard.h       \
134         include/wimlib/wim.h            \
135         include/wimlib/write.h          \
136         include/wimlib/xml.h            \
137         include/wimlib/xpress.h
138
139 if WITH_NTFS_3G
140 libwim_la_SOURCES += src/ntfs-3g_apply.c        \
141                      src/ntfs-3g_capture.c      \
142                      include/wimlib/ntfs_3g.h
143 endif
144
145 if WINDOWS_NATIVE_BUILD
146 libwim_la_SOURCES += src/win32_common.c                 \
147                      src/win32_apply.c                  \
148                      src/win32_capture.c                \
149                      src/win32_replacements.c           \
150                      src/wimboot.c                      \
151                      include/wimlib/win32_common.h      \
152                      include/wimlib/win32.h             \
153                      include/wimlib/wimboot.h           \
154                      include/wimlib/wof.h
155 else
156 libwim_la_SOURCES += src/unix_apply.c           \
157                      src/unix_capture.c
158 endif
159
160
161
162 EXTRA_libwim_la_SOURCES = src/sha1-ssse3.asm
163 libwim_la_DEPENDENCIES = $(SSSE3_SHA1_OBJ)
164
165 src/sha1-ssse3.lo:src/sha1-ssse3.asm
166         $(LIBTOOL) --mode=compile --tag NASM $(srcdir)/build-aux/nasm_lt.sh \
167         $(NASM) $(NAFLAGS) $(NASM_WINDOWS_FLAGS)                            \
168         -DINTEL_SHA1_UPDATE_FUNCNAME=$(NASM_SYMBOL_PREFIX)sha1_transform_blocks_ssse3       \
169         -DINTEL_SHA1_UPDATE_DEFAULT_DISPATCH=$(NASM_SYMBOL_PREFIX)sha1_transform_blocks_default  \
170         $< -o $@
171
172 libwim_la_LIBADD =              \
173         $(LIBXML2_LIBS)         \
174         $(LIBFUSE_LIBS)         \
175         $(LIBRT_LIBS)           \
176         $(LIBNTFS_3G_LIBS)      \
177         $(LTLIBICONV)           \
178         $(LIBCRYPTO_LIBS)       \
179         $(SSSE3_SHA1_OBJ)       \
180         $(PTHREAD_LDADD)
181
182 libwim_la_CFLAGS =              \
183         $(AM_CFLAGS)            \
184         $(VISIBILITY_CFLAGS)    \
185         $(LIBXML2_CFLAGS)       \
186         $(LIBFUSE_CFLAGS)       \
187         $(LIBNTFS_3G_CFLAGS)    \
188         $(LIBCRYPTO_CFLAGS)
189
190
191 bin_PROGRAMS     = imagex
192 imagex_SOURCES   = programs/imagex.c    \
193                    include/wimlib.h     \
194                    include/wimlib_tchar.h
195 imagex_LDADD     = $(top_builddir)/libwim.la
196 imagex_CFLAGS    = $(AM_CFLAGS) $(WINDOWS_CFLAGS) -Wno-deprecated-declarations
197
198 if WINDOWS_NATIVE_BUILD
199 imagex_SOURCES += programs/imagex-win32.c       \
200                   programs/imagex-win32.h       \
201                   programs/wgetopt.c            \
202                   programs/wgetopt.h
203 endif
204
205 imagex_cmds =   append  \
206                 apply   \
207                 capture \
208                 delete  \
209                 dir     \
210                 export  \
211                 extract \
212                 info    \
213                 join    \
214                 mount   \
215                 mountrw \
216                 optimize\
217                 split   \
218                 unmount \
219                 update  \
220                 verify
221
222 install-exec-hook:
223         if [ "@IMAGEX_PROGNAME@" != imagex ]; then                          \
224                 cd $(DESTDIR)$(bindir) && mv -f imagex "@IMAGEX_PROGNAME@"; \
225         fi
226         for cmd in $(imagex_cmds); do                           \
227                 cd $(DESTDIR)$(bindir) &&                       \
228                         ln -f "@IMAGEX_PROGNAME@" wim$${cmd};   \
229         done
230
231 install-data-hook:
232         for cmd in $(imagex_cmds); do                                       \
233                 cd $(DESTDIR)$(mandir)/man1 &&                              \
234                         ln -sf "@IMAGEX_PROGNAME@-$${cmd}.1" wim$${cmd}.1;  \
235         done
236
237 uninstall-hook:
238         if [ "@IMAGEX_PROGNAME@" != imagex ]; then              \
239                 rm -f $(DESTDIR)$(bindir)/"@IMAGEX_PROGNAME@";  \
240                 rm -f $(DESTDIR)$(bindir)/imagex;               \
241         fi
242         for cmd in $(imagex_cmds); do                           \
243                 rm -f $(DESTDIR)$(bindir)/wim$${cmd};           \
244         done
245         for cmd in $(imagex_cmds); do                           \
246                 rm -f $(DESTDIR)$(mandir)/man1/wim$${cmd}.1;    \
247         done
248
249
250 dist_bin_SCRIPTS = programs/mkwinpeimg
251
252 include_HEADERS = include/wimlib.h
253
254 EXTRA_DIST =                                    \
255         build-aux/nasm_lt.sh                    \
256         archlinux                               \
257         debian                                  \
258         rpm                                     \
259         examples                                \
260         COPYING                                 \
261         COPYING.GPLv3                           \
262         COPYING.LGPLv3                          \
263         README                                  \
264         README.WINDOWS                          \
265         tests/common_tests.sh                   \
266         tests/tests-common.sh                   \
267         tests/security_descriptor_1.base64      \
268         tests/security_descriptor_1.bin         \
269         tests/security_descriptor_2.base64      \
270         tests/security_descriptor_2.bin
271
272 pkgconfigdir    = @pkgconfigdir@
273 pkgconfig_DATA  = wimlib.pc
274
275 $(pkgconfig_DATA): config.status
276
277 wimlib_manpages =                               \
278         doc/man1/@IMAGEX_PROGNAME@.1                    \
279         doc/man1/@IMAGEX_PROGNAME@-append.1             \
280         doc/man1/@IMAGEX_PROGNAME@-apply.1              \
281         doc/man1/@IMAGEX_PROGNAME@-capture.1            \
282         doc/man1/@IMAGEX_PROGNAME@-delete.1             \
283         doc/man1/@IMAGEX_PROGNAME@-dir.1                \
284         doc/man1/@IMAGEX_PROGNAME@-export.1             \
285         doc/man1/@IMAGEX_PROGNAME@-extract.1            \
286         doc/man1/@IMAGEX_PROGNAME@-info.1               \
287         doc/man1/@IMAGEX_PROGNAME@-join.1               \
288         doc/man1/@IMAGEX_PROGNAME@-mount.1              \
289         doc/man1/@IMAGEX_PROGNAME@-mountrw.1            \
290         doc/man1/@IMAGEX_PROGNAME@-optimize.1   \
291         doc/man1/@IMAGEX_PROGNAME@-split.1              \
292         doc/man1/@IMAGEX_PROGNAME@-unmount.1            \
293         doc/man1/@IMAGEX_PROGNAME@-update.1             \
294         doc/man1/@IMAGEX_PROGNAME@-verify.1             \
295         doc/man1/mkwinpeimg.1
296
297 man1_MANS = $(wimlib_manpages)
298 DISTCLEANFILES = $(wimlib_manpages)
299
300 $(man1_MANS): config.status
301
302 check_PROGRAMS = tests/tree-cmp
303 tests_tree_cmp_SOURCES = tests/tree-cmp.c
304
305 dist_check_SCRIPTS = tests/test-imagex \
306                      tests/test-imagex-capture_and_apply \
307                      tests/test-imagex-update_and_extract
308
309 if WITH_FUSE
310 dist_check_SCRIPTS += tests/test-imagex-mount
311 endif
312
313 if WITH_NTFS_3G
314 dist_check_SCRIPTS += tests/test-imagex-ntfs
315 endif
316
317 if WINDOWS_NATIVE_BUILD
318 # Tests are run manually for Windows builds.
319 TESTS =
320 else
321 TESTS = $(dist_check_SCRIPTS)
322 endif
323