aboutsummaryrefslogtreecommitdiff
path: root/lib/util/Makemodule.am
blob: 8e9b01d62fc73ed78409b3eca822000eed391f78 (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
libutil_a_SOURCES = include/util/util.h include/util/str_table.h \
	include/util/hash_table.h include/util/test.h include/util/rbtree.h \
	include/util/array.h include/util/threadpool.h \
	include/util/w32threadwrap.h include/util/mempool.h \
	include/util/dir_iterator.h \
	lib/util/src/str_table.c lib/util/src/alloc.c lib/util/src/rbtree.c \
	lib/util/src/array.c lib/util/src/xxhash.c lib/util/src/hash_table.c \
	lib/util/src/fast_urem_by_const.h lib/util/src/threadpool_serial.c \
	lib/util/src/is_memory_zero.c lib/util/src/mkdir_p.c \
	lib/util/src/canonicalize_name.c lib/util/src/filename_sane.c \
	lib/util/src/source_date_epoch.c lib/util/src/file_cmp.c \
	lib/util/src/hex_decode.c lib/util/src/base64_decode.c
libutil_a_CFLAGS = $(AM_CFLAGS)
libutil_a_CPPFLAGS = $(AM_CPPFLAGS)

if WINDOWS
libutil_a_CFLAGS += -DWINVER=0x0600 -D_WIN32_WINNT=0x0600
libutil_a_SOURCES += lib/util/src/w32_dir_iterator.c
endif

if HAVE_PTHREAD
libutil_a_SOURCES += lib/util/src/threadpool.c
libutil_a_CFLAGS += $(PTHREAD_CFLAGS)
else
if WINDOWS
libutil_a_SOURCES += lib/util/src/threadpool.c
else
libutil_a_CPPFLAGS += -DNO_THREAD_IMPL
endif
endif

if CUSTOM_ALLOC
libutil_a_SOURCES += lib/util/src/mempool.c
endif

noinst_LIBRARIES += libutil.a

test_str_table_SOURCES = lib/util/test/str_table.c
test_str_table_LDADD = libutil.a libio.a libcompat.a
test_str_table_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/lib/util/test

test_rbtree_SOURCES = lib/util/test/rbtree.c
test_rbtree_LDADD = libutil.a libcompat.a

test_xxhash_SOURCES = lib/util/test/xxhash.c
test_xxhash_LDADD = libutil.a libcompat.a

test_threadpool_SOURCES = lib/util/test/threadpool.c
test_threadpool_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
test_threadpool_CPPFLAGS = $(AM_CPPFLAGS)
test_threadpool_LDADD = libutil.a libcompat.a $(PTHREAD_LIBS)

if HAVE_PTHREAD
test_threadpool_CPPFLAGS += -DHAVE_PTHREAD
endif

test_ismemzero_SOURCES = lib/util/test/is_memory_zero.c
test_ismemzero_LDADD = libutil.a libcompat.a

test_canonicalize_name_SOURCES = lib/util/test/canonicalize_name.c
test_canonicalize_name_LDADD = libutil.a libcompat.a

test_filename_sane_SOURCES = lib/util/test/filename_sane.c
test_filename_sane_SOURCES += lib/util/src/filename_sane.c
test_filename_sane_LDADD = libcompat.a libutil.a

test_filename_sane_w32_SOURCES = lib/util/test/filename_sane.c
test_filename_sane_w32_SOURCES += lib/util/src/filename_sane.c
test_filename_sane_w32_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_WIN32=1
test_filename_sane_w32_LDADD = libcompat.a

test_sdate_epoch_SOURCES = lib/util/test/epoch.c
test_sdate_epoch_LDADD = libutil.a libcompat.a

test_hex_decode_SOURCES = lib/util/test/hex_decode.c
test_hex_decode_LDADD = libutil.a libcompat.a

test_base64_decode_SOURCES = lib/util/test/base64_decode.c
test_base64_decode_LDADD = libutil.a libcompat.a

LIBUTIL_TESTS = \
	test_str_table test_rbtree test_xxhash test_threadpool test_ismemzero \
	test_canonicalize_name test_filename_sane test_filename_sane_w32 \
	test_sdate_epoch test_hex_decode test_base64_decode

check_PROGRAMS += $(LIBUTIL_TESTS)
TESTS += $(LIBUTIL_TESTS)
EXTRA_DIST += $(top_srcdir)/lib/util/test/words.txt