Makefile.am 7.58 KB
Newer Older
1 2 3 4
SUBDIRS = .

AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
AM_CPPFLAGS += $(BOOST_INCLUDES)
5 6
AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/dhcpsrv/tests\"
AM_CPPFLAGS += -DDHCP_DATA_DIR=\"$(abs_top_builddir)/src/lib/dhcpsrv/tests\"
7
AM_CPPFLAGS += -DKEA_LFC_BUILD_DIR=\"$(abs_top_builddir)/src/bin/lfc\"
Francis Dupont's avatar
Francis Dupont committed
8
AM_CPPFLAGS += -DLOGGING_SPEC_FILE=\"$(abs_top_srcdir)/src/lib/dhcpsrv/logging.spec\"
9 10
AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"

11
AM_CXXFLAGS = $(KEA_CXXFLAGS)
12

13 14 15 16
if USE_STATIC_LINK
AM_LDFLAGS = -static
endif

17 18 19 20 21 22 23 24 25
# Some versions of GCC warn about some versions of Boost regarding
# missing initializer for members in its posix_time.
# https://svn.boost.org/trac/boost/ticket/3477
# But older GCC compilers don't have the flag.
AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)

CLEANFILES = *.gcno *.gcda

TESTS_ENVIRONMENT = \
26
        $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
27 28 29

TESTS =
if HAVE_GTEST
30 31 32 33 34 35 36 37 38 39 40 41 42
# Build shared libraries for testing. The libtool way to create a shared library
# is to specify "-avoid-version -export-dynamic -module" in the library LDFLAGS
# (see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html).
# Use of these switches will guarantee that the .so files are created in the
# .libs folder and they can be dlopened.
# Note that the shared libraries with callouts should not be used together with
# the --enable-static-link option. With this option, the bind10 libraries are
# statically linked with the program and if the callout invokes the methods
# which belong to these libraries, the library with the callout will get its
# own copy of the static objects (e.g. logger, ServerHooks) and that will lead
# to unexpected errors. For this reason, the --enable-static-link option is
# ignored for unit tests built here.

43 44 45 46
noinst_LTLIBRARIES = libco1.la libco2.la

# -rpath /nowhere is a hack to trigger libtool to not create a
# convenience archive, resulting in shared modules
47 48 49

libco1_la_SOURCES  = callout_library.cc
libco1_la_CXXFLAGS = $(AM_CXXFLAGS)
50
libco1_la_CPPFLAGS = $(AM_CPPFLAGS)
51
libco1_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
52 53 54

libco2_la_SOURCES  = callout_library.cc
libco2_la_CXXFLAGS = $(AM_CXXFLAGS)
55
libco2_la_CPPFLAGS = $(AM_CPPFLAGS)
56
libco2_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
57

58 59 60 61
TESTS += libdhcpsrv_unittests

