aboutsummaryrefslogtreecommitdiff
path: root/lib/io/Makemodule.am
blob: 5ec1f7ec514d2861cb16ea80a1f865c8bb2c07bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
libio_a_SOURCES = include/io/istream.h include/io/ostream.h include/io/xfrm.h \
	include/io/file.h include/io/std.h include/io/dir_entry.h \
	include/io/dir_iterator.h include/io/mem.h \
	lib/io/src/internal.h lib/io/src/ostream.c \
	lib/io/src/istream.c lib/io/src/get_line.c lib/io/src/xfrm/ostream.c \
	lib/io/src/xfrm/istream.c lib/io/src/dir_tree_iterator.c \
	lib/io/src/dir_entry.c lib/io/src/mem.c
libio_a_CFLAGS = $(AM_CFLAGS) $(ZLIB_CFLAGS) $(XZ_CFLAGS)
libio_a_CFLAGS += $(ZSTD_CFLAGS) $(BZIP2_CFLAGS)

if WINDOWS
libio_a_SOURCES += lib/io/src/win32/ostream.c lib/io/src/win32/istream.c
libio_a_SOURCES += lib/io/src/win32/dir_iterator.c
libio_a_CFLAGS += -DWINVER=0x0600 -D_WIN32_WINNT=0x0600
else
libio_a_SOURCES += lib/io/src/unix/ostream.c lib/io/src/unix/istream.c
libio_a_SOURCES += lib/io/src/unix/dir_iterator.c
endif

noinst_LIBRARIES += libio.a

LIBIO_TESTS = test_istream_mem test_get_line test_sparse_fb test_istream_read \
	test_istream_skip test_stream_splice test_dir_iterator \
	test_dir_tree_iterator test_dir_tree_iterator2 test_dir_tree_iterator3

test_istream_mem_SOURCES = lib/io/test/istream_mem.c
test_istream_mem_LDADD = libio.a libcompat.a
test_istream_mem_CPPFLAGS = $(AM_CPPFLAGS)

test_get_line_SOURCES = lib/io/test/get_line.c
test_get_line_LDADD = libio.a libcompat.a
test_get_line_CPPFLAGS = $(AM_CPPFLAGS)

test_sparse_fb_SOURCES = lib/io/test/sparse_fb.c
test_sparse_fb_LDADD = libio.a libutil.a libcompat.a

test_istream_read_SOURCES = lib/io/test/istream_read.c
test_istream_read_LDADD = libio.a libutil.a libcompat.a

test_istream_skip_SOURCES = lib/io/test/istream_skip.c
test_istream_skip_LDADD = libio.a libutil.a libcompat.a

test_stream_splice_SOURCES = lib/io/test/stream_splice.c
test_stream_splice_LDADD = libio.a libutil.a libcompat.a

test_dir_iterator_SOURCES = lib/io/test/dir_iterator.c
test_dir_iterator_LDADD = libio.a libutil.a libcompat.a
test_dir_iterator_CPPFLAGS = $(AM_CPPFLAGS)
test_dir_iterator_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/io/test/testdir

test_dir_tree_iterator_SOURCES = lib/io/test/dir_tree_iterator.c
test_dir_tree_iterator_LDADD = libio.a libutil.a libcompat.a
test_dir_tree_iterator_CPPFLAGS = $(AM_CPPFLAGS)
test_dir_tree_iterator_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/io/test/testdir

test_dir_tree_iterator2_SOURCES = lib/io/test/dir_tree_iterator2.c
test_dir_tree_iterator2_LDADD = libio.a libutil.a libcompat.a
test_dir_tree_iterator2_CPPFLAGS = $(AM_CPPFLAGS)
test_dir_tree_iterator2_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/io/test/testdir

test_dir_tree_iterator3_SOURCES = lib/io/test/dir_tree_iterator3.c
test_dir_tree_iterator3_LDADD = libio.a libutil.a libcompat.a
test_dir_tree_iterator3_CPPFLAGS = $(AM_CPPFLAGS)
test_dir_tree_iterator3_CPPFLAGS += -DTESTPATH=$(top_srcdir)/lib/io/test/testdir

if WITH_XZ
test_io_xfrm_xz_SOURCES = lib/io/test/xfrm.c
test_io_xfrm_xz_LDADD = libio.a libxfrm.a libcompat.a $(XZ_LIBS)
test_io_xfrm_xz_CPPFLAGS = $(AM_CPPFLAGS) -DDO_XZ=1

LIBIO_TESTS += test_io_xfrm_xz
endif

if WITH_BZIP2
test_io_xfrm_bzip2_SOURCES = lib/io/test/xfrm.c
test_io_xfrm_bzip2_LDADD = libio.a libxfrm.a libcompat.a $(BZIP2_LIBS)
test_io_xfrm_bzip2_CPPFLAGS = $(AM_CPPFLAGS) -DDO_BZIP2=1

LIBIO_TESTS += test_io_xfrm_bzip2
endif

if WITH_GZIP
test_io_xfrm_gzip_SOURCES = lib/io/test/xfrm.c
test_io_xfrm_gzip_LDADD = libio.a libxfrm.a libcompat.a $(ZLIB_LIBS)
test_io_xfrm_gzip_CPPFLAGS = $(AM_CPPFLAGS) -DDO_GZIP=1

LIBIO_TESTS += test_io_xfrm_gzip
endif

if WITH_ZSTD
if HAVE_ZSTD_STREAM
test_io_xfrm_zstd_SOURCES = lib/io/test/xfrm.c
test_io_xfrm_zstd_LDADD = libio.a libxfrm.a libcompat.a $(ZSTD_LIBS)
test_io_xfrm_zstd_CPPFLAGS = $(AM_CPPFLAGS) -DDO_ZSTD=1

LIBIO_TESTS += test_io_xfrm_zstd
endif
endif

check_PROGRAMS += $(LIBIO_TESTS)
TESTS += $(LIBIO_TESTS)

EXTRA_DIST += $(top_srcdir)/lib/io/test/testdir