From 1d881af35aa24a64b93a9c2f4946177ee365116b Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 11 Nov 2011 15:37:10 -0800 Subject: [PATCH] reduce the size of plugin libraries by hiding unneeded symbols --- SConstruct | 5 +++++ plugins/input/csv/build.py | 3 ++- plugins/input/gdal/build.py | 3 ++- plugins/input/geos/build.py | 3 ++- plugins/input/kismet/build.py | 3 ++- plugins/input/occi/build.py | 3 ++- plugins/input/ogr/build.py | 3 ++- plugins/input/osm/build.py | 3 ++- plugins/input/postgis/build.py | 3 ++- plugins/input/raster/build.py | 3 ++- plugins/input/rasterlite/build.py | 3 ++- plugins/input/shape/build.py | 3 ++- plugins/input/sqlite/build.py | 3 ++- 13 files changed, 29 insertions(+), 12 deletions(-) diff --git a/SConstruct b/SConstruct index 845da73bf..2c7804643 100644 --- a/SConstruct +++ b/SConstruct @@ -1591,7 +1591,12 @@ if not HELP_REQUESTED: # export env so it is available in build.py files Export('env') + + plugin_base = env.Clone() + plugin_base.Append(CXXFLAGS='-fvisibility=hidden') + plugin_base.Append(CXXFLAGS='-fvisibility-inlines-hidden') + Export('plugin_base') # clear the '_CPPDEFFLAGS' variable # for unknown reasons this variable puts -DNone diff --git a/plugins/input/csv/build.py b/plugins/input/csv/build.py index 193300ea3..2d5f02e89 100644 --- a/plugins/input/csv/build.py +++ b/plugins/input/csv/build.py @@ -1,12 +1,13 @@ #!/usr/bin/env python import os +Import ('plugin_base') Import ('env') PLUGIN_NAME = 'csv' install_dest = env['MAPNIK_INPUT_PLUGINS_DEST'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() plugin_sources = Split( """ diff --git a/plugins/input/gdal/build.py b/plugins/input/gdal/build.py index 491c26d55..cdf8fe69e 100644 --- a/plugins/input/gdal/build.py +++ b/plugins/input/gdal/build.py @@ -19,11 +19,12 @@ # # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() gdal_src = Split( """ diff --git a/plugins/input/geos/build.py b/plugins/input/geos/build.py index 490b5b69a..d923a7c98 100644 --- a/plugins/input/geos/build.py +++ b/plugins/input/geos/build.py @@ -20,11 +20,12 @@ # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() geos_src = Split( """ diff --git a/plugins/input/kismet/build.py b/plugins/input/kismet/build.py index 111a4beeb..4411b93a3 100644 --- a/plugins/input/kismet/build.py +++ b/plugins/input/kismet/build.py @@ -19,11 +19,12 @@ # # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() kismet_src = Split( """ diff --git a/plugins/input/occi/build.py b/plugins/input/occi/build.py index b2c5f6c15..8a9da396c 100644 --- a/plugins/input/occi/build.py +++ b/plugins/input/occi/build.py @@ -19,11 +19,12 @@ # # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() occi_src = Split( """ diff --git a/plugins/input/ogr/build.py b/plugins/input/ogr/build.py index 4b3225737..0c5993e87 100644 --- a/plugins/input/ogr/build.py +++ b/plugins/input/ogr/build.py @@ -20,11 +20,12 @@ # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() ogr_src = Split( """ diff --git a/plugins/input/osm/build.py b/plugins/input/osm/build.py index 5fafc4d4e..cf712409e 100644 --- a/plugins/input/osm/build.py +++ b/plugins/input/osm/build.py @@ -19,11 +19,12 @@ # # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() osm_src = Split( """ diff --git a/plugins/input/postgis/build.py b/plugins/input/postgis/build.py index 5694fe1f0..cd948dcce 100644 --- a/plugins/input/postgis/build.py +++ b/plugins/input/postgis/build.py @@ -19,11 +19,12 @@ # # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() postgis_src = Split( """ diff --git a/plugins/input/raster/build.py b/plugins/input/raster/build.py index 270509f40..232890bfb 100644 --- a/plugins/input/raster/build.py +++ b/plugins/input/raster/build.py @@ -19,11 +19,12 @@ # # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() raster_src = Split( """ diff --git a/plugins/input/rasterlite/build.py b/plugins/input/rasterlite/build.py index 1046fa985..bbaba934f 100644 --- a/plugins/input/rasterlite/build.py +++ b/plugins/input/rasterlite/build.py @@ -19,11 +19,12 @@ # # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() rasterlite_src = Split( """ diff --git a/plugins/input/shape/build.py b/plugins/input/shape/build.py index 3970cef4a..78f46a9f3 100644 --- a/plugins/input/shape/build.py +++ b/plugins/input/shape/build.py @@ -20,11 +20,12 @@ # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() shape_src = Split( """ diff --git a/plugins/input/sqlite/build.py b/plugins/input/sqlite/build.py index 41a701c80..7753d16c5 100644 --- a/plugins/input/sqlite/build.py +++ b/plugins/input/sqlite/build.py @@ -19,11 +19,12 @@ # # $Id$ +Import ('plugin_base') Import ('env') prefix = env['PREFIX'] -plugin_env = env.Clone() +plugin_env = plugin_base.Clone() sqlite_src = Split( """