Makefile.am 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. SUBDIRS = .
  2. AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
  3. AM_CPPFLAGS += $(BOOST_INCLUDES)
  4. AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/dhcpsrv/tests\"
  5. AM_CPPFLAGS += -DDHCP_DATA_DIR=\"$(abs_top_builddir)/src/lib/dhcpsrv/tests\"
  6. AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
  7. AM_CXXFLAGS = $(KEA_CXXFLAGS)
  8. # Some versions of GCC warn about some versions of Boost regarding
  9. # missing initializer for members in its posix_time.
  10. # https://svn.boost.org/trac/boost/ticket/3477
  11. # But older GCC compilers don't have the flag.
  12. AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
  13. CLEANFILES = *.gcno *.gcda
  14. TESTS_ENVIRONMENT = \
  15. $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
  16. TESTS =
  17. if HAVE_GTEST
  18. # Build shared libraries for testing. The libtool way to create a shared library
  19. # is to specify "-avoid-version -export-dynamic -module" in the library LDFLAGS
  20. # (see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html).
  21. # Use of these switches will guarantee that the .so files are created in the
  22. # .libs folder and they can be dlopened.
  23. # Note that the shared libraries with callouts should not be used together with
  24. # the --enable-static-link option. With this option, the bind10 libraries are
  25. # statically linked with the program and if the callout invokes the methods
  26. # which belong to these libraries, the library with the callout will get its
  27. # own copy of the static objects (e.g. logger, ServerHooks) and that will lead
  28. # to unexpected errors. For this reason, the --enable-static-link option is
  29. # ignored for unit tests built here.
  30. noinst_LTLIBRARIES = libco1.la libco2.la
  31. # -rpath /nowhere is a hack to trigger libtool to not create a
  32. # convenience archive, resulting in shared modules
  33. libco1_la_SOURCES = callout_library.cc
  34. libco1_la_CXXFLAGS = $(AM_CXXFLAGS)
  35. libco1_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  36. libco1_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
  37. libco2_la_SOURCES = callout_library.cc
  38. libco2_la_CXXFLAGS = $(AM_CXXFLAGS)
  39. libco2_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  40. libco2_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
  41. TESTS += libdhcpsrv_unittests
  42. libdhcpsrv_unittests_SOURCES = run_unittests.cc
  43. libdhcpsrv_unittests_SOURCES += addr_utilities_unittest.cc
  44. libdhcpsrv_unittests_SOURCES += alloc_engine_unittest.cc
  45. libdhcpsrv_unittests_SOURCES += callout_handle_store_unittest.cc
  46. libdhcpsrv_unittests_SOURCES += configuration_unittest.cc
  47. libdhcpsrv_unittests_SOURCES += cfgmgr_unittest.cc
  48. libdhcpsrv_unittests_SOURCES += csv_lease_file4_unittest.cc
  49. libdhcpsrv_unittests_SOURCES += csv_lease_file6_unittest.cc
  50. libdhcpsrv_unittests_SOURCES += d2_client_unittest.cc
  51. libdhcpsrv_unittests_SOURCES += d2_udp_unittest.cc
  52. libdhcpsrv_unittests_SOURCES += daemon_unittest.cc
  53. libdhcpsrv_unittests_SOURCES += dbaccess_parser_unittest.cc
  54. libdhcpsrv_unittests_SOURCES += cfg_iface_unittest.cc
  55. libdhcpsrv_unittests_SOURCES += lease_file_io.cc lease_file_io.h
  56. libdhcpsrv_unittests_SOURCES += lease_unittest.cc
  57. libdhcpsrv_unittests_SOURCES += lease_mgr_factory_unittest.cc
  58. libdhcpsrv_unittests_SOURCES += lease_mgr_unittest.cc
  59. libdhcpsrv_unittests_SOURCES += logging_unittest.cc
  60. libdhcpsrv_unittests_SOURCES += generic_lease_mgr_unittest.cc generic_lease_mgr_unittest.h
  61. libdhcpsrv_unittests_SOURCES += memfile_lease_mgr_unittest.cc
  62. libdhcpsrv_unittests_SOURCES += dhcp_parsers_unittest.cc
  63. if HAVE_MYSQL
  64. libdhcpsrv_unittests_SOURCES += mysql_lease_mgr_unittest.cc
  65. endif
  66. if HAVE_PGSQL
  67. libdhcpsrv_unittests_SOURCES += pgsql_lease_mgr_unittest.cc
  68. endif
  69. libdhcpsrv_unittests_SOURCES += pool_unittest.cc
  70. libdhcpsrv_unittests_SOURCES += schema_mysql_copy.h
  71. libdhcpsrv_unittests_SOURCES += schema_pgsql_copy.h
  72. libdhcpsrv_unittests_SOURCES += subnet_unittest.cc
  73. libdhcpsrv_unittests_SOURCES += test_get_callout_handle.cc test_get_callout_handle.h
  74. libdhcpsrv_unittests_SOURCES += triplet_unittest.cc
  75. libdhcpsrv_unittests_SOURCES += test_utils.cc test_utils.h
  76. libdhcpsrv_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
  77. if HAVE_MYSQL
  78. libdhcpsrv_unittests_CPPFLAGS += $(MYSQL_CPPFLAGS)
  79. endif
  80. if HAVE_PGSQL
  81. libdhcpsrv_unittests_CPPFLAGS += $(PGSQL_CPPFLAGS)
  82. endif
  83. libdhcpsrv_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
  84. if HAVE_MYSQL
  85. libdhcpsrv_unittests_LDFLAGS += $(MYSQL_LIBS)
  86. endif
  87. if HAVE_PGSQL
  88. libdhcpsrv_unittests_LDFLAGS += $(PGSQL_LIBS)
  89. endif
  90. libdhcpsrv_unittests_CXXFLAGS = $(AM_CXXFLAGS)
  91. if USE_CLANGPP
  92. # This is to workaround unused variables tcout and tcerr in
  93. # log4cplus's streams.h and unused parameters from some of the
  94. # Boost headers.
  95. libdhcpsrv_unittests_CXXFLAGS += -Wno-unused-variable -Wno-unused-parameter
  96. endif
  97. libdhcpsrv_unittests_LDADD = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
  98. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
  99. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp/tests/libdhcptest.la
  100. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
  101. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
  102. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
  103. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
  104. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
  105. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
  106. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
  107. libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
  108. libdhcpsrv_unittests_LDADD += $(GTEST_LDADD)
  109. endif
  110. noinst_PROGRAMS = $(TESTS)