Makefile.am 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. SUBDIRS = .
  2. AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
  3. AM_CPPFLAGS += $(BOOST_INCLUDES) $(MULTITHREADING_FLAG)
  4. # Some versions of GCC warn about some versions of Boost regarding
  5. # missing initializer for members in its posix_time.
  6. # https://svn.boost.org/trac/boost/ticket/3477
  7. # But older GCC compilers don't have the flag.
  8. AM_CXXFLAGS = $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
  9. if USE_CLANGPP
  10. # see ../Makefile.am
  11. AM_CXXFLAGS += -Wno-unused-parameter
  12. endif
  13. # Files to clean include the file created by testing.
  14. CLEANFILES = *.gcno *.gcda $(builddir)/marker_file.dat
  15. TESTS_ENVIRONMENT = \
  16. $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
  17. TESTS =
  18. if HAVE_GTEST
  19. # Build shared libraries for testing. The libtool way to create a shared library
  20. # is to specify "-avoid-version -export-dynamic -module" in the library LDFLAGS
  21. # (see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html).
  22. # Use of these switches will guarantee that the .so files are created in the
  23. # .libs folder and they can be dlopened.
  24. # Note that the shared libraries with callouts should not be used together with
  25. # the --enable-static-link option. With this option, the bind10 libraries are
  26. # statically linked with the program and if the callout invokes the methods
  27. # which belong to these libraries, the library with the callout will get its
  28. # own copy of the static objects (e.g. logger, ServerHooks) and that will lead
  29. # to unexpected errors. For this reason, the --enable-static-link option is
  30. # ignored for unit tests built here.
  31. lib_LTLIBRARIES = libnvl.la libivl.la libfxl.la libbcl.la liblcl.la liblecl.la \
  32. libucl.la libfcl.la
  33. # No version function
  34. libnvl_la_SOURCES = no_version_library.cc
  35. libnvl_la_CXXFLAGS = $(AM_CXXFLAGS)
  36. libnvl_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  37. libnvl_la_LDFLAGS = -avoid-version -export-dynamic -module
  38. # Incorrect version function
  39. libivl_la_SOURCES = incorrect_version_library.cc
  40. libivl_la_CXXFLAGS = $(AM_CXXFLAGS)
  41. libivl_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  42. libivl_la_LDFLAGS = -avoid-version -export-dynamic -module
  43. # All framework functions throw an exception
  44. libfxl_la_SOURCES = framework_exception_library.cc
  45. libfxl_la_CXXFLAGS = $(AM_CXXFLAGS)
  46. libfxl_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  47. libfxl_la_LDFLAGS = -avoid-version -export-dynamic -module
  48. # The basic callout library - contains standard callouts
  49. libbcl_la_SOURCES = basic_callout_library.cc
  50. libbcl_la_CXXFLAGS = $(AM_CXXFLAGS)
  51. libbcl_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  52. libbcl_la_LDFLAGS = -avoid-version -export-dynamic -module
  53. # The load callout library - contains a load function
  54. liblcl_la_SOURCES = load_callout_library.cc
  55. liblcl_la_CXXFLAGS = $(AM_CXXFLAGS)
  56. liblcl_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  57. liblcl_la_LDFLAGS = -avoid-version -export-dynamic -module
  58. # The load error callout library - contains a load function that returns
  59. # an error.
  60. liblecl_la_SOURCES = load_error_callout_library.cc
  61. liblecl_la_CXXFLAGS = $(AM_CXXFLAGS)
  62. liblecl_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  63. liblecl_la_LDFLAGS = -avoid-version -export-dynamic -module
  64. # The unload callout library - contains an unload function that
  65. # creates a marker file.
  66. libucl_la_SOURCES = unload_callout_library.cc
  67. libucl_la_CXXFLAGS = $(AM_CXXFLAGS)
  68. libucl_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  69. libucl_la_LDFLAGS = -avoid-version -export-dynamic -module
  70. # The full callout library - contains all three framework functions.
  71. libfcl_la_SOURCES = full_callout_library.cc
  72. libfcl_la_CXXFLAGS = $(AM_CXXFLAGS)
  73. libfcl_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
  74. libfcl_la_LDFLAGS = -avoid-version -export-dynamic -module -Bstatic $(top_builddir)/src/lib/exceptions/libb10-exceptions.la -Bstatic $(top_builddir)/src/lib/hooks/libb10-hooks.la
  75. libfcl_la_LIBADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
  76. libfcl_la_LIBADD += $(top_builddir)/src/lib/hooks/libb10-hooks.la
  77. TESTS += run_unittests
  78. run_unittests_SOURCES = run_unittests.cc
  79. run_unittests_SOURCES += callout_handle_unittest.cc
  80. run_unittests_SOURCES += callout_manager_unittest.cc
  81. run_unittests_SOURCES += common_test_class.h
  82. run_unittests_SOURCES += handles_unittest.cc
  83. run_unittests_SOURCES += hooks_manager_unittest.cc
  84. run_unittests_SOURCES += library_manager_collection_unittest.cc
  85. run_unittests_SOURCES += library_manager_unittest.cc
  86. run_unittests_SOURCES += server_hooks_unittest.cc
  87. nodist_run_unittests_SOURCES = marker_file.h
  88. nodist_run_unittests_SOURCES += test_libraries.h
  89. run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
  90. run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
  91. run_unittests_LDADD = $(AM_LDADD) $(GTEST_LDADD)
  92. run_unittests_LDADD += $(top_builddir)/src/lib/hooks/libb10-hooks.la
  93. run_unittests_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
  94. run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
  95. run_unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
  96. run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
  97. endif
  98. noinst_PROGRAMS = $(TESTS)
  99. EXTRA_DIST = marker_file.h.in test_libraries.h.in