remove special ltdl dladvise usage - no longer needed after #790
This commit is contained in:
parent
59d0e306cf
commit
556bc2c869
3 changed files with 1 additions and 92 deletions
31
SConstruct
31
SConstruct
|
@ -140,34 +140,6 @@ def strip_first(string,find,replace=''):
|
||||||
return string.replace(find,replace,1)
|
return string.replace(find,replace,1)
|
||||||
return string
|
return string
|
||||||
|
|
||||||
def get_libtool_major_version():
|
|
||||||
"""libtool >= 2.1b support lt_dlopenadvise and the previous
|
|
||||||
release appears to be 1.9f (based on NEWS) so checking for
|
|
||||||
>= 2 seems adequate.
|
|
||||||
"""
|
|
||||||
cmd = 'libtool'
|
|
||||||
if platform.uname()[0] == "Darwin":
|
|
||||||
cmd = 'glibtool'
|
|
||||||
version = None
|
|
||||||
fallback_version = 2
|
|
||||||
pattern = r'(.*[^\S])(\d{1}\.\d+\.?\d?)(.*[^\S])'
|
|
||||||
ret = os.popen('%s --version' % cmd).read()
|
|
||||||
match = re.match(pattern,ret)
|
|
||||||
if match:
|
|
||||||
groups = match.groups()
|
|
||||||
if len(groups):
|
|
||||||
version_string = groups[1]
|
|
||||||
if version_string:
|
|
||||||
version_string = version_string.split('.')[0]
|
|
||||||
try:
|
|
||||||
version = int(version_string)
|
|
||||||
except ValueError:
|
|
||||||
pass
|
|
||||||
if not version:
|
|
||||||
color_print(1,'Could not detect libtool --version, assuming major version 2')
|
|
||||||
return fallback_version
|
|
||||||
return version
|
|
||||||
|
|
||||||
# http://www.scons.org/wiki/InstallTargets
|
# http://www.scons.org/wiki/InstallTargets
|
||||||
def create_uninstall_target(env, path, is_glob=False):
|
def create_uninstall_target(env, path, is_glob=False):
|
||||||
if 'uninstall' in COMMAND_LINE_TARGETS:
|
if 'uninstall' in COMMAND_LINE_TARGETS:
|
||||||
|
@ -430,7 +402,6 @@ pickle_store = [# Scons internal variables
|
||||||
'HAS_CAIRO',
|
'HAS_CAIRO',
|
||||||
'HAS_PYCAIRO',
|
'HAS_PYCAIRO',
|
||||||
'HAS_LIBXML2',
|
'HAS_LIBXML2',
|
||||||
'LIBTOOL_SUPPORTS_ADVISE',
|
|
||||||
'PYTHON_IS_64BIT',
|
'PYTHON_IS_64BIT',
|
||||||
'SAMPLE_INPUT_PLUGINS',
|
'SAMPLE_INPUT_PLUGINS',
|
||||||
'PKG_CONFIG_PATH',
|
'PKG_CONFIG_PATH',
|
||||||
|
@ -972,8 +943,6 @@ if not preconfigured:
|
||||||
env['PLATFORM'] = platform.uname()[0]
|
env['PLATFORM'] = platform.uname()[0]
|
||||||
color_print(4,"Configuring on %s in *%s*..." % (env['PLATFORM'],mode))
|
color_print(4,"Configuring on %s in *%s*..." % (env['PLATFORM'],mode))
|
||||||
|
|
||||||
env['LIBTOOL_SUPPORTS_ADVISE'] = get_libtool_major_version() >= 2
|
|
||||||
|
|
||||||
env['MISSING_DEPS'] = []
|
env['MISSING_DEPS'] = []
|
||||||
env['SKIPPED_DEPS'] = []
|
env['SKIPPED_DEPS'] = []
|
||||||
env['HAS_CAIRO'] = False
|
env['HAS_CAIRO'] = False
|
||||||
|
|
15
src/build.py
15
src/build.py
|
@ -105,6 +105,7 @@ source = Split(
|
||||||
"""
|
"""
|
||||||
color.cpp
|
color.cpp
|
||||||
box2d.cpp
|
box2d.cpp
|
||||||
|
datasource_cache.cpp
|
||||||
expression_string.cpp
|
expression_string.cpp
|
||||||
filter_factory.cpp
|
filter_factory.cpp
|
||||||
feature_type_style.cpp
|
feature_type_style.cpp
|
||||||
|
@ -192,20 +193,6 @@ if env['RENDERING_STATS']:
|
||||||
else:
|
else:
|
||||||
source.insert(0,processor_cpp);
|
source.insert(0,processor_cpp);
|
||||||
|
|
||||||
|
|
||||||
# add the datasource_cache.cpp with custom LIBTOOL flag if needed
|
|
||||||
if env['LIBTOOL_SUPPORTS_ADVISE']:
|
|
||||||
env3 = lib_env.Clone()
|
|
||||||
env3.Append(CXXFLAGS='-DLIBTOOL_SUPPORTS_ADVISE')
|
|
||||||
libmapnik_cxxflags.append('-DLIBTOOL_SUPPORTS_ADVISE')
|
|
||||||
cpp = 'datasource_cache.cpp'
|
|
||||||
if env['LINKING'] == 'static':
|
|
||||||
source.insert(0,env3.StaticObject(cpp))
|
|
||||||
else:
|
|
||||||
source.insert(0,env3.SharedObject(cpp))
|
|
||||||
else:
|
|
||||||
source.insert(0,'datasource_cache.cpp')
|
|
||||||
|
|
||||||
if env['JPEG']:
|
if env['JPEG']:
|
||||||
source += Split(
|
source += Split(
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include <mapnik/config_error.hpp>
|
#include <mapnik/config_error.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/version.hpp>
|
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
#include <boost/filesystem/operations.hpp>
|
#include <boost/filesystem/operations.hpp>
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
@ -152,64 +151,18 @@ void datasource_cache::register_datasources(const std::string& str)
|
||||||
for (boost::filesystem::directory_iterator itr(path);itr!=end_itr;++itr )
|
for (boost::filesystem::directory_iterator itr(path);itr!=end_itr;++itr )
|
||||||
{
|
{
|
||||||
|
|
||||||
#if BOOST_VERSION < 103400
|
|
||||||
if (!is_directory( *itr ) && is_input_plugin(itr->leaf()))
|
|
||||||
#else
|
|
||||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
#if (BOOST_FILESYSTEM_VERSION == 3)
|
||||||
if (!is_directory( *itr ) && is_input_plugin(itr->path().filename().string()))
|
if (!is_directory( *itr ) && is_input_plugin(itr->path().filename().string()))
|
||||||
#else // v2
|
#else // v2
|
||||||
if (!is_directory( *itr ) && is_input_plugin(itr->path().leaf()))
|
if (!is_directory( *itr ) && is_input_plugin(itr->path().leaf()))
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#ifdef LIBTOOL_SUPPORTS_ADVISE
|
|
||||||
/* Note: the below was added as a workaround pre http://trac.mapnik.org/ticket/790
|
|
||||||
It could now be removed, but also is not doing any harm AFAICT.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// with ltdl >=2.2 we can actually pass RTDL_GLOBAL to dlopen via the
|
|
||||||
// ltdl advise trick which is required on linux unless plugins are directly
|
|
||||||
// linked to libmapnik (and deps) at build time. The only other approach is to
|
|
||||||
// set the dlopen flags in the calling process (like in the python bindings)
|
|
||||||
|
|
||||||
// clear errors
|
|
||||||
lt_dlerror();
|
|
||||||
|
|
||||||
lt_dlhandle module = 0;
|
|
||||||
lt_dladvise advise;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = lt_dlinit();
|
|
||||||
if (ret != 0) {
|
|
||||||
std::clog << "Datasource loader: could not intialize dynamic loading: " << lt_dlerror() << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = lt_dladvise_init(&advise);
|
|
||||||
if (ret != 0) {
|
|
||||||
std::clog << "Datasource loader: could not intialize dynamic loading: " << lt_dlerror() << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = lt_dladvise_global(&advise);
|
|
||||||
if (ret != 0) {
|
|
||||||
std::clog << "Datasource loader: could not intialize dynamic loading of global symbols: " << lt_dlerror() << "\n";
|
|
||||||
}
|
|
||||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
|
||||||
module = lt_dlopenadvise (itr->path().string().c_str(), advise);
|
|
||||||
#else // v2
|
|
||||||
module = lt_dlopenadvise (itr->string().c_str(), advise);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lt_dladvise_destroy(&advise);
|
|
||||||
#else
|
|
||||||
|
|
||||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
#if (BOOST_FILESYSTEM_VERSION == 3)
|
||||||
lt_dlhandle module = lt_dlopen(itr->path().string().c_str());
|
lt_dlhandle module = lt_dlopen(itr->path().string().c_str());
|
||||||
#else // v2
|
#else // v2
|
||||||
lt_dlhandle module = lt_dlopen(itr->string().c_str());
|
lt_dlhandle module = lt_dlopen(itr->string().c_str());
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if (module)
|
if (module)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue