2121#
2222
2323CONFIG_CLEAN_FILES = *.loT *.rej *.orig *.cur
24- noinst_PROGRAMS = auparse_test auparselol_test lookup_test databuf_test \
25- auparse_extra_test lru_cache_test uid_name_wrap_test
24+ noinst_PROGRAMS = auparse_test auparselol_test lookup_test auparse_extra_test
2625TESTS = run_auparse_tests.sh run_auparselol_test.sh lookup_test \
27- databuf_test auparse_extra_test lru_cache_test uid_name_wrap_test
26+ auparse_extra_test
2827dist_check_SCRIPTS = run_auparse_tests.sh run_auparselol_test.sh
2928EXTRA_DIST = auparse_test.ref auparse_test.ref.py test.log test2.log test3.log test4.log auditd_raw.sed run_auparse_tests.sh auparse_test.py run_auparselol_test.sh
3029CLEANFILES = run_auparse_tests.sh run_auparselol_test.sh
@@ -39,7 +38,12 @@ AM_LDFLAGS = ${ASAN_FLAGS}
3938else
4039AM_CFLAGS = -D_GNU_SOURCE -Wno-pointer-sign ${WFLAGS}
4140endif
41+
42+ if BUILD_STATIC
4243STATIC_LINK = -static
44+ noinst_PROGRAMS += databuf_test lru_cache_test uid_name_wrap_test
45+ TESTS += databuf_test lru_cache_test uid_name_wrap_test
46+ endif
4347
4448lookup_test_SOURCES = lookup_test.c
4549lookup_test_LDFLAGS = ${STATIC_LINK}
@@ -59,18 +63,19 @@ auparselol_test_LDADD = ${top_builddir}/auparse/libauparse.la \
5963 ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
6064auparselol_test_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
6165
62- databuf_test_SOURCES = databuf_test.c
63- databuf_test_LDFLAGS = ${STATIC_LINK}
64- databuf_test_LDADD = ${top_builddir}/auparse/libauparse.la \
65- ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
66- databuf_test_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
67-
6866auparse_extra_test_SOURCES = auparse_extra_test.c
6967auparse_extra_test_LDFLAGS = ${STATIC_LINK}
7068auparse_extra_test_LDADD = ${top_builddir}/auparse/libauparse.la \
7169 ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
7270auparse_extra_test_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
7371
72+ if BUILD_STATIC
73+ databuf_test_SOURCES = databuf_test.c
74+ databuf_test_LDFLAGS = ${STATIC_LINK}
75+ databuf_test_LDADD = ${top_builddir}/auparse/libauparse.la \
76+ ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
77+ databuf_test_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
78+
7479lru_cache_test_SOURCES = lru_cache_test.c
7580lru_cache_test_LDFLAGS = ${STATIC_LINK}
7681lru_cache_test_LDADD = ${top_builddir}/auparse/libauparse.la \
@@ -82,6 +87,7 @@ uid_name_wrap_test_LDFLAGS = ${STATIC_LINK}
8287uid_name_wrap_test_LDADD = ${top_builddir}/auparse/libauparse.la \
8388 ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
8489uid_name_wrap_test_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la
90+ endif
8591
8692drop_srcdir = sed 's,$(srcdir ) /test,test,'
8793
0 commit comments