diff --git a/SConstruct b/SConstruct index 0fc28fba3..ec4c3e373 100644 --- a/SConstruct +++ b/SConstruct @@ -162,6 +162,7 @@ opts.AddVariables( PathVariable('SQLITE_LIBS', 'Search path for SQLITE library files', '/usr/' + LIBDIR_SCHEMA, PathVariable.PathAccept), # Other variables + BoolVariable('SHAPE_MEMORY_MAPPED_FILE', 'Utilize memory-mapped files in Shapefile Plugin (higher memory usage, better performance)', 'True'), ('SYSTEM_FONTS','Provide location for python bindings to register fonts (if given aborts installation of bundled DejaVu fonts)',''), ('LIB_DIR_NAME','Name to use for the "lib" folder where fonts and plugins are installed','/mapnik/'), PathVariable('PYTHON','Full path to Python executable used to build bindings', sys.executable), diff --git a/plugins/input/shape/SConscript b/plugins/input/shape/SConscript index 784de7054..ad4d6c17f 100644 --- a/plugins/input/shape/SConscript +++ b/plugins/input/shape/SConscript @@ -45,7 +45,13 @@ if env['PLATFORM'] == 'Darwin': libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append('boost_filesystem%s' % env['BOOST_APPEND']) -shape_inputdriver = env.SharedLibrary('shape', SHLIBSUFFIX='.input', source=shape_src, SHLIBPREFIX='', LIBS = libraries) +if env['SHAPE_MEMORY_MAPPED_FILE']: + cxx_flags = '-DSHAPE_MEMORY_MAPPED_FILE' +else: + cxx_flags = '' + + +shape_inputdriver = env.SharedLibrary('shape', SHLIBSUFFIX='.input', source=shape_src, SHLIBPREFIX='', LIBS = libraries, CXXFLAGS=cxx_flags) env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', shape_inputdriver) env.Alias('install', install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input')