bliss: Fix monolithic build

This requires moving test files so that the Makefile for the tests can be
included after building libstrongswan, which requires the plugin when
building monolithically.  Due to this a static helper library is required
as directly referring to object files (or source files) is not possible.

It's also necessary to avoid any link-time dependency on libstrongswan in
bliss_huffman, to avoid circular dependencies (bliss_huffman -> libstrongswan
-> bliss -> bliss_huffman).
This commit is contained in:
Tobias Brunner
2014-12-12 12:00:20 +01:00
committed by Andreas Steffen
parent f55a03a2de
commit 700df23886
13 changed files with 123 additions and 100 deletions
+28 -47
View File
@@ -5,75 +5,56 @@ AM_CFLAGS = \
$(PLUGIN_CFLAGS) \
@COVERAGE_CFLAGS@
if MONOLITHIC
noinst_LTLIBRARIES = libstrongswan-bliss.la
else
plugin_LTLIBRARIES = libstrongswan-bliss.la
endif
libstrongswan_bliss_la_SOURCES = \
bliss_plugin.h bliss_plugin.c \
# these file are also used by bliss_huffman
noinst_LTLIBRARIES = libbliss-params.la
libbliss_params_la_SOURCES = \
bliss_param_set.h bliss_param_set.c \
bliss_fft_params.h bliss_fft_params.c
# these files are also used by the tests, we can't directly refer to them
# because of the subdirectory, which would cause distclean to fail
noinst_LTLIBRARIES += libbliss.la
libbliss_la_SOURCES = \
bliss_private_key.h bliss_private_key.c \
bliss_public_key.h bliss_public_key.c \
bliss_signature.h bliss_signature.c \
bliss_utils.h bliss_utils.c \
bliss_bitpacker.h bliss_bitpacker.c \
bliss_fft.h bliss_fft.c \
bliss_fft_params.h bliss_fft_params.c \
bliss_huffman_code.h bliss_huffman_code.c \
bliss_huffman_code_1.c bliss_huffman_code_3.c bliss_huffman_code_4.c \
bliss_sampler.h bliss_sampler.c
libbliss_la_LIBADD = libbliss-params.la
CLEANFILES = \
bliss_huffman_code_1.c bliss_huffman_code_3.c bliss_huffman_code_4.c
if MONOLITHIC
noinst_LTLIBRARIES += libstrongswan-bliss.la
else
plugin_LTLIBRARIES = libstrongswan-bliss.la
endif
libstrongswan_bliss_la_SOURCES = \
bliss_plugin.h bliss_plugin.c
libstrongswan_bliss_la_LDFLAGS = -module -avoid-version
libstrongswan_bliss_la_LIBADD = libbliss.la
noinst_PROGRAMS = bliss_huffman
bliss_huffman_SOURCES = bliss_huffman.c
bliss_huffman_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la -lm \
bliss_param_set.o bliss_fft_params.o
bliss_huffman_LDADD = -lm libbliss-params.la
bliss_huffman_code_1.c : bliss_huffman bliss_huffman_code.h
$(AM_V_GEN) \
./bliss_huffman 1 8 > $@
./bliss_huffman 1 8 > $@ 2>/dev/null
bliss_huffman_code_3.c : bliss_huffman bliss_huffman_code.h
$(AM_V_GEN) \
./bliss_huffman 3 16 > $@
./bliss_huffman 3 16 > $@ 2>/dev/null
bliss_huffman_code_4.c : bliss_huffman bliss_huffman_code.h
$(AM_V_GEN) \
./bliss_huffman 4 32 > $@
TESTS = bliss_tests
check_PROGRAMS = $(TESTS)
bliss_tests_SOURCES = \
suites/test_bliss_fft.c \
suites/test_bliss_bitpacker.c \
suites/test_bliss_sampler.c \
suites/test_bliss_sign.c \
bliss_fft_params.c \
bliss_fft.c \
bliss_private_key.c \
bliss_public_key.c \
bliss_param_set.c \
bliss_sampler.c \
bliss_signature.c \
bliss_utils.c \
bliss_bitpacker.c \
bliss_tests.h bliss_tests.c
bliss_tests_CFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
-I$(top_srcdir)/src/libstrongswan/tests \
-DPLUGINDIR=\""$(abs_top_builddir)/src/libstrongswan/plugins\"" \
-DPLUGINS=\""${s_plugins}\"" \
@COVERAGE_CFLAGS@
bliss_tests_LDFLAGS = @COVERAGE_LDFLAGS@
bliss_tests_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
$(top_builddir)/src/libstrongswan/tests/libtest.la
./bliss_huffman 4 32 > $@ 2>/dev/null