Commit 10386454 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2850] Build ZoneTableSegmentMapped only where shared memory support is enabled

parent f41e4c31
...@@ -893,6 +893,9 @@ if test X$use_shared_memory = Xyes -a "$BOOST_MAPPED_FILE_WOULDFAIL" = "yes"; th ...@@ -893,6 +893,9 @@ if test X$use_shared_memory = Xyes -a "$BOOST_MAPPED_FILE_WOULDFAIL" = "yes"; th
AC_MSG_ERROR([Boost shared memory does not compile on this system. If you don't need it (most normal users won't) build without it; using a different compiler or a different version of Boost may also help.]) AC_MSG_ERROR([Boost shared memory does not compile on this system. If you don't need it (most normal users won't) build without it; using a different compiler or a different version of Boost may also help.])
fi fi
AM_CONDITIONAL([USE_SHARED_MEMORY], [test x$use_shared_memory = xyes]) AM_CONDITIONAL([USE_SHARED_MEMORY], [test x$use_shared_memory = xyes])
if test "x$use_shared_memory" = "xyes"; then
AC_DEFINE(USE_SHARED_MEMORY, 1, [Define to 1 if shared memory support is enabled])
fi
AC_SUBST(BOOST_MAPPED_FILE_CXXFLAG) AC_SUBST(BOOST_MAPPED_FILE_CXXFLAG)
# Add some default CPP flags needed for Boost, identified by the AX macro. # Add some default CPP flags needed for Boost, identified by the AX macro.
......
...@@ -22,7 +22,11 @@ libdatasrc_memory_la_SOURCES += zone_table.h zone_table.cc ...@@ -22,7 +22,11 @@ libdatasrc_memory_la_SOURCES += zone_table.h zone_table.cc
libdatasrc_memory_la_SOURCES += zone_finder.h zone_finder.cc libdatasrc_memory_la_SOURCES += zone_finder.h zone_finder.cc
libdatasrc_memory_la_SOURCES += zone_table_segment.h zone_table_segment.cc libdatasrc_memory_la_SOURCES += zone_table_segment.h zone_table_segment.cc
libdatasrc_memory_la_SOURCES += zone_table_segment_local.h zone_table_segment_local.cc libdatasrc_memory_la_SOURCES += zone_table_segment_local.h zone_table_segment_local.cc
if USE_SHARED_MEMORY
libdatasrc_memory_la_SOURCES += zone_table_segment_mapped.h zone_table_segment_mapped.cc libdatasrc_memory_la_SOURCES += zone_table_segment_mapped.h zone_table_segment_mapped.cc
endif
libdatasrc_memory_la_SOURCES += zone_data_updater.h zone_data_updater.cc libdatasrc_memory_la_SOURCES += zone_data_updater.h zone_data_updater.cc
libdatasrc_memory_la_SOURCES += zone_data_loader.h zone_data_loader.cc libdatasrc_memory_la_SOURCES += zone_data_loader.h zone_data_loader.cc
libdatasrc_memory_la_SOURCES += memory_client.h memory_client.cc libdatasrc_memory_la_SOURCES += memory_client.h memory_client.cc
......
...@@ -12,9 +12,13 @@ ...@@ -12,9 +12,13 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include "config.h"
#include <datasrc/memory/zone_table_segment.h> #include <datasrc/memory/zone_table_segment.h>
#include <datasrc/memory/zone_table_segment_local.h> #include <datasrc/memory/zone_table_segment_local.h>
#ifdef USE_SHARED_MEMORY
#include <datasrc/memory/zone_table_segment_mapped.h> #include <datasrc/memory/zone_table_segment_mapped.h>
#endif
#include <datasrc/memory/zone_writer.h> #include <datasrc/memory/zone_writer.h>
#include <string> #include <string>
...@@ -32,8 +36,10 @@ ZoneTableSegment::create(const RRClass& rrclass, const std::string& type) { ...@@ -32,8 +36,10 @@ ZoneTableSegment::create(const RRClass& rrclass, const std::string& type) {
// Until that it becomes a real issue we won't be too smart. // Until that it becomes a real issue we won't be too smart.
if (type == "local") { if (type == "local") {
return (new ZoneTableSegmentLocal(rrclass)); return (new ZoneTableSegmentLocal(rrclass));
#ifdef USE_SHARED_MEMORY
} else if (type == "mapped") { } else if (type == "mapped") {
return (new ZoneTableSegmentMapped(rrclass)); return (new ZoneTableSegmentMapped(rrclass));
#endif
} }
isc_throw(UnknownSegmentType, "Zone table segment type not supported: " isc_throw(UnknownSegmentType, "Zone table segment type not supported: "
<< type); << type);
......
...@@ -39,7 +39,11 @@ run_unittests_SOURCES += zone_data_loader_unittest.cc ...@@ -39,7 +39,11 @@ run_unittests_SOURCES += zone_data_loader_unittest.cc
run_unittests_SOURCES += zone_data_updater_unittest.cc run_unittests_SOURCES += zone_data_updater_unittest.cc
run_unittests_SOURCES += zone_table_segment_test.h run_unittests_SOURCES += zone_table_segment_test.h
run_unittests_SOURCES += zone_table_segment_unittest.cc run_unittests_SOURCES += zone_table_segment_unittest.cc
if USE_SHARED_MEMORY
run_unittests_SOURCES += zone_table_segment_mapped_unittest.cc run_unittests_SOURCES += zone_table_segment_mapped_unittest.cc
endif
run_unittests_SOURCES += zone_writer_unittest.cc run_unittests_SOURCES += zone_writer_unittest.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment