Compare commits
20 commits
master
...
static-lib
Author | SHA1 | Date | |
---|---|---|---|
|
3ede8c1c26 | ||
|
de7bb84d1e | ||
|
1e21c5c3c6 | ||
|
72cd2cd583 | ||
|
050d258f7c | ||
|
69a58346ec | ||
|
47ba9c63d2 | ||
|
559c087c9a | ||
|
5381d12f0d | ||
|
629c6ac801 | ||
|
6ec1abac3a | ||
|
642c727a98 | ||
|
1242df28ee | ||
|
acf3f7c3b3 | ||
|
49edaec2cb | ||
|
085ed86f9e | ||
|
51057d2106 | ||
|
47285d1dcf | ||
|
a5b1f9f30c | ||
|
df1cdb1329 |
17 changed files with 127 additions and 37 deletions
85
HOWTO.md
Normal file
85
HOWTO.md
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
### Initial setup
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export MASON_DIR="<path-to-mason-dir>"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building gdal (non-sanitized build)
|
||||||
|
```bash
|
||||||
|
echo "Configuring..."
|
||||||
|
CC="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang" \
|
||||||
|
CXX="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang++ -std=c++14" \
|
||||||
|
CXXFLAGS="-nostdinc++ -I$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/include/c++/v1 -I/opt/mapnik_static_deps/include" LDFLAGS="-stdlib=libc++ -nostdlib++ $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++.a $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++abi.a $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libunwind.a -rtlib=compiler-rt -L/opt/mapnik_static_deps/lib" ./configure --without-libtool --with-geos=no --with-curl=no --with-threads=yes --with-hide-internal-symbols=yes --with-xml2=no --with-pcraster=no --with-cfitsio=no --with-odbc=no --with-libkml=no --with-pcidsk=no --with-jasper=no --with-gif=no --with-grib=no --with-freexl=no --with-avx=no --with-sse=no --with-perl=no --with-python=no --with-java=no --with-podofo=no --with-pam --with-webp=no --with-pcre=no --with-liblzma=no --with-netcdf=no --with-poppler=no --with-sfcgal=no --with-fgdb=no --prefix=/opt/mapnik_static_deps --enable-static=yes --enable-shared=no
|
||||||
|
echo "Buiding..."
|
||||||
|
make -j4
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
|
## cd /usr/include
|
||||||
|
## sudo ln -s locale.h xlocale.h
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building ICU 60.1
|
||||||
|
|
||||||
|
echo "Configuring ICU with c++14/libc++ ..."
|
||||||
|
|
||||||
|
```bash
|
||||||
|
CC="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang" \
|
||||||
|
CXX="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang++" \
|
||||||
|
LD="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang++" \
|
||||||
|
CXXFLAGS="-fPIC -nostdinc++ -I$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/include/c++/v1 -I/opt/mapnik_static_deps/include" \
|
||||||
|
LDFLAGS="-fPIC -stdlib=libc++ -nostdlib++ -rtlib=compiler-rt -ldl -pthread -L/opt/mapnik_static_deps/lib" \
|
||||||
|
LIBS="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++.a $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++abi.a $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libunwind.a" \
|
||||||
|
FORCE_LIB=1 \
|
||||||
|
./runConfigureICU "Linux" \
|
||||||
|
--with-data-packaging=archive \
|
||||||
|
--prefix=/opt/mapnik_static_deps \
|
||||||
|
--enable-strict \
|
||||||
|
#--enable-static \
|
||||||
|
--enable-draft \
|
||||||
|
--disable-rpath \
|
||||||
|
--disable-shared \
|
||||||
|
--disable-tests \
|
||||||
|
--disable-extras \
|
||||||
|
--disable-tools \
|
||||||
|
--disable-tracing \
|
||||||
|
--disable-layout \
|
||||||
|
--disable-icuio \
|
||||||
|
--disable-samples \
|
||||||
|
#--disable-dyload
|
||||||
|
|
||||||
|
echo "Building ..."
|
||||||
|
make -j4 VERBOSE=1
|
||||||
|
echo "Done!"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building boost 1_66
|
||||||
|
```bash
|
||||||
|
echo "Building and installing Boost libraries with c++14/libc++ ..."
|
||||||
|
CC="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang++" \
|
||||||
|
CXX="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang++" \
|
||||||
|
LD="$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang++" \
|
||||||
|
./b2 -sICU_PATH="/opt/mapnik_static_deps" include="/opt/mapnik_static_deps/include" toolset=clang cxxflags="-std=c++14 -nostdinc++ -I$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/include/c++/v1" linkflags="-stdlib=libc++ -nostdlib++ $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++.a $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++abi.a $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libunwind.a -rtlib=compiler-rt -L/opt/mapnik_static_deps/lib -pthread -ldl" --prefix=/opt/boost_1_66_sanitized --with-iostreams --with-filesystem --with-regex --with-python --with-thread --with-program_options --with-system install
|
||||||
|
echo "Done!"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building Mapnik
|
||||||
|
Sample config.py
|
||||||
|
|
||||||
|
|
||||||
|
```python
|
||||||
|
CXX = '$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang++'
|
||||||
|
CC = '$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/bin/clang'
|
||||||
|
CUSTOM_CXXFLAGS = ' -fsanitize=memory -nostdinc++ -I$MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/include/c++/v1'
|
||||||
|
CUSTOM_LDFLAGS = '-fsanitize=memory -stdlib=libc++ -nostdlib++ $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/msan/lib/libc++.a $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/msan/lib/libc++abi.a $MASON_DIR/mason_packages/linux-x86_64/llvm/7.0.0/lib/libunwind.a -rtlib=compiler-rt -ldl -pthread'
|
||||||
|
INPUT_PLUGINS = 'gdal,geojson,ogr,raster,shape,sqlite'
|
||||||
|
PREFIX = '/opt/mapnik-sanitized'
|
||||||
|
BOOST_INCLUDES = '/opt/boost_1_66_sanitized/include'
|
||||||
|
BOOST_LIBS = '/opt/boost_1_66_sanitized/lib'
|
||||||
|
ICU_INCLUDES = '/opt/mapnik_static_deps/include'
|
||||||
|
ICU_LIBS = '/opt/mapnik_static_deps/lib'
|
||||||
|
SVG_RENDERER = True
|
||||||
|
CAIRO_INCLUDES = '/opt/mapnik_static_deps/include'
|
||||||
|
CAIRO_LIBS = '/opt/mapnik_static_deps/lib'
|
||||||
|
```
|
||||||
|
|
|
@ -1297,7 +1297,8 @@ if not preconfigured:
|
||||||
env['QUERIED_PROJ_LIB'] = None
|
env['QUERIED_PROJ_LIB'] = None
|
||||||
env['QUERIED_ICU_DATA'] = None
|
env['QUERIED_ICU_DATA'] = None
|
||||||
env['QUERIED_GDAL_DATA'] = None
|
env['QUERIED_GDAL_DATA'] = None
|
||||||
|
#'LINKCOM': '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
|
||||||
|
env['LINKCOM'] = '$LINK -o $TARGET $SOURCES $LINKFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'
|
||||||
# previously a leading / was expected for LIB_DIR_NAME
|
# previously a leading / was expected for LIB_DIR_NAME
|
||||||
# now strip it to ensure expected behavior
|
# now strip it to ensure expected behavior
|
||||||
if env['LIB_DIR_NAME'].startswith(os.path.sep):
|
if env['LIB_DIR_NAME'].startswith(os.path.sep):
|
||||||
|
@ -1360,7 +1361,6 @@ if not preconfigured:
|
||||||
env.Append(CFLAGS = env['CUSTOM_CFLAGS'])
|
env.Append(CFLAGS = env['CUSTOM_CFLAGS'])
|
||||||
env.Append(LINKFLAGS = DEFAULT_CXX14_LINKFLAGS)
|
env.Append(LINKFLAGS = DEFAULT_CXX14_LINKFLAGS)
|
||||||
env.Append(LINKFLAGS = env['CUSTOM_LDFLAGS'])
|
env.Append(LINKFLAGS = env['CUSTOM_LDFLAGS'])
|
||||||
|
|
||||||
### platform specific bits
|
### platform specific bits
|
||||||
|
|
||||||
thread_suffix = 'mt'
|
thread_suffix = 'mt'
|
||||||
|
|
|
@ -36,6 +36,8 @@ demo_env = env.Clone()
|
||||||
demo_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS'])
|
demo_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS'])
|
||||||
demo_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
|
demo_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
|
||||||
|
|
||||||
|
demo_env['LINKFLAGS'] = '-l%s' % env['MAPNIK_NAME'] + demo_env['LINKFLAGS']
|
||||||
|
|
||||||
if env['HAS_CAIRO']:
|
if env['HAS_CAIRO']:
|
||||||
demo_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS'])
|
demo_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS'])
|
||||||
demo_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
demo_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
||||||
|
@ -43,7 +45,6 @@ if env['HAS_CAIRO']:
|
||||||
libraries = [env['MAPNIK_NAME']]
|
libraries = [env['MAPNIK_NAME']]
|
||||||
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
|
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
|
||||||
rundemo = demo_env.Program('rundemo', source, LIBS=libraries)
|
rundemo = demo_env.Program('rundemo', source, LIBS=libraries)
|
||||||
|
|
||||||
Depends(rundemo, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
Depends(rundemo, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
||||||
|
|
||||||
# build locally if installing
|
# build locally if installing
|
||||||
|
|
|
@ -36,7 +36,7 @@ else:
|
||||||
PLUGIN_NAME = 'csv'
|
PLUGIN_NAME = 'csv'
|
||||||
|
|
||||||
plugin_env = plugin_base.Clone()
|
plugin_env = plugin_base.Clone()
|
||||||
|
plugin_env['SHLINKCOM'] = '$SHLINK -o $TARGET $SOURCES $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'
|
||||||
plugin_sources = Split(
|
plugin_sources = Split(
|
||||||
"""
|
"""
|
||||||
%(PLUGIN_NAME)s_utils.cpp
|
%(PLUGIN_NAME)s_utils.cpp
|
||||||
|
@ -56,7 +56,6 @@ else:
|
||||||
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
||||||
libraries.insert(0,env['MAPNIK_NAME'])
|
libraries.insert(0,env['MAPNIK_NAME'])
|
||||||
libraries.append(env['ICU_LIB_NAME'])
|
libraries.append(env['ICU_LIB_NAME'])
|
||||||
|
|
||||||
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
|
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
|
||||||
SHLIBPREFIX='',
|
SHLIBPREFIX='',
|
||||||
SHLIBSUFFIX='.input',
|
SHLIBSUFFIX='.input',
|
||||||
|
|
|
@ -61,7 +61,6 @@ using mapnik::filter_in_box;
|
||||||
using mapnik::filter_at_point;
|
using mapnik::filter_at_point;
|
||||||
|
|
||||||
static std::once_flag once_flag;
|
static std::once_flag once_flag;
|
||||||
|
|
||||||
extern "C" MAPNIK_EXP void on_plugin_load()
|
extern "C" MAPNIK_EXP void on_plugin_load()
|
||||||
{
|
{
|
||||||
// initialize ogr formats
|
// initialize ogr formats
|
||||||
|
|
|
@ -26,6 +26,7 @@ from copy import copy
|
||||||
PLUGIN_NAME = 'pgraster'
|
PLUGIN_NAME = 'pgraster'
|
||||||
|
|
||||||
plugin_env = plugin_base.Clone()
|
plugin_env = plugin_base.Clone()
|
||||||
|
plugin_env['SHLINKCOM'] = '$SHLINK -o $TARGET $SOURCES $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'
|
||||||
|
|
||||||
plugin_sources = Split(
|
plugin_sources = Split(
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -26,7 +26,7 @@ from copy import copy
|
||||||
PLUGIN_NAME = 'postgis'
|
PLUGIN_NAME = 'postgis'
|
||||||
|
|
||||||
plugin_env = plugin_base.Clone()
|
plugin_env = plugin_base.Clone()
|
||||||
|
plugin_env['SHLINKCOM'] = '$SHLINK -o $TARGET $SOURCES $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'
|
||||||
plugin_sources = Split(
|
plugin_sources = Split(
|
||||||
"""
|
"""
|
||||||
%(PLUGIN_NAME)s_datasource.cpp
|
%(PLUGIN_NAME)s_datasource.cpp
|
||||||
|
@ -54,7 +54,6 @@ if env['PLUGIN_LINKING'] == 'shared':
|
||||||
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
||||||
libraries.insert(0,env['MAPNIK_NAME'])
|
libraries.insert(0,env['MAPNIK_NAME'])
|
||||||
libraries.append(env['ICU_LIB_NAME'])
|
libraries.append(env['ICU_LIB_NAME'])
|
||||||
|
|
||||||
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
|
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
|
||||||
SHLIBPREFIX='',
|
SHLIBPREFIX='',
|
||||||
SHLIBSUFFIX='.input',
|
SHLIBSUFFIX='.input',
|
||||||
|
|
|
@ -50,7 +50,6 @@ if env['PLUGIN_LINKING'] == 'shared':
|
||||||
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
||||||
libraries.insert(0,env['MAPNIK_NAME'])
|
libraries.insert(0,env['MAPNIK_NAME'])
|
||||||
libraries.append(env['ICU_LIB_NAME'])
|
libraries.append(env['ICU_LIB_NAME'])
|
||||||
|
|
||||||
TARGET = plugin_env.SharedLibrary('../shape',
|
TARGET = plugin_env.SharedLibrary('../shape',
|
||||||
SHLIBSUFFIX='.input',
|
SHLIBSUFFIX='.input',
|
||||||
SHLIBPREFIX='',
|
SHLIBPREFIX='',
|
||||||
|
|
|
@ -25,7 +25,7 @@ Import ('env')
|
||||||
PLUGIN_NAME = 'sqlite'
|
PLUGIN_NAME = 'sqlite'
|
||||||
|
|
||||||
plugin_env = plugin_base.Clone()
|
plugin_env = plugin_base.Clone()
|
||||||
|
plugin_env['SHLINKCOM'] = '$SHLINK -o $TARGET $SOURCES $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'
|
||||||
plugin_sources = Split(
|
plugin_sources = Split(
|
||||||
"""
|
"""
|
||||||
%(PLUGIN_NAME)s_datasource.cpp
|
%(PLUGIN_NAME)s_datasource.cpp
|
||||||
|
@ -37,6 +37,7 @@ plugin_sources = Split(
|
||||||
libraries = [ 'sqlite3' ]
|
libraries = [ 'sqlite3' ]
|
||||||
|
|
||||||
linkflags = []
|
linkflags = []
|
||||||
|
|
||||||
if env['SQLITE_LINKFLAGS']:
|
if env['SQLITE_LINKFLAGS']:
|
||||||
linkflags.append(env['SQLITE_LINKFLAGS'])
|
linkflags.append(env['SQLITE_LINKFLAGS'])
|
||||||
plugin_env.Append(LINKFLAGS=linkflags)
|
plugin_env.Append(LINKFLAGS=linkflags)
|
||||||
|
@ -45,7 +46,6 @@ if env['PLUGIN_LINKING'] == 'shared':
|
||||||
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
||||||
libraries.insert(0,env['MAPNIK_NAME'])
|
libraries.insert(0,env['MAPNIK_NAME'])
|
||||||
libraries.append(env['ICU_LIB_NAME'])
|
libraries.append(env['ICU_LIB_NAME'])
|
||||||
|
|
||||||
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
|
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
|
||||||
SHLIBPREFIX='',
|
SHLIBPREFIX='',
|
||||||
SHLIBSUFFIX='.input',
|
SHLIBSUFFIX='.input',
|
||||||
|
|
|
@ -85,15 +85,19 @@ auto point_to_polygon_dist(const point<T>& point, const polygon<T>& polygon)
|
||||||
|
|
||||||
for (const auto& ring : polygon)
|
for (const auto& ring : polygon)
|
||||||
{
|
{
|
||||||
for (std::size_t i = 0, len = ring.size(), j = len - 1; i < len; j = i++)
|
std::size_t length = ring.size();
|
||||||
|
if (length > 1)
|
||||||
{
|
{
|
||||||
const auto& a = ring[i];
|
for (std::size_t i = 0, j = length - 1; i < length; j = i++)
|
||||||
const auto& b = ring[j];
|
{
|
||||||
|
const auto& a = ring[i];
|
||||||
|
const auto& b = ring[j];
|
||||||
|
|
||||||
if ((a.y > point.y) != (b.y > point.y) &&
|
if ((a.y > point.y) != (b.y > point.y) &&
|
||||||
(point.x < (b.x - a.x) * (point.y - a.y) / (b.y - a.y) + a.x)) inside = !inside;
|
(point.x < (b.x - a.x) * (point.y - a.y) / (b.y - a.y) + a.x)) inside = !inside;
|
||||||
|
|
||||||
min_dist_sq = std::min(min_dist_sq, segment_dist_sq(point, a, b));
|
min_dist_sq = std::min(min_dist_sq, segment_dist_sq(point, a, b));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,4 +239,3 @@ template
|
||||||
bool interior(polygon<double> const& polygon, double scale_factor, point<double> & pt);
|
bool interior(polygon<double> const& polygon, double scale_factor, point<double> & pt);
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extr
|
||||||
BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type);
|
BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type);
|
||||||
BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_context_type_f);
|
BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_context_type_f);
|
||||||
BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f);
|
BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
grammar::unicode_string_grammar_type const& unicode_string_grammar()
|
grammar::unicode_string_grammar_type const& unicode_string_grammar()
|
||||||
|
|
|
@ -44,7 +44,8 @@
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
|
||||||
struct _mapnik_lib_t {
|
struct _mapnik_lib_t
|
||||||
|
{
|
||||||
handle dl;
|
handle dl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -59,27 +60,27 @@ PluginInfo::PluginInfo(std::string const& filename,
|
||||||
if (module_ && module_->dl)
|
if (module_ && module_->dl)
|
||||||
{
|
{
|
||||||
callable_returning_string name_call = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
|
callable_returning_string name_call = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
|
||||||
if (name_call) name_ = name_call();
|
if (name_call) name_ = name_call();
|
||||||
callable_returning_void init_once = reinterpret_cast<callable_returning_void>(dlsym(module_->dl, "on_plugin_load"));
|
callable_returning_void init_once = reinterpret_cast<callable_returning_void>(dlsym(module_->dl, "on_plugin_load"));
|
||||||
if (init_once) {
|
if (init_once) init_once();
|
||||||
init_once();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef MAPNIK_HAS_DLCFN
|
#ifdef MAPNIK_HAS_DLCFN
|
||||||
if (module_) module_->dl = dlopen(filename.c_str(),RTLD_LAZY);
|
if (module_) module_->dl = dlopen(filename.c_str(),RTLD_LAZY);
|
||||||
if (module_ && module_->dl)
|
if (module_ && module_->dl)
|
||||||
{
|
{
|
||||||
callable_returning_string name_call = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
|
callable_returning_string name_call = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
|
||||||
if (name_call) name_ = name_call();
|
if (name_call) name_ = name_call();
|
||||||
callable_returning_void init_once = reinterpret_cast<callable_returning_void>(dlsym(module_->dl, "on_plugin_load"));
|
callable_returning_void init_once = reinterpret_cast<callable_returning_void>(dlsym(module_->dl, "on_plugin_load"));
|
||||||
if (init_once) {
|
if (init_once)init_once();
|
||||||
init_once();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#else
|
else
|
||||||
|
{
|
||||||
|
throw std::runtime_error(dlerror());
|
||||||
|
}
|
||||||
|
#else
|
||||||
throw std::runtime_error("no support for loading dynamic objects (Mapnik not compiled with -DMAPNIK_HAS_DLCFN)");
|
throw std::runtime_error("no support for loading dynamic objects (Mapnik not compiled with -DMAPNIK_HAS_DLCFN)");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@ from copy import copy
|
||||||
Import ('env')
|
Import ('env')
|
||||||
|
|
||||||
test_env = env.Clone()
|
test_env = env.Clone()
|
||||||
|
test_env['LINKCOM'] = '$LINK -o $TARGET $SOURCES $LINKFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'
|
||||||
|
test_env['LINKFLAGS'] = '-l%s' % env['MAPNIK_NAME'] + test_env['LINKFLAGS']
|
||||||
|
|
||||||
if not env['CPP_TESTS']:
|
if not env['CPP_TESTS']:
|
||||||
for cpp_test_bin in glob.glob('./*/*-bin'):
|
for cpp_test_bin in glob.glob('./*/*-bin'):
|
||||||
|
@ -12,7 +14,7 @@ if not env['CPP_TESTS']:
|
||||||
if os.path.exists('./unit/run'): os.unlink('./unit/run')
|
if os.path.exists('./unit/run'): os.unlink('./unit/run')
|
||||||
if os.path.exists('./visual/run'): os.unlink('./visual/run')
|
if os.path.exists('./visual/run'): os.unlink('./visual/run')
|
||||||
else:
|
else:
|
||||||
test_env['LIBS'] = [env['MAPNIK_NAME']]
|
test_env['LIBS'] = []
|
||||||
test_env.AppendUnique(LIBS='mapnik-wkt')
|
test_env.AppendUnique(LIBS='mapnik-wkt')
|
||||||
test_env.AppendUnique(LIBS='mapnik-json')
|
test_env.AppendUnique(LIBS='mapnik-json')
|
||||||
test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS']))
|
test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS']))
|
||||||
|
@ -29,8 +31,7 @@ else:
|
||||||
test_env['LINKFLAGS'].append('-pthread')
|
test_env['LINKFLAGS'].append('-pthread')
|
||||||
test_env.AppendUnique(LIBS='boost_program_options%s' % env['BOOST_APPEND'])
|
test_env.AppendUnique(LIBS='boost_program_options%s' % env['BOOST_APPEND'])
|
||||||
test_env_local = test_env.Clone()
|
test_env_local = test_env.Clone()
|
||||||
|
test_env_local['LINKCOM'] = '$LINK -o $TARGET $SOURCES $LINKFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'
|
||||||
|
|
||||||
# unit tests
|
# unit tests
|
||||||
sources = glob.glob('./unit/*/*.cpp')
|
sources = glob.glob('./unit/*/*.cpp')
|
||||||
sources.extend(glob.glob('./unit/*.cpp'))
|
sources.extend(glob.glob('./unit/*.cpp'))
|
||||||
|
|
|
@ -27,13 +27,12 @@ Import ('env')
|
||||||
Import ('plugin_base')
|
Import ('plugin_base')
|
||||||
|
|
||||||
program_env = plugin_base.Clone()
|
program_env = plugin_base.Clone()
|
||||||
|
program_env['LINKFLAGS'] = '-l%s plugins/input/csv/csv_utils.os' % plugin_base['MAPNIK_NAME'] + program_env['LINKFLAGS']
|
||||||
source = Split(
|
source = Split(
|
||||||
"""
|
"""
|
||||||
mapnik-index.cpp
|
mapnik-index.cpp
|
||||||
process_csv_file.cpp
|
process_csv_file.cpp
|
||||||
process_geojson_file_x3.cpp
|
process_geojson_file_x3.cpp
|
||||||
../../plugins/input/csv/csv_utils.os
|
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ source = Split(
|
||||||
)
|
)
|
||||||
|
|
||||||
program_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS'])
|
program_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS'])
|
||||||
|
program_env['LINKFLAGS'] = '-l%s' % program_env['MAPNIK_NAME'] + program_env['LINKFLAGS']
|
||||||
program_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
|
program_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
|
||||||
|
|
||||||
if env['HAS_CAIRO']:
|
if env['HAS_CAIRO']:
|
||||||
|
@ -19,7 +20,7 @@ if env['HAS_CAIRO']:
|
||||||
program_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
program_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
||||||
|
|
||||||
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
||||||
libraries = [env['MAPNIK_NAME'],boost_program_options]
|
libraries = [env['MAPNIK_NAME'], boost_program_options]
|
||||||
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
|
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
|
||||||
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
|
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
|
||||||
libraries.append('dl')
|
libraries.append('dl')
|
||||||
|
|
|
@ -28,6 +28,7 @@ Import ('env')
|
||||||
Import ('plugin_base')
|
Import ('plugin_base')
|
||||||
|
|
||||||
program_env = plugin_base.Clone()
|
program_env = plugin_base.Clone()
|
||||||
|
program_env['LINKFLAGS'] = '-lmapnik -lmapnik-json' + program_env['LINKFLAGS']
|
||||||
|
|
||||||
source = Split(
|
source = Split(
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -41,7 +41,7 @@ if env['HAS_CAIRO']:
|
||||||
program_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
program_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
||||||
|
|
||||||
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
||||||
libraries = [env['MAPNIK_NAME'],boost_program_options]
|
libraries = [env['MAPNIK_NAME'], boost_program_options]
|
||||||
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
|
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
|
||||||
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
|
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
|
||||||
libraries.append('dl')
|
libraries.append('dl')
|
||||||
|
|
Loading…
Reference in a new issue