Browse Source

[1206] some makefile workarounds

Jelte Jansen 13 years ago
parent
commit
6b27a7ba1c

+ 6 - 0
src/bin/auth/Makefile.am

@@ -50,6 +50,12 @@ b10_auth_SOURCES += command.cc command.h
 b10_auth_SOURCES += common.h common.cc
 b10_auth_SOURCES += statistics.cc statistics.h
 b10_auth_SOURCES += main.cc
+# This is a temporary workaround for #1206, where the InMemoryClient has been
+# moved to an ldopened library. We could add that library to LDADD, but that
+# is nonportable. When #1207 is done this becomes moot anyway, and the
+# specific workaround is not needed anymore, so we can then remove this
+# line again.
+b10_auth_SOURCES += ${top_srcdir}/src/lib/datasrc/memory_datasrc.cc
 
 nodist_b10_auth_SOURCES = auth_messages.h auth_messages.cc
 EXTRA_DIST += auth_messages.mes

+ 6 - 0
src/bin/auth/benchmarks/Makefile.am

@@ -13,6 +13,12 @@ query_bench_SOURCES += ../auth_srv.h ../auth_srv.cc
 query_bench_SOURCES += ../auth_config.h ../auth_config.cc
 query_bench_SOURCES += ../statistics.h ../statistics.cc
 query_bench_SOURCES += ../auth_log.h ../auth_log.cc
+# This is a temporary workaround for #1206, where the InMemoryClient has been
+# moved to an ldopened library. We could add that library to LDADD, but that
+# is nonportable. When #1207 is done this becomes moot anyway, and the
+# specific workaround is not needed anymore, so we can then remove this
+# line again.
+query_bench_SOURCES += ${top_srcdir}/src/lib/datasrc/memory_datasrc.cc
 
 nodist_query_bench_SOURCES = ../auth_messages.h ../auth_messages.cc
 

+ 7 - 0
src/bin/auth/tests/Makefile.am

@@ -37,6 +37,13 @@ run_unittests_SOURCES += query_unittest.cc
 run_unittests_SOURCES += change_user_unittest.cc
 run_unittests_SOURCES += statistics_unittest.cc
 run_unittests_SOURCES += run_unittests.cc
+# This is a temporary workaround for #1206, where the InMemoryClient has been
+# moved to an ldopened library. We could add that library to LDADD, but that
+# is nonportable. When #1207 is done this becomes moot anyway, and the
+# specific workaround is not needed anymore, so we can then remove this
+# line again.
+run_unittests_SOURCES += ${top_srcdir}/src/lib/datasrc/memory_datasrc.cc
+
 
 nodist_run_unittests_SOURCES = ../auth_messages.h ../auth_messages.cc
 

+ 0 - 1
src/lib/datasrc/Makefile.am

@@ -17,7 +17,6 @@ libdatasrc_la_SOURCES += query.h query.cc
 libdatasrc_la_SOURCES += cache.h cache.cc
 libdatasrc_la_SOURCES += rbtree.h
 libdatasrc_la_SOURCES += zonetable.h zonetable.cc
-#libdatasrc_la_SOURCES += memory_datasrc.h memory_datasrc.cc
 libdatasrc_la_SOURCES += zone.h
 libdatasrc_la_SOURCES += result.h
 libdatasrc_la_SOURCES += logger.h logger.cc

+ 0 - 22
src/lib/datasrc/factory.cc

@@ -69,28 +69,6 @@ DataSourceClientContainer::~DataSourceClientContainer() {
     dlclose(ds_lib);
 }
 
-DataSourceClient *
-createDataSourceClient(const std::string& type,
-                       isc::data::ConstElementPtr config) {
-    // The name of the loadable module is type + _ds.so
-    // config is assumed to be ok
-    std::string dl_name = type + "_ds.so";
-
-    void *ds_lib = dlopen(dl_name.c_str(), RTLD_LAZY);
-    if (ds_lib == NULL) {
-        isc_throw(DataSourceError, "Unable to load " << type <<
-                  ": " << dlerror());
-    }
-    dlerror();
-    ds_creator* ds_create = (ds_creator*)dlsym(ds_lib, "createInstance");
-    const char* dlsym_error = dlerror();
-    if (dlsym_error != NULL) {
-        isc_throw(DataSourceError, "Error in library " << type <<
-                  ": " << dlsym_error);
-    }
-    return (ds_create(config));
-}
-
 } // end namespace datasrc
 } // end namespace isc
 

+ 4 - 1
src/lib/datasrc/memory_datasrc.cc

@@ -804,6 +804,9 @@ InMemoryClient::getUpdater(const isc::dns::Name&, bool) const {
     isc_throw(isc::NotImplemented, "Update attempt on in memory data source");
 }
 
+// due to a c++ symbol lookup oddity, we need to explicitely put this into
+// an anonymous namespace. Once we remove memory.cc from the general datasource
+// lib, we can export this
 bool
 checkConfig(ConstElementPtr, ElementPtr) {
     // current inmem has no options (yet)
@@ -825,4 +828,4 @@ void destroyInstance(DataSourceClient* instance) {
 
 
 } // end of namespace datasrc
-} // end of namespace dns
+} // end of namespace isc

+ 0 - 2
src/lib/datasrc/tests/factory_unittest.cc

@@ -31,7 +31,6 @@ namespace {
 // The default implementation is NotImplemented
 TEST(FactoryTest, memoryClient) {
     DataSourceClientContainer client("memory", ElementPtr());
-    DataSourceClientContainer client2("memory", ElementPtr());
 }
 
 TEST(FactoryTest, badType) {
@@ -122,6 +121,5 @@ TEST(FactoryTest, sqlite3ClientBadConfig3) {
     ASSERT_THROW(DataSourceClientContainer("sqlite3", config),
                  SQLite3Error);
 }
-
 } // end anonymous namespace