Makefile.am 5.0 KB

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