libdhcpsrv_unittests_SOURCES  = run_unittests.cc
libdhcpsrv_unittests_SOURCES += addr_utilities_unittest.cc
62
libdhcpsrv_unittests_SOURCES += alloc_engine_utils.cc alloc_engine_utils.h
63
libdhcpsrv_unittests_SOURCES += alloc_engine_expiration_unittest.cc
64 65 66
libdhcpsrv_unittests_SOURCES += alloc_engine_hooks_unittest.cc
libdhcpsrv_unittests_SOURCES += alloc_engine4_unittest.cc
libdhcpsrv_unittests_SOURCES += alloc_engine6_unittest.cc
67
libdhcpsrv_unittests_SOURCES += callout_handle_store_unittest.cc
68
libdhcpsrv_unittests_SOURCES += cfg_expiration_unittest.cc
69
libdhcpsrv_unittests_SOURCES += cfg_hosts_unittest.cc
70
libdhcpsrv_unittests_SOURCES += cfg_iface_unittest.cc
Tomek Mrugalski's avatar
Tomek Mrugalski committed
71
libdhcpsrv_unittests_SOURCES += cfg_mac_source_unittest.cc
72
libdhcpsrv_unittests_SOURCES += cfg_option_unittest.cc
73
libdhcpsrv_unittests_SOURCES += cfg_option_def_unittest.cc
74
libdhcpsrv_unittests_SOURCES += cfg_rsoo_unittest.cc
75
libdhcpsrv_unittests_SOURCES += cfg_subnets4_unittest.cc
76
libdhcpsrv_unittests_SOURCES += cfg_subnets6_unittest.cc
77
libdhcpsrv_unittests_SOURCES += cfgmgr_unittest.cc
78
libdhcpsrv_unittests_SOURCES += client_class_def_unittest.cc
79
libdhcpsrv_unittests_SOURCES += csv_lease_file4_unittest.cc
80
libdhcpsrv_unittests_SOURCES += csv_lease_file6_unittest.cc
81
libdhcpsrv_unittests_SOURCES += d2_client_unittest.cc
82
libdhcpsrv_unittests_SOURCES += d2_udp_unittest.cc
83
libdhcpsrv_unittests_SOURCES += daemon_unittest.cc
84
libdhcpsrv_unittests_SOURCES += database_connection_unittest.cc
85
libdhcpsrv_unittests_SOURCES += dbaccess_parser_unittest.cc
86
libdhcpsrv_unittests_SOURCES += expiration_config_parser_unittest.cc
87
libdhcpsrv_unittests_SOURCES += host_mgr_unittest.cc
88
libdhcpsrv_unittests_SOURCES += host_unittest.cc
89
libdhcpsrv_unittests_SOURCES += host_reservation_parser_unittest.cc
90
libdhcpsrv_unittests_SOURCES += host_reservations_list_parser_unittest.cc
91
libdhcpsrv_unittests_SOURCES += ifaces_config_parser_unittest.cc
92
libdhcpsrv_unittests_SOURCES += lease_file_io.cc lease_file_io.h
93
libdhcpsrv_unittests_SOURCES += lease_file_loader_unittest.cc
94
libdhcpsrv_unittests_SOURCES += lease_unittest.cc
95 96
libdhcpsrv_unittests_SOURCES += lease_mgr_factory_unittest.cc
libdhcpsrv_unittests_SOURCES += lease_mgr_unittest.cc
97
libdhcpsrv_unittests_SOURCES += logging_unittest.cc
98
libdhcpsrv_unittests_SOURCES += logging_info_unittest.cc
99
libdhcpsrv_unittests_SOURCES += generic_lease_mgr_unittest.cc generic_lease_mgr_unittest.h
100
libdhcpsrv_unittests_SOURCES += memfile_lease_mgr_unittest.cc
101
libdhcpsrv_unittests_SOURCES += dhcp_parsers_unittest.cc
102 103 104
if HAVE_MYSQL
libdhcpsrv_unittests_SOURCES += mysql_lease_mgr_unittest.cc
endif
105 106 107

libdhcpsrv_unittests_SOURCES += ncr_generator_unittest.cc

108 109 110
if HAVE_PGSQL
libdhcpsrv_unittests_SOURCES += pgsql_lease_mgr_unittest.cc
endif
111
libdhcpsrv_unittests_SOURCES += pool_unittest.cc
112 113
libdhcpsrv_unittests_SOURCES += schema_mysql_copy.h
libdhcpsrv_unittests_SOURCES += schema_pgsql_copy.h
114
libdhcpsrv_unittests_SOURCES += srv_config_unittest.cc
115
libdhcpsrv_unittests_SOURCES += subnet_unittest.cc
116
libdhcpsrv_unittests_SOURCES += test_get_callout_handle.cc test_get_callout_handle.h
117
libdhcpsrv_unittests_SOURCES += triplet_unittest.cc
Tomek Mrugalski's avatar
Tomek Mrugalski committed
118
libdhcpsrv_unittests_SOURCES += test_utils.cc test_utils.h
119
libdhcpsrv_unittests_SOURCES += timer_mgr_unittest.cc
120

121
libdhcpsrv_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
122 123 124
if HAVE_MYSQL
libdhcpsrv_unittests_CPPFLAGS += $(MYSQL_CPPFLAGS)
endif
125 126 127
if HAVE_PGSQL
libdhcpsrv_unittests_CPPFLAGS += $(PGSQL_CPPFLAGS)
endif
128

129
libdhcpsrv_unittests_LDFLAGS  = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
130 131 132
if HAVE_MYSQL
libdhcpsrv_unittests_LDFLAGS  += $(MYSQL_LIBS)
endif
133 134 135
if HAVE_PGSQL
libdhcpsrv_unittests_LDFLAGS  += $(PGSQL_LIBS)
endif
136 137 138 139 140 141 142 143 144

libdhcpsrv_unittests_CXXFLAGS = $(AM_CXXFLAGS)
if USE_CLANGPP
# This is to workaround unused variables tcout and tcerr in
# log4cplus's streams.h and unused parameters from some of the
# Boost headers.
libdhcpsrv_unittests_CXXFLAGS += -Wno-unused-variable -Wno-unused-parameter
endif

145
libdhcpsrv_unittests_LDADD  = $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
146
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
147
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
148
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
149
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
150 151
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp/tests/libdhcptest.la
152
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
153 154 155
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
156 157
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
158 159
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
160
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
161
libdhcpsrv_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
162
libdhcpsrv_unittests_LDADD += $(BOOST_LIBS) $(GTEST_LDADD)
163 164 165
endif

noinst_PROGRAMS = $(TESTS)