From 23fb010ea286d29d3f60bab26c40fa92bb70a6ba Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 3 Mar 2016 15:02:03 -0800 Subject: [PATCH] disable dlclose when building with --coverage - refs #3344 --- SConstruct | 4 ++++ src/plugin.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/SConstruct b/SConstruct index 9bc152641..d51b9c86b 100644 --- a/SConstruct +++ b/SConstruct @@ -304,6 +304,7 @@ opts.AddVariables( ('CONFIG', "The path to the python file in which to save user configuration options. Currently : '%s'" % SCONS_LOCAL_CONFIG,SCONS_LOCAL_CONFIG), BoolVariable('USE_CONFIG', "Use SCons user '%s' file (will also write variables after successful configuration)", 'True'), BoolVariable('NO_ATEXIT', 'Will prevent Singletons from being deleted atexit of main thread', 'False'), + BoolVariable('NO_DLCLOSE', 'Will prevent plugins from being unloaded', 'False'), # http://www.scons.org/wiki/GoFastButton # http://stackoverflow.com/questions/1318863/how-to-optimize-an-scons-script BoolVariable('FAST', "Make SCons faster at the cost of less precise dependency tracking", 'False'), @@ -1731,6 +1732,9 @@ if not preconfigured: if env['NO_ATEXIT']: env.Append(CPPDEFINES = '-DMAPNIK_NO_ATEXIT') + if env['NO_DLCLOSE'] or env['COVERAGE']: + env.Append(CPPDEFINES = '-DMAPNIK_NO_DLCLOSE') + # Mac OSX (Darwin) special settings if env['PLATFORM'] == 'Darwin': pthread = '' diff --git a/src/plugin.cpp b/src/plugin.cpp index 7b057284e..af9bef3fb 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -93,7 +93,9 @@ PluginInfo::~PluginInfo() */ if (module_->dl && name_ != "gdal" && name_ != "ogr") { +#ifndef MAPNIK_NO_DLCLOSE dlclose(module_->dl),module_->dl=0; +#endif } #endif delete module_;