diff --git a/SConstruct b/SConstruct index 1230fdd62..cae93d64b 100644 --- a/SConstruct +++ b/SConstruct @@ -140,34 +140,6 @@ def strip_first(string,find,replace=''): return string.replace(find,replace,1) 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 def create_uninstall_target(env, path, is_glob=False): if 'uninstall' in COMMAND_LINE_TARGETS: @@ -430,7 +402,6 @@ pickle_store = [# Scons internal variables 'HAS_CAIRO', 'HAS_PYCAIRO', 'HAS_LIBXML2', - 'LIBTOOL_SUPPORTS_ADVISE', 'PYTHON_IS_64BIT', 'SAMPLE_INPUT_PLUGINS', 'PKG_CONFIG_PATH', @@ -972,8 +943,6 @@ if not preconfigured: env['PLATFORM'] = platform.uname()[0] color_print(4,"Configuring on %s in *%s*..." % (env['PLATFORM'],mode)) - env['LIBTOOL_SUPPORTS_ADVISE'] = get_libtool_major_version() >= 2 - env['MISSING_DEPS'] = [] env['SKIPPED_DEPS'] = [] env['HAS_CAIRO'] = False diff --git a/src/build.py b/src/build.py index 2d9b506a3..927cda481 100644 --- a/src/build.py +++ b/src/build.py @@ -105,6 +105,7 @@ source = Split( """ color.cpp box2d.cpp + datasource_cache.cpp expression_string.cpp filter_factory.cpp feature_type_style.cpp @@ -192,20 +193,6 @@ if env['RENDERING_STATS']: else: 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']: source += Split( """ diff --git a/src/datasource_cache.cpp b/src/datasource_cache.cpp index 48ed583db..117ce3697 100644 --- a/src/datasource_cache.cpp +++ b/src/datasource_cache.cpp @@ -27,7 +27,6 @@ #include // boost -#include #include #include #include @@ -152,64 +151,18 @@ void datasource_cache::register_datasources(const std::string& str) 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 (!is_directory( *itr ) && is_input_plugin(itr->path().filename().string())) #else // v2 if (!is_directory( *itr ) && is_input_plugin(itr->path().leaf())) #endif -#endif { 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) lt_dlhandle module = lt_dlopen(itr->path().string().c_str()); #else // v2 lt_dlhandle module = lt_dlopen(itr->string().c_str()); -#endif - #endif if (module) {