[saga] 01/11: Imported Upstream version 2.3.0+dfsg

Bas Couwenberg sebastic at debian.org
Fri Jul 1 21:55:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository saga.

commit e98f430fd4f3b6fd45e0a2a741eb85e766062bf5
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Jul 1 20:20:51 2016 +0200

    Imported Upstream version 2.3.0+dfsg
---
 Makefile.in                                        |   58 +-
 README                                             |    2 +-
 aclocal.m4                                         |   68 +-
 compile                                            |    2 +-
 config.guess                                       |  233 +-
 config.h.in                                        |    9 +-
 config.sub                                         |   60 +-
 configure                                          | 3439 +++++++-----
 configure.ac                                       |   23 +-
 depcomp                                            |    2 +-
 install-sh                                         |  373 +-
 ltmain.sh                                          | 5533 +++++++++++++-------
 m4/ax_lib_gdal.m4                                  |  153 +
 m4/libtool.m4                                      | 2521 +++++----
 m4/ltoptions.m4                                    |  127 +-
 m4/ltsugar.m4                                      |    7 +-
 m4/ltversion.m4                                    |   12 +-
 m4/lt~obsolete.m4                                  |    7 +-
 missing                                            |    2 +-
 py-compile                                         |    2 +-
 src/Makefile.in                                    |   34 +-
 src/modules/Makefile.in                            |   34 +-
 src/modules/climate/Makefile.in                    |   34 +-
 .../climate/climate_tools/MLB_Interface.cpp        |    5 +-
 src/modules/climate/climate_tools/Makefile.am      |    2 +
 src/modules/climate/climate_tools/Makefile.in      |   43 +-
 .../climate/climate_tools/bioclimatic_vars.cpp     |  441 ++
 .../climate_tools/bioclimatic_vars.h}              |   48 +-
 src/modules/contrib/Makefile.in                    |   34 +-
 src/modules/contrib/contrib_peregro/Makefile.in    |   35 +-
 src/modules/db/Makefile.in                         |   34 +-
 src/modules/db/db_odbc/Makefile.in                 |   35 +-
 src/modules/db/db_pgsql/Makefile.in                |   35 +-
 src/modules/db/db_pgsql/db_pgsql.cpp               |  108 +-
 src/modules/docs/Makefile.in                       |   34 +-
 src/modules/docs/docs_html/Makefile.in             |   35 +-
 src/modules/docs/docs_pdf/Makefile.in              |   35 +-
 src/modules/garden/Makefile.in                     |   34 +-
 src/modules/garden/garden_3d_viewer/Makefile.in    |   35 +-
 src/modules/garden/garden_fractals/Makefile.in     |   35 +-
 src/modules/garden/garden_games/Makefile.in        |   35 +-
 .../garden/garden_learn_to_program/Makefile.in     |   35 +-
 src/modules/garden/garden_webservices/Makefile.in  |   35 +-
 src/modules/grid/Makefile.in                       |   34 +-
 src/modules/grid/grid_analysis/Cost_Isotropic.cpp  |    2 +-
 src/modules/grid/grid_analysis/Cost_Isotropic.h    |    2 +-
 src/modules/grid/grid_analysis/CoveredDistance.cpp |    2 +-
 src/modules/grid/grid_analysis/CoveredDistance.h   |    2 +-
 .../grid/grid_analysis/CrossClassification.cpp     |    2 +-
 .../grid/grid_analysis/CrossClassification.h       |    2 +-
 src/modules/grid/grid_analysis/Grid_AHP.cpp        |    2 +-
 src/modules/grid/grid_analysis/Grid_AHP.h          |    2 +-
 .../grid_analysis/Grid_Accumulation_Functions.cpp  |    2 +-
 .../grid_analysis/Grid_Accumulation_Functions.h    |    2 +-
 .../grid/grid_analysis/Grid_AggregationIndex.cpp   |    2 +-
 .../grid/grid_analysis/Grid_AggregationIndex.h     |    2 +-
 src/modules/grid/grid_analysis/Grid_CVA.cpp        |    2 +-
 src/modules/grid/grid_analysis/Grid_CVA.h          |    2 +-
 src/modules/grid/grid_analysis/Grid_IMCORR.cpp     |    2 +-
 src/modules/grid/grid_analysis/Grid_IMCORR.h       |    2 +-
 .../grid_analysis/Grid_LayerOfMaximumValue.cpp     |    2 +-
 .../grid/grid_analysis/Grid_LayerOfMaximumValue.h  |    2 +-
 src/modules/grid/grid_analysis/Grid_Pattern.cpp    |    2 +-
 src/modules/grid/grid_analysis/Grid_Pattern.h      |    2 +-
 .../grid/grid_analysis/LeastCostPathProfile.cpp    |    2 +-
 .../grid/grid_analysis/LeastCostPathProfile.h      |    2 +-
 .../grid_analysis/LeastCostPathProfile_Points.cpp  |    2 +-
 .../grid_analysis/LeastCostPathProfile_Points.h    |    2 +-
 src/modules/grid/grid_analysis/MLB_Interface.cpp   |    2 +-
 src/modules/grid/grid_analysis/MLB_Interface.h     |    2 +-
 src/modules/grid/grid_analysis/Makefile.am         |    2 +-
 src/modules/grid/grid_analysis/Makefile.in         |   37 +-
 src/modules/grid/grid_analysis/Soil_Texture.cpp    |    2 +-
 src/modules/grid/grid_analysis/Soil_Texture.h      |    2 +-
 .../grid/grid_analysis/diversity_analysis.cpp      |    4 +-
 .../grid/grid_analysis/fragmentation_base.cpp      |    2 +-
 .../grid/grid_analysis/fragmentation_base.h        |    2 +-
 .../grid/grid_analysis/fragmentation_classify.cpp  |    2 +-
 .../grid/grid_analysis/fragmentation_classify.h    |    2 +-
 .../grid_analysis/fragmentation_resampling.cpp     |    2 +-
 .../grid/grid_analysis/fragmentation_resampling.h  |    2 +-
 .../grid/grid_analysis/fragmentation_standard.cpp  |    2 +-
 .../grid/grid_analysis/fragmentation_standard.h    |    2 +-
 src/modules/grid/grid_analysis/owa.cpp             |    2 +-
 src/modules/grid/grid_analysis/owa.h               |    2 +-
 src/modules/grid/grid_calculus/Fuzzify.cpp         |    2 +-
 src/modules/grid/grid_calculus/Fuzzify.h           |    2 +-
 src/modules/grid/grid_calculus/FuzzyAND.cpp        |    2 +-
 src/modules/grid/grid_calculus/FuzzyAND.h          |    2 +-
 src/modules/grid/grid_calculus/FuzzyOR.cpp         |    2 +-
 src/modules/grid/grid_calculus/FuzzyOR.h           |    2 +-
 src/modules/grid/grid_calculus/Grid_Calculator.cpp |   17 +-
 src/modules/grid/grid_calculus/Grid_Calculator.h   |    2 +-
 .../grid/grid_calculus/Grid_Geometric_Figures.cpp  |    2 +-
 .../grid/grid_calculus/Grid_Geometric_Figures.h    |    2 +-
 src/modules/grid/grid_calculus/Grid_Normalise.cpp  |    2 +-
 src/modules/grid/grid_calculus/Grid_Normalise.h    |    2 +-
 src/modules/grid/grid_calculus/Grid_Plotter.cpp    |    2 +-
 src/modules/grid/grid_calculus/Grid_Plotter.h      |    2 +-
 .../grid/grid_calculus/Grid_Random_Field.cpp       |    2 +-
 src/modules/grid/grid_calculus/Grid_Random_Field.h |    2 +-
 .../grid/grid_calculus/Grid_Random_Terrain.cpp     |    2 +-
 .../grid/grid_calculus/Grid_Random_Terrain.h       |    2 +-
 src/modules/grid/grid_calculus/Grid_Volume.cpp     |    2 +-
 src/modules/grid/grid_calculus/Grid_Volume.h       |    2 +-
 src/modules/grid/grid_calculus/MLB_Interface.cpp   |    2 +-
 src/modules/grid/grid_calculus/MLB_Interface.h     |    2 +-
 src/modules/grid/grid_calculus/Makefile.am         |    2 +-
 src/modules/grid/grid_calculus/Makefile.in         |   37 +-
 src/modules/grid/grid_calculus/grid_difference.cpp |    2 +-
 src/modules/grid/grid_calculus/grid_difference.h   |    2 +-
 src/modules/grid/grid_calculus/kff_synth.cpp       |    2 +-
 src/modules/grid/grid_calculus/kff_synth.h         |    2 +-
 .../grid/grid_calculus_bsl/MLB_Interface.cpp       |    2 +-
 src/modules/grid/grid_calculus_bsl/MLB_Interface.h |    2 +-
 src/modules/grid/grid_calculus_bsl/Makefile.am     |    2 +-
 src/modules/grid/grid_calculus_bsl/Makefile.in     |   37 +-
 src/modules/grid/grid_calculus_bsl/ausdruck.cpp    |    2 +-
 src/modules/grid/grid_calculus_bsl/ausdruck.h      |    2 +-
 .../grid/grid_calculus_bsl/auswert_anweisung.cpp   |    2 +-
 .../grid/grid_calculus_bsl/auswert_anweisung.h     |    2 +-
 .../grid/grid_calculus_bsl/auswert_foreach.cpp     |    2 +-
 .../grid/grid_calculus_bsl/auswert_foreach.h       |    2 +-
 src/modules/grid/grid_calculus_bsl/auswert_if.cpp  |    2 +-
 src/modules/grid/grid_calculus_bsl/auswert_if.h    |    2 +-
 .../grid/grid_calculus_bsl/auswert_zuweisung.cpp   |    2 +-
 .../grid/grid_calculus_bsl/auswert_zuweisung.h     |    2 +-
 src/modules/grid/grid_calculus_bsl/basistypen.cpp  |    2 +-
 src/modules/grid/grid_calculus_bsl/basistypen.h    |    2 +-
 src/modules/grid/grid_calculus_bsl/bedingung.cpp   |    2 +-
 src/modules/grid/grid_calculus_bsl/bedingung.h     |    2 +-
 .../grid/grid_calculus_bsl/bsl_interpreter.cpp     |    2 +-
 .../grid/grid_calculus_bsl/bsl_interpreter.h       |    2 +-
 src/modules/grid/grid_calculus_bsl/diverses.cpp    |    2 +-
 src/modules/grid/grid_calculus_bsl/diverses.h      |    2 +-
 src/modules/grid/grid_calculus_bsl/foreach.cpp     |    2 +-
 src/modules/grid/grid_calculus_bsl/foreach.h       |    2 +-
 src/modules/grid/grid_calculus_bsl/funktion.cpp    |    2 +-
 src/modules/grid/grid_calculus_bsl/funktion.h      |    2 +-
 .../grid/grid_calculus_bsl/funktion_numerisch.h    |    2 +-
 .../grid/grid_calculus_bsl/funktion_statistisch.h  |    2 +-
 src/modules/grid/grid_calculus_bsl/gr_def.h        |    2 +-
 src/modules/grid/grid_calculus_bsl/gr_syst.h       |    2 +-
 src/modules/grid/grid_calculus_bsl/grid_bsl.cpp    |    2 +-
 src/modules/grid/grid_calculus_bsl/grid_bsl.h      |    2 +-
 .../grid/grid_calculus_bsl/interpolation.cpp       |    2 +-
 src/modules/grid/grid_calculus_bsl/interpolation.h |    2 +-
 src/modules/grid/grid_calculus_bsl/pars_all.cpp    |    2 +-
 src/modules/grid/grid_calculus_bsl/pars_all.h      |    2 +-
 src/modules/grid/grid_calculus_bsl/vector.cpp      |    2 +-
 src/modules/grid/grid_calculus_bsl/vector.h        |    2 +-
 src/modules/grid/grid_calculus_bsl/zuweisung.cpp   |    2 +-
 src/modules/grid/grid_calculus_bsl/zuweisung.h     |    2 +-
 src/modules/grid/grid_filter/Filter.cpp            |    2 +-
 src/modules/grid/grid_filter/Filter.h              |    2 +-
 src/modules/grid/grid_filter/FilterClumps.cpp      |    2 +-
 src/modules/grid/grid_filter/FilterClumps.h        |    2 +-
 src/modules/grid/grid_filter/Filter_3x3.cpp        |    2 +-
 src/modules/grid/grid_filter/Filter_3x3.h          |    2 +-
 src/modules/grid/grid_filter/Filter_Gauss.cpp      |    2 +-
 src/modules/grid/grid_filter/Filter_Gauss.h        |    2 +-
 src/modules/grid/grid_filter/Filter_LoG.cpp        |    2 +-
 src/modules/grid/grid_filter/Filter_LoG.h          |    2 +-
 src/modules/grid/grid_filter/Filter_Majority.cpp   |    2 +-
 src/modules/grid/grid_filter/Filter_Majority.h     |    2 +-
 src/modules/grid/grid_filter/Filter_Morphology.cpp |    2 +-
 src/modules/grid/grid_filter/Filter_Morphology.h   |    2 +-
 .../grid/grid_filter/Filter_Multi_Dir_Lee.cpp      |    2 +-
 .../grid/grid_filter/Filter_Multi_Dir_Lee.h        |    2 +-
 src/modules/grid/grid_filter/Filter_Rank.cpp       |    2 +-
 src/modules/grid/grid_filter/Filter_Rank.h         |    2 +-
 .../grid/grid_filter/Filter_Terrain_SlopeBased.cpp |    2 +-
 .../grid/grid_filter/Filter_Terrain_SlopeBased.h   |    2 +-
 src/modules/grid/grid_filter/MLB_Interface.cpp     |    2 +-
 src/modules/grid/grid_filter/MLB_Interface.h       |    2 +-
 src/modules/grid/grid_filter/Makefile.am           |    2 +-
 src/modules/grid/grid_filter/Makefile.in           |   37 +-
 .../grid/grid_filter/bin_erosion_reconst.cpp       |    2 +-
 src/modules/grid/grid_filter/bin_erosion_reconst.h |    2 +-
 src/modules/grid/grid_filter/connect_analysis.cpp  |    2 +-
 src/modules/grid/grid_filter/connect_analysis.h    |    2 +-
 .../grid_filter/geodesic_morph_rec/bin_geovinc.c   |    2 +-
 .../grid_filter/geodesic_morph_rec/bin_geovinc.h   |    2 +-
 .../grid_filter/geodesic_morph_rec/combcontour.c   |    2 +-
 .../grid_filter/geodesic_morph_rec/combcontour.h   |    2 +-
 .../grid/grid_filter/geodesic_morph_rec/errfunc.c  |    2 +-
 .../grid/grid_filter/geodesic_morph_rec/errfunc.h  |    2 +-
 .../grid/grid_filter/geodesic_morph_rec/geovinc.c  |    2 +-
 .../grid_filter/geodesic_morph_rec/listfuncs.inc   |    2 +-
 .../grid/grid_filter/geodesic_morph_rec/rho.h      |    2 +-
 .../grid/grid_filter/geodesic_morph_rec/spezfunc.c |    2 +-
 .../grid/grid_filter/geodesic_morph_rec/spezfunc.h |    2 +-
 .../grid/grid_filter/geodesic_morph_rec/storeorg.c |    2 +-
 .../grid/grid_filter/geodesic_morph_rec/storeorg.h |    2 +-
 src/modules/grid/grid_filter/geomrec.cpp           |    2 +-
 src/modules/grid/grid_filter/geomrec.h             |    2 +-
 src/modules/grid/grid_gridding/Interpolation.cpp   |    2 +-
 src/modules/grid/grid_gridding/Interpolation.h     |    2 +-
 .../Interpolation_InverseDistance.cpp              |    2 +-
 .../grid_gridding/Interpolation_InverseDistance.h  |    2 +-
 .../Interpolation_NaturalNeighbour.cpp             |    2 +-
 .../grid_gridding/Interpolation_NaturalNeighbour.h |    2 +-
 .../Interpolation_NearestNeighbour.cpp             |    2 +-
 .../grid_gridding/Interpolation_NearestNeighbour.h |    2 +-
 .../grid/grid_gridding/Interpolation_Shepard.cpp   |    2 +-
 .../grid/grid_gridding/Interpolation_Shepard.h     |    2 +-
 .../grid_gridding/Interpolation_Triangulation.cpp  |    2 +-
 .../grid_gridding/Interpolation_Triangulation.h    |    2 +-
 src/modules/grid/grid_gridding/MLB_Interface.cpp   |    2 +-
 src/modules/grid/grid_gridding/MLB_Interface.h     |    2 +-
 src/modules/grid/grid_gridding/Makefile.am         |    2 +-
 src/modules/grid/grid_gridding/Makefile.in         |   37 +-
 src/modules/grid/grid_gridding/Shapes2Grid.cpp     |    2 +-
 src/modules/grid/grid_gridding/Shapes2Grid.h       |    2 +-
 src/modules/grid/grid_gridding/Shepard.cpp         |    2 +-
 src/modules/grid/grid_gridding/Shepard.h           |    2 +-
 src/modules/grid/grid_gridding/kernel_density.cpp  |    2 +-
 src/modules/grid/grid_gridding/kernel_density.h    |    2 +-
 .../grid/grid_spline/Gridding_Spline_BA.cpp        |    2 +-
 src/modules/grid/grid_spline/Gridding_Spline_BA.h  |    2 +-
 .../grid/grid_spline/Gridding_Spline_Base.cpp      |    2 +-
 .../grid/grid_spline/Gridding_Spline_Base.h        |    2 +-
 .../grid/grid_spline/Gridding_Spline_CSA.cpp       |    2 +-
 src/modules/grid/grid_spline/Gridding_Spline_CSA.h |    2 +-
 .../grid/grid_spline/Gridding_Spline_MBA.cpp       |    2 +-
 src/modules/grid/grid_spline/Gridding_Spline_MBA.h |    2 +-
 .../grid/grid_spline/Gridding_Spline_MBA_Grid.cpp  |    2 +-
 .../grid/grid_spline/Gridding_Spline_MBA_Grid.h    |    2 +-
 .../grid/grid_spline/Gridding_Spline_TPS_Local.cpp |    2 +-
 .../grid/grid_spline/Gridding_Spline_TPS_Local.h   |    2 +-
 .../grid/grid_spline/Gridding_Spline_TPS_TIN.cpp   |    2 +-
 .../grid/grid_spline/Gridding_Spline_TPS_TIN.h     |    2 +-
 src/modules/grid/grid_spline/MLB_Interface.cpp     |    2 +-
 src/modules/grid/grid_spline/MLB_Interface.h       |    2 +-
 src/modules/grid/grid_spline/Makefile.am           |    2 +-
 src/modules/grid/grid_spline/Makefile.in           |   37 +-
 src/modules/grid/grid_spline/csa.c                 |    2 +-
 src/modules/grid/grid_spline/csa.h                 |    2 +-
 src/modules/grid/grid_tools/CreateGridSystem.cpp   |    2 +-
 src/modules/grid/grid_tools/CreateGridSystem.h     |    2 +-
 src/modules/grid/grid_tools/Grid_Aggregate.cpp     |    2 +-
 src/modules/grid/grid_tools/Grid_Aggregate.h       |    2 +-
 src/modules/grid/grid_tools/Grid_Buffer.cpp        |  231 +-
 src/modules/grid/grid_tools/Grid_Buffer.h          |   35 +-
 .../grid/grid_tools/Grid_Buffer_Proximity.cpp      |    2 +-
 .../grid/grid_tools/Grid_Buffer_Proximity.h        |    2 +-
 src/modules/grid/grid_tools/Grid_CombineGrids.cpp  |    2 +-
 src/modules/grid/grid_tools/Grid_CombineGrids.h    |    2 +-
 src/modules/grid/grid_tools/Grid_Completion.cpp    |    2 +-
 src/modules/grid/grid_tools/Grid_Completion.h      |    2 +-
 src/modules/grid/grid_tools/Grid_ConstantGrid.cpp  |    2 +-
 src/modules/grid/grid_tools/Grid_ConstantGrid.h    |    2 +-
 src/modules/grid/grid_tools/Grid_CropToData.cpp    |    2 +-
 src/modules/grid/grid_tools/Grid_CropToData.h      |    2 +-
 src/modules/grid/grid_tools/Grid_Cut.cpp           |    2 +-
 src/modules/grid/grid_tools/Grid_Cut.h             |    2 +-
 src/modules/grid/grid_tools/Grid_Fill.cpp          |    2 +-
 src/modules/grid/grid_tools/Grid_Fill.h            |    2 +-
 src/modules/grid/grid_tools/Grid_Gaps.cpp          |    2 +-
 src/modules/grid/grid_tools/Grid_Gaps.h            |    2 +-
 src/modules/grid/grid_tools/Grid_Gaps_OneCell.cpp  |    2 +-
 src/modules/grid/grid_tools/Grid_Gaps_OneCell.h    |    2 +-
 .../grid/grid_tools/Grid_Gaps_Spline_Fill.cpp      |    2 +-
 .../grid/grid_tools/Grid_Gaps_Spline_Fill.h        |    2 +-
 src/modules/grid/grid_tools/Grid_InvertNoData.cpp  |    2 +-
 src/modules/grid/grid_tools/Grid_InvertNoData.h    |    2 +-
 src/modules/grid/grid_tools/Grid_Mask.cpp          |    2 +-
 src/modules/grid/grid_tools/Grid_Mask.h            |    2 +-
 src/modules/grid/grid_tools/Grid_Merge.cpp         |    2 +-
 src/modules/grid/grid_tools/Grid_Merge.h           |    2 +-
 src/modules/grid/grid_tools/Grid_Orientation.cpp   |    2 +-
 src/modules/grid/grid_tools/Grid_Orientation.h     |    2 +-
 src/modules/grid/grid_tools/Grid_Proximity.cpp     |    2 +-
 src/modules/grid/grid_tools/Grid_Proximity.h       |    2 +-
 src/modules/grid/grid_tools/Grid_Resample.cpp      |    2 +-
 src/modules/grid/grid_tools/Grid_Resample.h        |    2 +-
 src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp |    2 +-
 src/modules/grid/grid_tools/Grid_Shrink_Expand.h   |    2 +-
 src/modules/grid/grid_tools/Grid_SortRaster.cpp    |    2 +-
 src/modules/grid/grid_tools/Grid_SortRaster.h      |    2 +-
 .../grid/grid_tools/Grid_ThresholdBuffer.cpp       |    2 +-
 src/modules/grid/grid_tools/Grid_ThresholdBuffer.h |    2 +-
 src/modules/grid/grid_tools/Grid_Tiling.cpp        |    2 +-
 src/modules/grid/grid_tools/Grid_Tiling.h          |    2 +-
 .../Grid_Value_NoData.cpp}                         |  156 +-
 .../{Grid_Resample.h => Grid_Value_NoData.h}       |   27 +-
 .../grid/grid_tools/Grid_Value_Reclassify.cpp      |    2 +-
 .../grid/grid_tools/Grid_Value_Reclassify.h        |    2 +-
 src/modules/grid/grid_tools/Grid_Value_Replace.cpp |    2 +-
 src/modules/grid/grid_tools/Grid_Value_Replace.h   |    2 +-
 .../grid_tools/Grid_Value_Replace_Interactive.cpp  |    7 +-
 .../grid_tools/Grid_Value_Replace_Interactive.h    |    2 +-
 src/modules/grid/grid_tools/Grid_Value_Request.cpp |    2 +-
 src/modules/grid/grid_tools/Grid_Value_Request.h   |    2 +-
 src/modules/grid/grid_tools/Grid_Value_Type.cpp    |    2 +-
 src/modules/grid/grid_tools/Grid_Value_Type.h      |    2 +-
 .../grid/grid_tools/GridsFromTableAndGrid.cpp      |    2 +-
 .../grid/grid_tools/GridsFromTableAndGrid.h        |    2 +-
 src/modules/grid/grid_tools/MLB_Interface.cpp      |    5 +-
 src/modules/grid/grid_tools/MLB_Interface.h        |    2 +-
 src/modules/grid/grid_tools/Makefile.am            |    4 +-
 src/modules/grid/grid_tools/Makefile.in            |   48 +-
 .../grid/grid_visualisation/Grid_3D_Image.cpp      |    2 +-
 .../grid/grid_visualisation/Grid_3D_Image.h        |    2 +-
 .../grid_visualisation/Grid_Aspect_Slope_Map.cpp   |    2 +-
 .../grid_visualisation/Grid_Aspect_Slope_Map.h     |    2 +-
 .../grid/grid_visualisation/Grid_Color_Blend.cpp   |    2 +-
 .../grid/grid_visualisation/Grid_Color_Blend.h     |    2 +-
 .../grid/grid_visualisation/Grid_Color_Rotate.cpp  |    2 +-
 .../grid/grid_visualisation/Grid_Color_Rotate.h    |    2 +-
 .../grid_visualisation/Grid_Color_Triangle.cpp     |    2 +-
 .../grid/grid_visualisation/Grid_Color_Triangle.h  |    2 +-
 .../grid/grid_visualisation/Grid_Colors_Fit.cpp    |    2 +-
 .../grid/grid_visualisation/Grid_Colors_Fit.h      |    2 +-
 .../grid_visualisation/Grid_Histogram_Surface.cpp  |    2 +-
 .../grid_visualisation/Grid_Histogram_Surface.h    |    2 +-
 .../grid/grid_visualisation/Grid_RGB_Composite.cpp |    2 +-
 .../grid/grid_visualisation/Grid_RGB_Composite.h   |    2 +-
 .../grid/grid_visualisation/Grid_Terrain_Map.cpp   |    4 +-
 .../grid/grid_visualisation/Grid_Terrain_Map.h     |    2 +-
 .../grid/grid_visualisation/MLB_Interface.cpp      |    2 +-
 .../grid/grid_visualisation/MLB_Interface.h        |    2 +-
 src/modules/grid/grid_visualisation/Makefile.am    |    2 +-
 src/modules/grid/grid_visualisation/Makefile.in    |   37 +-
 src/modules/imagery/Makefile.in                    |   34 +-
 .../imagery/imagery_classification/Makefile.in     |   35 +-
 .../classify_supervised_polygons.cpp               |    2 +-
 .../classify_supervised_polygons.h                 |    2 +-
 src/modules/imagery/imagery_maxent/Makefile.in     |   35 +-
 .../imagery/imagery_opencv/MLB_Interface.cpp       |   18 +-
 src/modules/imagery/imagery_opencv/Makefile.am     |    3 +
 src/modules/imagery/imagery_opencv/Makefile.in     |   50 +-
 src/modules/imagery/imagery_opencv/opencv_ml.cpp   |  507 ++
 .../imagery/imagery_opencv/opencv_ml.h}            |  561 +-
 .../imagery/imagery_opencv/opencv_ml_tools.cpp     |  738 +++
 src/modules/imagery/imagery_opencv/opencv_nnet.cpp |    9 +-
 src/modules/imagery/imagery_opencv/opencv_nnet.h   |   22 +
 .../imagery/imagery_opencv/opencv_stereo_match.cpp |  462 +-
 .../imagery/imagery_opencv/opencv_stereo_match.h   |   32 +-
 .../imagery_photogrammetry/Colorisation.cpp        |    2 +-
 .../imagery/imagery_photogrammetry/Colorisation.h  |    2 +-
 .../imagery_photogrammetry/MLB_Interface.cpp       |    2 +-
 .../imagery/imagery_photogrammetry/MLB_Interface.h |    2 +-
 .../imagery/imagery_photogrammetry/Makefile.in     |   35 +-
 .../imagery/imagery_photogrammetry/Resection.cpp   |    2 +-
 .../imagery/imagery_photogrammetry/Resection.h     |    2 +-
 .../imagery/imagery_photogrammetry/methods.cpp     |    2 +-
 .../imagery/imagery_photogrammetry/methods.h       |    2 +-
 .../imagery/imagery_segmentation/Makefile.in       |   35 +-
 src/modules/imagery/imagery_svm/Makefile.in        |   35 +-
 .../imagery/imagery_tools/Image_VI_Distance.cpp    |    2 +-
 .../imagery/imagery_tools/Image_VI_Distance.h      |    2 +-
 .../imagery/imagery_tools/Image_VI_Slope.cpp       |    2 +-
 src/modules/imagery/imagery_tools/Image_VI_Slope.h |    2 +-
 .../imagery/imagery_tools/MLB_Interface.cpp        |    2 +-
 src/modules/imagery/imagery_tools/MLB_Interface.h  |    2 +-
 src/modules/imagery/imagery_tools/Makefile.in      |   35 +-
 src/modules/imagery/imagery_tools/evi.cpp          |    2 +-
 src/modules/imagery/imagery_tools/evi.h            |    2 +-
 src/modules/imagery/imagery_tools/landsat_acca.cpp |    2 +-
 src/modules/imagery/imagery_tools/landsat_acca.h   |    2 +-
 src/modules/imagery/imagery_tools/landsat_toar.cpp |   22 +-
 src/modules/imagery/imagery_tools/landsat_toar.h   |    2 +-
 .../imagery/imagery_tools/pansharpening.cpp        |    2 +-
 src/modules/imagery/imagery_tools/pansharpening.h  |    2 +-
 src/modules/imagery/imagery_tools/tasseled_cap.cpp |    2 +-
 src/modules/imagery/imagery_tools/tasseled_cap.h   |    2 +-
 src/modules/imagery/imagery_vigra/Makefile.in      |   35 +-
 src/modules/io/Makefile.in                         |   34 +-
 src/modules/io/io_esri_e00/Makefile.in             |   35 +-
 src/modules/io/io_gdal/Makefile.am                 |    4 +-
 src/modules/io/io_gdal/Makefile.in                 |   39 +-
 src/modules/io/io_gdal/gdal_driver.cpp             |   14 +-
 src/modules/io/io_gdal/gdal_driver.h               |    2 +
 src/modules/io/io_gdal/gdal_export.cpp             |   69 +-
 src/modules/io/io_gdal/gdal_import.cpp             |  343 +-
 src/modules/io/io_gdal/gdal_import.h               |   27 +-
 src/modules/io/io_gdal/gdal_import_wms.cpp         |    6 +-
 src/modules/io/io_gdal/ogr_driver.cpp              |  182 +-
 src/modules/io/io_gdal/ogr_driver.h                |   39 +-
 src/modules/io/io_gdal/ogr_export.cpp              |   72 +-
 src/modules/io/io_gdal/ogr_export_kml.cpp          |   33 +-
 src/modules/io/io_gdal/ogr_import.cpp              |   57 +-
 src/modules/io/io_gps/Makefile.in                  |   35 +-
 src/modules/io/io_grid/MLB_Interface.cpp           |    2 -
 src/modules/io/io_grid/Makefile.am                 |    2 -
 src/modules/io/io_grid/Makefile.in                 |   45 +-
 src/modules/io/io_grid_image/MLB_Interface.cpp     |    2 +-
 src/modules/io/io_grid_image/MLB_Interface.h       |    2 +-
 src/modules/io/io_grid_image/Makefile.in           |   35 +-
 src/modules/io/io_grid_image/grid_export.cpp       |    2 +-
 src/modules/io/io_grid_image/grid_export.h         |    2 +-
 src/modules/io/io_grid_image/grid_import.cpp       |    2 +-
 src/modules/io/io_grid_image/grid_import.h         |    2 +-
 src/modules/io/io_grid_image/grid_to_kml.cpp       |    2 +-
 src/modules/io/io_grid_image/grid_to_kml.h         |    2 +-
 src/modules/io/io_shapes/MLB_Interface.cpp         |    6 +
 src/modules/io/io_shapes/Makefile.am               |    2 +
 src/modules/io/io_shapes/Makefile.in               |   47 +-
 .../io/{io_grid => io_shapes}/citygml_import.cpp   |    2 +-
 .../io/{io_grid => io_shapes}/citygml_import.h     |    2 +-
 .../io/io_shapes/pointcloud_from_text_file.cpp     |   33 +-
 .../io/io_shapes/pointcloud_to_text_file.cpp       |    6 +-
 src/modules/io/io_shapes_dxf/Makefile.am           |   11 +-
 src/modules/io/io_shapes_dxf/Makefile.in           |   91 +-
 src/modules/io/io_shapes_las/Makefile.in           |   35 +-
 src/modules/io/io_table/Makefile.in                |   35 +-
 src/modules/io/io_virtual/MLB_Interface.cpp        |    2 +-
 src/modules/io/io_virtual/MLB_Interface.h          |    2 +-
 src/modules/io/io_virtual/Makefile.am              |    2 +-
 src/modules/io/io_virtual/Makefile.in              |   37 +-
 src/modules/io/io_virtual/pc_create_spcvf.cpp      |    4 +-
 src/modules/io/io_virtual/pc_create_spcvf.h        |    2 +-
 src/modules/io/io_virtual/pc_get_grid_spcvf.cpp    |    2 +-
 src/modules/io/io_virtual/pc_get_grid_spcvf.h      |    2 +-
 src/modules/io/io_virtual/pc_get_subset_spcvf.cpp  |   22 +-
 src/modules/io/io_virtual/pc_get_subset_spcvf.h    |    2 +-
 .../io/io_virtual/pc_remove_overlap_from_spcvf.cpp |   11 +-
 .../io/io_virtual/pc_remove_overlap_from_spcvf.h   |    2 +-
 .../io/io_virtual/pc_tileshape_from_spcvf.cpp      |    2 +-
 .../io/io_virtual/pc_tileshape_from_spcvf.h        |    2 +-
 src/modules/pointcloud/Makefile.in                 |   34 +-
 .../pointcloud/pointcloud_tools/MLB_Interface.cpp  |    2 +-
 .../pointcloud/pointcloud_tools/MLB_Interface.h    |    2 +-
 .../pointcloud/pointcloud_tools/Makefile.in        |   35 +-
 .../pointcloud_tools/pc_attribute_calculator.cpp   |  111 +-
 .../pointcloud_tools/pc_attribute_calculator.h     |    5 +-
 .../pointcloud_tools/pc_cluster_analysis.cpp       |  296 +-
 .../pointcloud_tools/pc_cluster_analysis.h         |    8 +-
 src/modules/pointcloud/pointcloud_tools/pc_cut.cpp |   54 +-
 src/modules/pointcloud/pointcloud_tools/pc_cut.h   |    2 +-
 .../pointcloud_tools/pc_drop_attribute.cpp         |   21 +-
 .../pointcloud_tools/pc_drop_attribute.h           |    2 +-
 .../pointcloud/pointcloud_tools/pc_from_grid.cpp   |    2 +-
 .../pointcloud/pointcloud_tools/pc_from_grid.h     |    2 +-
 .../pointcloud/pointcloud_tools/pc_from_shapes.cpp |    2 +-
 .../pointcloud/pointcloud_tools/pc_from_shapes.h   |    2 +-
 .../pointcloud/pointcloud_tools/pc_from_table.cpp  |    2 +-
 .../pointcloud/pointcloud_tools/pc_from_table.h    |    2 +-
 .../pointcloud/pointcloud_tools/pc_merge.cpp       |   20 +-
 src/modules/pointcloud/pointcloud_tools/pc_merge.h |    2 +-
 .../pointcloud_tools/pc_reclass_extract.cpp        |   11 +-
 .../pointcloud_tools/pc_reclass_extract.h          |    2 +-
 .../pointcloud_tools/pc_thinning_simple.cpp        |    4 +-
 .../pointcloud_tools/pc_thinning_simple.h          |    2 +-
 .../pointcloud/pointcloud_tools/pc_to_grid.cpp     |    2 +-
 .../pointcloud/pointcloud_tools/pc_to_grid.h       |    2 +-
 .../pointcloud/pointcloud_tools/pc_to_shapes.cpp   |    9 +-
 .../pointcloud/pointcloud_tools/pc_to_shapes.h     |    2 +-
 .../pointcloud/pointcloud_tools/pc_transform.cpp   |   13 +-
 .../pointcloud/pointcloud_tools/pc_transform.h     |    2 +-
 .../pointcloud/pointcloud_viewer/MLB_Interface.cpp |    2 +-
 .../pointcloud/pointcloud_viewer/MLB_Interface.h   |    2 +-
 .../pointcloud/pointcloud_viewer/Makefile.in       |   35 +-
 .../pointcloud_viewer/points_view_control.cpp      |    2 +-
 .../pointcloud_viewer/points_view_control.h        |    2 +-
 .../pointcloud_viewer/points_view_dialog.cpp       |    2 +-
 .../pointcloud_viewer/points_view_dialog.h         |    2 +-
 .../pointcloud_viewer/points_view_extent.cpp       |    2 +-
 .../pointcloud_viewer/points_view_extent.h         |    2 +-
 .../pointcloud_viewer/points_view_module.cpp       |    2 +-
 .../pointcloud_viewer/points_view_module.h         |    2 +-
 src/modules/projection/Makefile.in                 |   34 +-
 src/modules/projection/pj_georeference/Makefile.in |   35 +-
 .../pj_georeference/set_grid_georeference.cpp      |  146 +-
 .../pj_georeference/set_grid_georeference.h        |    1 +
 src/modules/projection/pj_proj4/MLB_Interface.cpp  |    2 +-
 src/modules/projection/pj_proj4/MLB_Interface.h    |    2 +-
 src/modules/projection/pj_proj4/Makefile.am        |    2 +-
 src/modules/projection/pj_proj4/Makefile.in        |   37 +-
 src/modules/projection/pj_proj4/PROJ4_Base.cpp     |    2 +-
 src/modules/projection/pj_proj4/PROJ4_Base.h       |    2 +-
 src/modules/projection/pj_proj4/PROJ4_Grid.cpp     |    2 +-
 src/modules/projection/pj_proj4/PROJ4_Grid.h       |    2 +-
 src/modules/projection/pj_proj4/PROJ4_Shapes.cpp   |    2 +-
 src/modules/projection/pj_proj4/PROJ4_Shapes.h     |    2 +-
 src/modules/projection/pj_proj4/crs_assign.cpp     |    2 +-
 src/modules/projection/pj_proj4/crs_assign.h       |    2 +-
 src/modules/projection/pj_proj4/crs_base.cpp       |    2 +-
 src/modules/projection/pj_proj4/crs_base.h         |    2 +-
 .../projection/pj_proj4/crs_grid_geogcoords.cpp    |    2 +-
 .../projection/pj_proj4/crs_grid_geogcoords.h      |    2 +-
 src/modules/projection/pj_proj4/crs_indicatrix.cpp |    2 +-
 src/modules/projection/pj_proj4/crs_indicatrix.h   |    2 +-
 src/modules/projection/pj_proj4/crs_transform.cpp  |    2 +-
 src/modules/projection/pj_proj4/crs_transform.h    |    2 +-
 .../projection/pj_proj4/crs_transform_grid.cpp     |    2 +-
 .../projection/pj_proj4/crs_transform_grid.h       |    2 +-
 .../pj_proj4/crs_transform_pointcloud.cpp          |    2 +-
 .../projection/pj_proj4/crs_transform_pointcloud.h |    2 +-
 .../projection/pj_proj4/crs_transform_shapes.cpp   |    2 +-
 .../projection/pj_proj4/crs_transform_shapes.h     |    2 +-
 src/modules/projection/pj_proj4/gcs_graticule.cpp  |    2 +-
 src/modules/projection/pj_proj4/gcs_graticule.h    |    2 +-
 src/modules/projection/pj_proj4/gcs_lon_range.cpp  |    2 +-
 src/modules/projection/pj_proj4/gcs_lon_range.h    |    2 +-
 src/modules/shapes/Makefile.in                     |   34 +-
 .../shapes/shapes_grid/Grid_Classes_To_Shapes.cpp  |  118 +-
 .../shapes/shapes_grid/Grid_Classes_To_Shapes.h    |   17 +-
 .../shapes/shapes_grid/Grid_Polygon_Clip.cpp       |    2 +-
 src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h |    2 +-
 .../shapes_grid/Grid_Statistics_AddTo_Polygon.cpp  |    2 +-
 .../shapes_grid/Grid_Statistics_AddTo_Polygon.h    |    2 +-
 src/modules/shapes/shapes_grid/Grid_To_Contour.cpp |    2 +-
 src/modules/shapes/shapes_grid/Grid_To_Contour.h   |    2 +-
 .../shapes/shapes_grid/Grid_To_Gradient.cpp        |    2 +-
 src/modules/shapes/shapes_grid/Grid_To_Gradient.h  |    2 +-
 src/modules/shapes/shapes_grid/Grid_To_Points.cpp  |    2 +-
 src/modules/shapes/shapes_grid/Grid_To_Points.h    |    2 +-
 .../shapes/shapes_grid/Grid_To_Points_Random.cpp   |    2 +-
 .../shapes/shapes_grid/Grid_To_Points_Random.h     |    2 +-
 .../shapes_grid/Grid_Values_AddTo_Points.cpp       |    2 +-
 .../shapes/shapes_grid/Grid_Values_AddTo_Points.h  |    2 +-
 .../shapes_grid/Grid_Values_AddTo_Shapes.cpp       |    2 +-
 .../shapes/shapes_grid/Grid_Values_AddTo_Shapes.h  |    2 +-
 src/modules/shapes/shapes_grid/MLB_Interface.cpp   |    2 +-
 src/modules/shapes/shapes_grid/MLB_Interface.h     |    2 +-
 src/modules/shapes/shapes_grid/Makefile.am         |    2 +-
 src/modules/shapes/shapes_grid/Makefile.in         |   37 +-
 .../shapes_grid/grid_local_extremes_to_points.cpp  |    2 +-
 .../shapes_grid/grid_local_extremes_to_points.h    |    2 +-
 .../shapes/shapes_grid/grid_rectangle_clip.cpp     |    2 +-
 .../shapes/shapes_grid/grid_rectangle_clip.h       |    2 +-
 .../shapes/shapes_lines/Lines_From_Points.cpp      |    2 +-
 .../shapes/shapes_lines/Lines_From_Points.h        |    2 +-
 .../shapes/shapes_lines/Lines_From_Polygons.cpp    |    2 +-
 .../shapes/shapes_lines/Lines_From_Polygons.h      |    2 +-
 src/modules/shapes/shapes_lines/MLB_Interface.cpp  |    2 +-
 src/modules/shapes/shapes_lines/MLB_Interface.h    |    2 +-
 src/modules/shapes/shapes_lines/Makefile.in        |   35 +-
 src/modules/shapes/shapes_lines/line_dissolve.h    |    2 +-
 .../shapes_lines/line_polygon_intersection.cpp     |    2 +-
 .../shapes_lines/line_polygon_intersection.h       |    2 +-
 .../shapes/shapes_lines/line_properties.cpp        |    2 +-
 src/modules/shapes/shapes_lines/line_properties.h  |    2 +-
 .../shapes/shapes_lines/line_simplification.cpp    |    2 +-
 .../shapes/shapes_lines/line_simplification.h      |    2 +-
 src/modules/shapes/shapes_lines/line_smoothing.cpp |    2 +-
 src/modules/shapes/shapes_lines/line_smoothing.h   |    2 +-
 .../shapes/shapes_points/AddCoordinates.cpp        |    2 +-
 src/modules/shapes/shapes_points/AddCoordinates.h  |    2 +-
 src/modules/shapes/shapes_points/Clip_Points.cpp   |    2 +-
 src/modules/shapes/shapes_points/Clip_Points.h     |    2 +-
 src/modules/shapes/shapes_points/CountPoints.cpp   |    2 +-
 src/modules/shapes/shapes_points/CountPoints.h     |    2 +-
 .../shapes/shapes_points/CreatePointGrid.cpp       |    2 +-
 src/modules/shapes/shapes_points/CreatePointGrid.h |    2 +-
 .../shapes/shapes_points/DistanceMatrix.cpp        |    2 +-
 src/modules/shapes/shapes_points/DistanceMatrix.h  |    2 +-
 .../shapes/shapes_points/FitNPointsToShape.cpp     |    2 +-
 .../shapes/shapes_points/FitNPointsToShape.h       |    2 +-
 src/modules/shapes/shapes_points/MLB_Interface.cpp |    2 +-
 src/modules/shapes/shapes_points/MLB_Interface.h   |    2 +-
 src/modules/shapes/shapes_points/Makefile.am       |    2 +-
 src/modules/shapes/shapes_points/Makefile.in       |   37 +-
 .../shapes/shapes_points/Points_From_Lines.cpp     |    2 +-
 .../shapes/shapes_points/Points_From_Lines.h       |    2 +-
 .../shapes/shapes_points/Points_From_Table.cpp     |    2 +-
 .../shapes/shapes_points/Points_From_Table.h       |    2 +-
 .../shapes_points/add_polygon_attributes.cpp       |    2 +-
 .../shapes/shapes_points/add_polygon_attributes.h  |    2 +-
 .../shapes/shapes_points/remove_duplicates.cpp     |    2 +-
 .../shapes/shapes_points/remove_duplicates.h       |    2 +-
 .../shapes/shapes_points/separate_by_direction.cpp |    2 +-
 .../shapes/shapes_points/separate_by_direction.h   |    2 +-
 .../shapes/shapes_polygons/MLB_Interface.cpp       |    2 +-
 src/modules/shapes/shapes_polygons/MLB_Interface.h |    2 +-
 src/modules/shapes/shapes_polygons/Makefile.am     |    2 +-
 src/modules/shapes/shapes_polygons/Makefile.in     |   37 +-
 .../shapes/shapes_polygons/Polygon_Centroids.cpp   |    2 +-
 .../shapes/shapes_polygons/Polygon_Centroids.h     |    2 +-
 .../shapes/shapes_polygons/Polygon_Geometrics.cpp  |    2 +-
 .../shapes/shapes_polygons/Polygon_Geometrics.h    |    2 +-
 .../shapes_polygons/Polygon_Intersection.cpp       |    2 +-
 .../shapes/shapes_polygons/Polygon_Intersection.h  |    2 +-
 .../Polygon_StatisticsFromPoints.cpp               |    2 +-
 .../shapes_polygons/Polygon_StatisticsFromPoints.h |    2 +-
 .../shapes/shapes_polygons/Polygon_Union.cpp       |    2 +-
 src/modules/shapes/shapes_polygons/Polygon_Union.h |    2 +-
 .../shapes/shapes_polygons/Polygons_From_Lines.cpp |    2 +-
 .../shapes/shapes_polygons/Polygons_From_Lines.h   |    2 +-
 .../shapes_polygons/add_point_attributes.cpp       |    2 +-
 .../shapes/shapes_polygons/add_point_attributes.h  |    2 +-
 .../shapes/shapes_polygons/polygon_to_points.cpp   |    2 +-
 .../shapes/shapes_polygons/polygon_to_points.h     |    2 +-
 src/modules/shapes/shapes_polygons/shape_index.cpp |    2 +-
 src/modules/shapes/shapes_polygons/shape_index.h   |    2 +-
 .../shapes/shapes_tools/CreateChartLayer.cpp       |    2 +-
 src/modules/shapes/shapes_tools/CreateChartLayer.h |    2 +-
 .../shapes/shapes_tools/GraticuleBuilder.cpp       |    2 +-
 src/modules/shapes/shapes_tools/GraticuleBuilder.h |    2 +-
 src/modules/shapes/shapes_tools/MLB_Interface.cpp  |    2 +-
 src/modules/shapes/shapes_tools/MLB_Interface.h    |    2 +-
 src/modules/shapes/shapes_tools/Makefile.am        |    2 +-
 src/modules/shapes/shapes_tools/Makefile.in        |   37 +-
 .../shapes_tools/NewLayerFromSelectedShapes.cpp    |    2 +-
 .../shapes_tools/NewLayerFromSelectedShapes.h      |    2 +-
 src/modules/shapes/shapes_tools/QueryBuilder.cpp   |    2 +-
 src/modules/shapes/shapes_tools/QueryBuilder.h     |    2 +-
 src/modules/shapes/shapes_tools/SearchInTable.cpp  |    2 +-
 src/modules/shapes/shapes_tools/SearchInTable.h    |    2 +-
 src/modules/shapes/shapes_tools/SelectByTheme.cpp  |    2 +-
 src/modules/shapes/shapes_tools/SelectByTheme.h    |    2 +-
 src/modules/shapes/shapes_tools/SeparateShapes.cpp |    2 +-
 src/modules/shapes/shapes_tools/SeparateShapes.h   |    2 +-
 .../shapes/shapes_tools/Shapes_Create_Empty.cpp    |    2 +-
 .../shapes/shapes_tools/Shapes_Create_Empty.h      |    2 +-
 src/modules/shapes/shapes_tools/Shapes_Merge.cpp   |    2 +-
 src/modules/shapes/shapes_tools/Shapes_Merge.h     |    2 +-
 .../shapes/shapes_tools/TransformShapes.cpp        |    2 +-
 src/modules/shapes/shapes_tools/TransformShapes.h  |    2 +-
 .../shapes/shapes_tools/quadtree_structure.cpp     |    2 +-
 .../shapes/shapes_tools/quadtree_structure.h       |    2 +-
 src/modules/shapes/shapes_tools/shapes_buffer.cpp  |    2 +-
 src/modules/shapes/shapes_tools/shapes_buffer.h    |    2 +-
 .../shapes_tools/shapes_convert_vertex_type.cpp    |    2 +-
 .../shapes_tools/shapes_convert_vertex_type.h      |    2 +-
 src/modules/shapes/shapes_tools/shapes_cut.cpp     |  550 +-
 src/modules/shapes/shapes_tools/shapes_cut.h       |   18 +-
 .../shapes/shapes_tools/shapes_cut_interactive.cpp |  210 +-
 .../shapes/shapes_tools/shapes_cut_interactive.h   |   15 +-
 src/modules/shapes/shapes_tools/shapes_extents.cpp |    2 +-
 src/modules/shapes/shapes_tools/shapes_extents.h   |    2 +-
 .../shapes/shapes_tools/shapes_generate.cpp        |    2 +-
 src/modules/shapes/shapes_tools/shapes_generate.h  |    2 +-
 src/modules/shapes/shapes_tools/shapes_split.cpp   |    2 +-
 src/modules/shapes/shapes_tools/shapes_split.h     |    2 +-
 .../shapes_tools/shapes_split_by_attribute.cpp     |    2 +-
 .../shapes_tools/shapes_split_by_attribute.h       |    2 +-
 .../shapes/shapes_tools/shapes_split_randomly.cpp  |    2 +-
 .../shapes/shapes_tools/shapes_split_randomly.h    |    2 +-
 .../shapes/shapes_transect/MLB_Interface.cpp       |    2 +-
 src/modules/shapes/shapes_transect/MLB_Interface.h |    2 +-
 src/modules/shapes/shapes_transect/Makefile.am     |    2 +-
 src/modules/shapes/shapes_transect/Makefile.in     |   37 +-
 .../shapes/shapes_transect/Polygon_Transect.cpp    |    2 +-
 .../shapes/shapes_transect/Polygon_Transect.h      |    2 +-
 src/modules/simulation/Makefile.in                 |   34 +-
 .../simulation/sim_cellular_automata/Makefile.in   |   35 +-
 .../simulation/sim_ecosystems_hugget/Makefile.in   |   35 +-
 .../simulation/sim_erosion/MLB_Interface.cpp       |    2 +-
 src/modules/simulation/sim_erosion/MLB_Interface.h |    2 +-
 src/modules/simulation/sim_erosion/MMF_SAGA.cpp    |    2 +-
 src/modules/simulation/sim_erosion/MMF_SAGA.h      |    2 +-
 src/modules/simulation/sim_erosion/Makefile.in     |   35 +-
 .../simulation/sim_fire_spreading/Makefile.in      |   35 +-
 src/modules/simulation/sim_hydrology/Makefile.in   |   35 +-
 src/modules/simulation/sim_hydrology/topmodel.cpp  |    2 +-
 src/modules/simulation/sim_ihacres/Makefile.in     |   35 +-
 src/modules/simulation/sim_ihacres/ihacres_basin.h |    2 +-
 src/modules/simulation/sim_ihacres/ihacres_elev.h  |    2 +-
 src/modules/simulation/sim_ihacres/ihacres_eq.h    |    2 +-
 src/modules/simulation/sim_qm_of_esp/Makefile.in   |   35 +-
 src/modules/simulation/sim_rivflow/Makefile.in     |   35 +-
 src/modules/statistics/Makefile.in                 |   34 +-
 .../statistics/statistics_grid/MLB_Interface.cpp   |    7 +-
 src/modules/statistics/statistics_grid/Makefile.am |    2 +
 src/modules/statistics/statistics_grid/Makefile.in |   47 +-
 .../statistics_grid/categorical_variation.cpp}     |  195 +-
 .../statistics_grid/categorical_variation.h}       |   30 +-
 .../statistics/statistics_kriging/Makefile.in      |   35 +-
 .../statistics/statistics_points/Makefile.in       |   35 +-
 .../statistics/statistics_regression/Makefile.in   |   35 +-
 src/modules/table/Makefile.in                      |   34 +-
 src/modules/table/table_calculus/Fit.cpp           |    2 +-
 src/modules/table/table_calculus/Fit.h             |    2 +-
 src/modules/table/table_calculus/LMFit.cpp         |    2 +-
 src/modules/table/table_calculus/LMFit.h           |    2 +-
 src/modules/table/table_calculus/MLB_Interface.cpp |    2 +-
 src/modules/table/table_calculus/MLB_Interface.h   |    2 +-
 src/modules/table/table_calculus/Makefile.am       |    2 +-
 src/modules/table/table_calculus/Makefile.in       |   37 +-
 .../table/table_calculus/Table_Calculator.cpp      |    2 +-
 .../table/table_calculus/Table_Calculator.h        |    2 +-
 .../table_calculus/table_cluster_analysis.cpp      |    2 +-
 .../table/table_calculus/table_cluster_analysis.h  |    2 +-
 .../table_calculus/table_field_statistics.cpp      |    2 +-
 .../table/table_calculus/table_field_statistics.h  |    2 +-
 src/modules/table/table_calculus/table_pca.cpp     |    2 +-
 src/modules/table/table_calculus/table_pca.h       |    2 +-
 .../table/table_calculus/table_running_average.cpp |    2 +-
 .../table/table_calculus/table_running_average.h   |    2 +-
 src/modules/table/table_tools/MLB_Interface.cpp    |    2 +-
 src/modules/table/table_tools/MLB_Interface.h      |    2 +-
 src/modules/table/table_tools/Makefile.am          |    2 +-
 src/modules/table/table_tools/Makefile.in          |   37 +-
 .../table/table_tools/Table_Create_Empty.cpp       |    2 +-
 src/modules/table/table_tools/Table_Create_Empty.h |    2 +-
 src/modules/table/table_tools/Table_Enumerate.cpp  |    2 +-
 src/modules/table/table_tools/Table_Enumerate.h    |    2 +-
 src/modules/table/table_tools/Table_Rotate.cpp     |    2 +-
 src/modules/table/table_tools/Table_Rotate.h       |    2 +-
 .../table_tools/table_change_color_format.cpp      |    2 +-
 .../table/table_tools/table_change_color_format.h  |    2 +-
 .../table/table_tools/table_change_date_format.cpp |  216 +-
 .../table/table_tools/table_change_date_format.h   |    6 +-
 src/modules/terrain_analysis/Makefile.in           |   34 +-
 .../ta_channels/ChannelNetwork.cpp                 |    2 +-
 .../terrain_analysis/ta_channels/ChannelNetwork.h  |    2 +-
 .../ta_channels/ChannelNetwork_Altitude.cpp        |   99 +-
 .../ta_channels/ChannelNetwork_Altitude.h          |    2 +-
 .../ta_channels/ChannelNetwork_Distance.cpp        |    2 +-
 .../ta_channels/ChannelNetwork_Distance.h          |    2 +-
 .../ta_channels/D8_Flow_Analysis.cpp               |    2 +-
 .../ta_channels/D8_Flow_Analysis.h                 |    2 +-
 .../terrain_analysis/ta_channels/MLB_Interface.cpp |    2 +-
 .../terrain_analysis/ta_channels/MLB_Interface.h   |    2 +-
 .../terrain_analysis/ta_channels/Makefile.in       |   35 +-
 .../terrain_analysis/ta_channels/Strahler.cpp      |    2 +-
 .../terrain_analysis/ta_channels/Strahler.h        |    2 +-
 .../terrain_analysis/ta_channels/Watersheds.cpp    |    2 +-
 .../terrain_analysis/ta_channels/Watersheds.h      |    2 +-
 .../ta_channels/Watersheds_ext.cpp                 |    2 +-
 .../terrain_analysis/ta_channels/Watersheds_ext.h  |    2 +-
 .../terrain_analysis/ta_compound/Makefile.in       |   35 +-
 .../ta_hydrology/Flow_Distance.cpp                 |    4 +-
 .../terrain_analysis/ta_hydrology/Flow_Distance.h  |    2 +-
 .../ta_hydrology/Flow_Length.cpp}                  |  165 +-
 .../ta_hydrology/Flow_Length.h}                    |   30 +-
 .../ta_hydrology/IsochronesVar.cpp                 |    2 +-
 .../terrain_analysis/ta_hydrology/IsochronesVar.h  |    2 +-
 .../ta_hydrology/MLB_Interface.cpp                 |    8 +-
 .../terrain_analysis/ta_hydrology/Makefile.am      |    2 +
 .../terrain_analysis/ta_hydrology/Makefile.in      |   50 +-
 .../terrain_analysis/ta_lighting/HillShade.cpp     |    2 +-
 .../terrain_analysis/ta_lighting/HillShade.h       |    2 +-
 .../terrain_analysis/ta_lighting/MLB_Interface.cpp |    2 +-
 .../terrain_analysis/ta_lighting/MLB_Interface.h   |    2 +-
 .../terrain_analysis/ta_lighting/Makefile.in       |   35 +-
 .../ta_lighting/SolarRadiation.cpp                 |    2 +-
 .../terrain_analysis/ta_lighting/SolarRadiation.h  |    2 +-
 .../ta_lighting/Visibility_BASE.cpp                |    2 +-
 .../terrain_analysis/ta_lighting/Visibility_BASE.h |    2 +-
 .../ta_lighting/Visibility_Point.cpp               |    2 +-
 .../ta_lighting/Visibility_Point.h                 |    2 +-
 .../ta_lighting/Visibility_Points.cpp              |    2 +-
 .../ta_lighting/Visibility_Points.h                |    2 +-
 .../ta_lighting/topographic_correction.cpp         |    2 +-
 .../ta_lighting/topographic_correction.h           |    2 +-
 .../ta_lighting/topographic_openness.cpp           |    2 +-
 .../ta_lighting/topographic_openness.h             |    2 +-
 .../terrain_analysis/ta_lighting/view_shed.cpp     |    2 +-
 .../terrain_analysis/ta_lighting/view_shed.h       |    2 +-
 .../terrain_analysis/ta_morphometry/Hypsometry.cpp |    2 +-
 .../terrain_analysis/ta_morphometry/Hypsometry.h   |    2 +-
 .../terrain_analysis/ta_morphometry/Makefile.in    |   35 +-
 .../ta_morphometry/param_scale.cpp                 |    2 +-
 .../terrain_analysis/ta_morphometry/param_scale.h  |    2 +-
 .../terrain_analysis/ta_preprocessor/Makefile.in   |   35 +-
 .../terrain_analysis/ta_profiles/Makefile.in       |   35 +-
 .../ta_slope_stability/ANGMAP_01.cpp               |    2 +-
 .../ta_slope_stability/ANGMAP_01.h                 |    2 +-
 .../ta_slope_stability/MLB_Interface.cpp           |    2 +-
 .../ta_slope_stability/MLB_Interface.h             |    2 +-
 .../ta_slope_stability/Makefile.in                 |   35 +-
 .../ta_slope_stability/SHALSTAB_01.cpp             |    2 +-
 .../ta_slope_stability/SHALSTAB_01.h               |    2 +-
 .../ta_slope_stability/Safetyfactor_01.cpp         |    2 +-
 .../ta_slope_stability/Safetyfactor_01.h           |    2 +-
 .../ta_slope_stability/TOBIA_01.cpp                |    2 +-
 .../terrain_analysis/ta_slope_stability/TOBIA_01.h |    2 +-
 .../ta_slope_stability/WEDGEFAIL_01.cpp            |    2 +-
 .../ta_slope_stability/WEDGEFAIL_01.h              |    2 +-
 .../ta_slope_stability/WETNESS_01.cpp              |    2 +-
 .../ta_slope_stability/WETNESS_01.h                |    2 +-
 src/modules/tin/Makefile.in                        |   34 +-
 src/modules/tin/tin_tools/MLB_Interface.cpp        |    2 +-
 src/modules/tin/tin_tools/MLB_Interface.h          |    2 +-
 src/modules/tin/tin_tools/Makefile.am              |    2 +-
 src/modules/tin/tin_tools/Makefile.in              |   37 +-
 src/modules/tin/tin_tools/TIN_Flow_Parallel.cpp    |    2 +-
 src/modules/tin/tin_tools/TIN_Flow_Parallel.h      |    2 +-
 src/modules/tin/tin_tools/TIN_Flow_Trace.cpp       |    2 +-
 src/modules/tin/tin_tools/TIN_Flow_Trace.h         |    2 +-
 src/modules/tin/tin_tools/TIN_From_Grid.cpp        |    2 +-
 src/modules/tin/tin_tools/TIN_From_Grid.h          |    2 +-
 .../tin_tools/TIN_From_Grid_Specific_Points.cpp    |    2 +-
 .../tin/tin_tools/TIN_From_Grid_Specific_Points.h  |    2 +-
 src/modules/tin/tin_tools/TIN_From_Shapes.cpp      |    2 +-
 src/modules/tin/tin_tools/TIN_From_Shapes.h        |    2 +-
 src/modules/tin/tin_tools/TIN_Gradient.cpp         |    2 +-
 src/modules/tin/tin_tools/TIN_Gradient.h           |    2 +-
 src/modules/tin/tin_tools/TIN_To_Shapes.cpp        |    2 +-
 src/modules/tin/tin_tools/TIN_To_Shapes.h          |    2 +-
 src/modules/tin/tin_viewer/Makefile.in             |   35 +-
 src/saga_core/Makefile.in                          |   34 +-
 src/saga_core/saga_api/Makefile.am                 |    2 +-
 src/saga_core/saga_api/Makefile.in                 |   40 +-
 src/saga_core/saga_api/api_callback.cpp            |    2 +-
 src/saga_core/saga_api/api_colors.cpp              |    2 +-
 src/saga_core/saga_api/api_core.cpp                |    2 +-
 src/saga_core/saga_api/api_core.h                  |    2 +-
 src/saga_core/saga_api/api_file.cpp                |    3 +-
 src/saga_core/saga_api/api_memory.cpp              |    2 +-
 src/saga_core/saga_api/api_string.cpp              |   42 +-
 src/saga_core/saga_api/api_translator.cpp          |    2 +-
 src/saga_core/saga_api/clipper.cpp                 |  926 ++--
 src/saga_core/saga_api/clipper.hpp                 |   65 +-
 src/saga_core/saga_api/compatibility.h             |    2 +-
 src/saga_core/saga_api/data_manager.cpp            |   12 +-
 src/saga_core/saga_api/dataobject.cpp              |   17 +-
 src/saga_core/saga_api/dataobject.h                |    4 +-
 src/saga_core/saga_api/geo_classes.cpp             |    2 +-
 src/saga_core/saga_api/geo_functions.cpp           |    2 +-
 src/saga_core/saga_api/geo_tools.h                 |    2 +-
 src/saga_core/saga_api/grid.cpp                    |    2 +-
 src/saga_core/saga_api/grid.h                      |    2 +-
 src/saga_core/saga_api/grid_io.cpp                 |    2 +-
 src/saga_core/saga_api/grid_memory.cpp             |    2 +-
 src/saga_core/saga_api/grid_operation.cpp          |    2 +-
 src/saga_core/saga_api/grid_pyramid.cpp            |    2 +-
 src/saga_core/saga_api/grid_pyramid.h              |    2 +-
 src/saga_core/saga_api/grid_system.cpp             |    2 +-
 src/saga_core/saga_api/mat_formula.cpp             |    2 +-
 src/saga_core/saga_api/mat_grid_radius.cpp         |    2 +-
 src/saga_core/saga_api/mat_indexing.cpp            |    2 +-
 src/saga_core/saga_api/mat_matrix.cpp              |    2 +-
 src/saga_core/saga_api/mat_regression.cpp          |    2 +-
 src/saga_core/saga_api/mat_regression_multiple.cpp |    2 +-
 src/saga_core/saga_api/mat_spline.cpp              |    2 +-
 src/saga_core/saga_api/mat_tools.cpp               |    2 +-
 src/saga_core/saga_api/mat_tools.h                 |    2 +-
 src/saga_core/saga_api/mat_trend.cpp               |    2 +-
 src/saga_core/saga_api/metadata.cpp                |    2 +-
 src/saga_core/saga_api/metadata.h                  |    2 +-
 src/saga_core/saga_api/module.cpp                  |    2 +-
 src/saga_core/saga_api/module.h                    |    2 +-
 src/saga_core/saga_api/module_chain.cpp            |   17 +-
 src/saga_core/saga_api/module_grid.cpp             |    2 +-
 src/saga_core/saga_api/module_grid_interactive.cpp |    2 +-
 src/saga_core/saga_api/module_interactive.cpp      |    2 +-
 src/saga_core/saga_api/module_interactive_base.cpp |    2 +-
 src/saga_core/saga_api/module_library.cpp          |    2 +-
 src/saga_core/saga_api/module_library.h            |    2 +-
 .../saga_api/module_library_interface.cpp          |    2 +-
 src/saga_core/saga_api/parameter.cpp               |   17 +-
 src/saga_core/saga_api/parameter_data.cpp          |   22 +-
 src/saga_core/saga_api/parameters.cpp              |   29 +-
 src/saga_core/saga_api/parameters.h                |    6 +-
 src/saga_core/saga_api/pointcloud.cpp              |    2 +-
 src/saga_core/saga_api/pointcloud.h                |    6 +-
 src/saga_core/saga_api/projections.cpp             |    2 +-
 src/saga_core/saga_api/quadtree.cpp                |    2 +-
 src/saga_core/saga_api/saga_api.cpp                |    2 +-
 src/saga_core/saga_api/saga_api.h                  |    6 +-
 src/saga_core/saga_api/shape.cpp                   |    2 +-
 src/saga_core/saga_api/shape_line.cpp              |    2 +-
 src/saga_core/saga_api/shape_part.cpp              |    2 +-
 src/saga_core/saga_api/shape_point.cpp             |    2 +-
 src/saga_core/saga_api/shape_points.cpp            |    2 +-
 src/saga_core/saga_api/shape_polygon.cpp           |    2 +-
 src/saga_core/saga_api/shapes.cpp                  |    2 +-
 src/saga_core/saga_api/shapes.h                    |    2 +-
 src/saga_core/saga_api/shapes_io.cpp               |    2 +-
 src/saga_core/saga_api/shapes_ogis.cpp             |    2 +-
 src/saga_core/saga_api/shapes_search.cpp           |    2 +-
 src/saga_core/saga_api/shapes_selection.cpp        |    2 +-
 src/saga_core/saga_api/table.cpp                   |    4 +-
 src/saga_core/saga_api/table.h                     |    2 +-
 src/saga_core/saga_api/table_dbase.cpp             |    2 +-
 src/saga_core/saga_api/table_dbase.h               |    2 +-
 src/saga_core/saga_api/table_io.cpp                |    2 +-
 src/saga_core/saga_api/table_record.cpp            |    2 +-
 src/saga_core/saga_api/table_selection.cpp         |   11 +-
 src/saga_core/saga_api/table_value.h               |    2 +-
 src/saga_core/saga_api/tin.cpp                     |    2 +-
 src/saga_core/saga_api/tin.h                       |    2 +-
 src/saga_core/saga_api/tin_elements.cpp            |    2 +-
 src/saga_core/saga_api/tin_triangulation.cpp       |    2 +-
 src/saga_core/saga_cmd/Makefile.am                 |    2 +-
 src/saga_core/saga_cmd/Makefile.in                 |   37 +-
 src/saga_core/saga_cmd/callback.cpp                |    2 +-
 src/saga_core/saga_cmd/callback.h                  |    2 +-
 src/saga_core/saga_cmd/man/Makefile.in             |   35 +-
 src/saga_core/saga_cmd/module_library.cpp          |   21 +-
 src/saga_core/saga_cmd/module_library.h            |    2 +-
 src/saga_core/saga_cmd/saga_cmd.cpp                |    9 +-
 src/saga_core/saga_gdi/Makefile.in                 |   36 +-
 src/saga_core/saga_gdi/saga_gdi.cpp                |    2 +-
 src/saga_core/saga_gdi/saga_gdi.h                  |    2 +-
 src/saga_core/saga_gdi/sgdi_diagram.cpp            |    2 +-
 src/saga_core/saga_gdi/sgdi_diagram.h              |    2 +-
 src/saga_core/saga_gdi/sgdi_dialog.cpp             |   20 +-
 src/saga_core/saga_gdi/sgdi_dialog.h               |    2 +-
 src/saga_core/saga_gdi/sgdi_helper.cpp             |    2 +-
 src/saga_core/saga_gdi/sgdi_helper.h               |    2 +-
 src/saga_core/saga_gui/Makefile.am                 |    4 +-
 src/saga_core/saga_gui/Makefile.in                 |   43 +-
 src/saga_core/saga_gui/active.cpp                  |    2 +-
 src/saga_core/saga_gui/active.h                    |    2 +-
 src/saga_core/saga_gui/active_attributes.cpp       |    2 +-
 src/saga_core/saga_gui/active_attributes.h         |    2 +-
 .../saga_gui/active_attributes_control.cpp         |    6 +-
 src/saga_core/saga_gui/active_description.cpp      |    2 +-
 src/saga_core/saga_gui/active_description.h        |    2 +-
 src/saga_core/saga_gui/active_history.cpp          |    2 +-
 src/saga_core/saga_gui/active_history.h            |    2 +-
 src/saga_core/saga_gui/active_legend.cpp           |    2 +-
 src/saga_core/saga_gui/active_legend.h             |    2 +-
 src/saga_core/saga_gui/active_parameters.cpp       |    2 +-
 src/saga_core/saga_gui/active_parameters.h         |    2 +-
 src/saga_core/saga_gui/callback.cpp                |    2 +-
 src/saga_core/saga_gui/callback.h                  |    2 +-
 src/saga_core/saga_gui/data_source_files.cpp       |    4 +-
 src/saga_core/saga_gui/data_source_pgsql.cpp       |   33 +
 src/saga_core/saga_gui/data_source_pgsql.h         |    2 +
 src/saga_core/saga_gui/dc_helper.cpp               |   10 +-
 src/saga_core/saga_gui/dc_helper.h                 |    2 +-
 src/saga_core/saga_gui/dlg_about.cpp               |    2 +-
 src/saga_core/saga_gui/dlg_about.h                 |    2 +-
 src/saga_core/saga_gui/dlg_about_logo.cpp          |    2 +-
 src/saga_core/saga_gui/dlg_about_logo.h            |    2 +-
 src/saga_core/saga_gui/dlg_base.cpp                |    2 +-
 src/saga_core/saga_gui/dlg_base.h                  |    2 +-
 src/saga_core/saga_gui/dlg_colors.cpp              |    2 +-
 src/saga_core/saga_gui/dlg_colors.h                |    2 +-
 src/saga_core/saga_gui/dlg_colors_control.cpp      |    2 +-
 src/saga_core/saga_gui/dlg_colors_control.h        |    2 +-
 src/saga_core/saga_gui/dlg_list_base.cpp           |    2 +-
 src/saga_core/saga_gui/dlg_list_base.h             |    2 +-
 src/saga_core/saga_gui/dlg_list_grid.cpp           |    2 +-
 src/saga_core/saga_gui/dlg_list_grid.h             |    2 +-
 src/saga_core/saga_gui/dlg_list_pointcloud.cpp     |    2 +-
 src/saga_core/saga_gui/dlg_list_pointcloud.h       |    2 +-
 src/saga_core/saga_gui/dlg_list_shapes.cpp         |    2 +-
 src/saga_core/saga_gui/dlg_list_shapes.h           |    2 +-
 src/saga_core/saga_gui/dlg_list_table.cpp          |    2 +-
 src/saga_core/saga_gui/dlg_list_table.h            |    2 +-
 src/saga_core/saga_gui/dlg_list_tin.cpp            |    2 +-
 src/saga_core/saga_gui/dlg_list_tin.h              |    2 +-
 src/saga_core/saga_gui/dlg_parameters.cpp          |    2 +-
 src/saga_core/saga_gui/dlg_parameters.h            |    2 +-
 src/saga_core/saga_gui/dlg_table.cpp               |    2 +-
 src/saga_core/saga_gui/dlg_table.h                 |    2 +-
 src/saga_core/saga_gui/dlg_text.cpp                |    2 +-
 src/saga_core/saga_gui/dlg_text.h                  |    2 +-
 src/saga_core/saga_gui/helper.cpp                  |    2 +-
 src/saga_core/saga_gui/helper.h                    |    2 +-
 src/saga_core/saga_gui/info.cpp                    |    2 +-
 src/saga_core/saga_gui/info.h                      |    2 +-
 src/saga_core/saga_gui/info_messages.cpp           |    2 +-
 src/saga_core/saga_gui/info_messages.h             |    2 +-
 src/saga_core/saga_gui/man/Makefile.in             |   35 +-
 src/saga_core/saga_gui/parameters_control.cpp      |    2 +-
 src/saga_core/saga_gui/parameters_control.h        |    2 +-
 src/saga_core/saga_gui/parameters_properties.cpp   |    2 +-
 src/saga_core/saga_gui/parameters_properties.h     |    2 +-
 src/saga_core/saga_gui/project.cpp                 |    2 +-
 src/saga_core/saga_gui/project.h                   |    2 +-
 src/saga_core/saga_gui/res/resource.h              |    2 +-
 src/saga_core/saga_gui/res/saga.bra.txt            |  197 +-
 src/saga_core/saga_gui/res/saga.ger.txt            |  197 +-
 src/saga_core/saga_gui/res/saga.lng.txt            |  197 +-
 src/saga_core/saga_gui/res/saga_icon_22.png        |  Bin 0 -> 1672 bytes
 src/saga_core/saga_gui/res_commands.cpp            |   10 +-
 src/saga_core/saga_gui/res_commands.h              |   10 +-
 src/saga_core/saga_gui/res_controls.cpp            |    2 +-
 src/saga_core/saga_gui/res_controls.h              |    2 +-
 src/saga_core/saga_gui/res_dialogs.cpp             |    2 +-
 src/saga_core/saga_gui/res_dialogs.h               |    2 +-
 src/saga_core/saga_gui/res_images.cpp              |    2 +-
 src/saga_core/saga_gui/res_images.h                |    2 +-
 src/saga_core/saga_gui/saga.cpp                    |    2 +-
 src/saga_core/saga_gui/saga.h                      |    2 +-
 src/saga_core/saga_gui/saga_frame.cpp              |  171 +-
 src/saga_core/saga_gui/saga_frame.h                |   14 +-
 src/saga_core/saga_gui/saga_frame_droptarget.cpp   |    2 +-
 src/saga_core/saga_gui/saga_frame_droptarget.h     |    2 +-
 src/saga_core/saga_gui/view_base.cpp               |   14 +-
 src/saga_core/saga_gui/view_base.h                 |    6 +-
 src/saga_core/saga_gui/view_histogram.cpp          |  430 +-
 src/saga_core/saga_gui/view_histogram.h            |   22 +-
 src/saga_core/saga_gui/view_layout.cpp             |    2 +-
 src/saga_core/saga_gui/view_layout.h               |    2 +-
 src/saga_core/saga_gui/view_layout_control.cpp     |    2 +-
 src/saga_core/saga_gui/view_layout_control.h       |    2 +-
 src/saga_core/saga_gui/view_layout_info.cpp        |    2 +-
 src/saga_core/saga_gui/view_layout_info.h          |    2 +-
 src/saga_core/saga_gui/view_layout_printout.cpp    |    2 +-
 src/saga_core/saga_gui/view_layout_printout.h      |    2 +-
 src/saga_core/saga_gui/view_map.cpp                |    2 +-
 src/saga_core/saga_gui/view_map.h                  |    2 +-
 src/saga_core/saga_gui/view_map_3d.cpp             |    2 +-
 src/saga_core/saga_gui/view_map_3d.h               |    2 +-
 src/saga_core/saga_gui/view_map_control.cpp        |    2 +-
 src/saga_core/saga_gui/view_map_control.h          |    2 +-
 src/saga_core/saga_gui/view_ruler.cpp              |    2 +-
 src/saga_core/saga_gui/view_ruler.h                |    2 +-
 src/saga_core/saga_gui/view_scatterplot.cpp        |    2 +-
 src/saga_core/saga_gui/view_scatterplot.h          |    2 +-
 src/saga_core/saga_gui/view_table.cpp              |    2 +-
 src/saga_core/saga_gui/view_table.h                |    2 +-
 src/saga_core/saga_gui/view_table_control.cpp      |   81 +-
 src/saga_core/saga_gui/view_table_control.h        |    2 +-
 src/saga_core/saga_gui/view_table_diagram.cpp      |    8 +-
 src/saga_core/saga_gui/view_table_diagram.h        |    2 +-
 src/saga_core/saga_gui/wksp.cpp                    |    2 +-
 src/saga_core/saga_gui/wksp.h                      |    2 +-
 src/saga_core/saga_gui/wksp_base_control.cpp       |    2 +-
 src/saga_core/saga_gui/wksp_base_control.h         |    2 +-
 src/saga_core/saga_gui/wksp_base_item.cpp          |    2 +-
 src/saga_core/saga_gui/wksp_base_item.h            |    2 +-
 src/saga_core/saga_gui/wksp_base_manager.cpp       |    2 +-
 src/saga_core/saga_gui/wksp_base_manager.h         |    2 +-
 src/saga_core/saga_gui/wksp_data_control.cpp       |    2 +-
 src/saga_core/saga_gui/wksp_data_control.h         |    2 +-
 src/saga_core/saga_gui/wksp_data_layers.cpp        |    2 +-
 src/saga_core/saga_gui/wksp_data_layers.h          |    2 +-
 src/saga_core/saga_gui/wksp_data_manager.cpp       |   77 +-
 src/saga_core/saga_gui/wksp_data_manager.h         |    2 +-
 src/saga_core/saga_gui/wksp_data_menu_file.cpp     |    2 +-
 src/saga_core/saga_gui/wksp_data_menu_file.h       |    2 +-
 src/saga_core/saga_gui/wksp_data_menu_files.cpp    |    2 +-
 src/saga_core/saga_gui/wksp_data_menu_files.h      |    2 +-
 src/saga_core/saga_gui/wksp_grid.cpp               |    4 +-
 src/saga_core/saga_gui/wksp_grid.h                 |    2 +-
 src/saga_core/saga_gui/wksp_grid_manager.cpp       |    2 +-
 src/saga_core/saga_gui/wksp_grid_manager.h         |    2 +-
 src/saga_core/saga_gui/wksp_grid_system.cpp        |    2 +-
 src/saga_core/saga_gui/wksp_grid_system.h          |    2 +-
 src/saga_core/saga_gui/wksp_layer.cpp              |    2 +-
 src/saga_core/saga_gui/wksp_layer.h                |    2 +-
 src/saga_core/saga_gui/wksp_layer_classify.cpp     |    2 +-
 src/saga_core/saga_gui/wksp_layer_classify.h       |    2 +-
 src/saga_core/saga_gui/wksp_layer_legend.cpp       |    8 +-
 src/saga_core/saga_gui/wksp_layer_legend.h         |    2 +-
 src/saga_core/saga_gui/wksp_map.cpp                |   29 +-
 src/saga_core/saga_gui/wksp_map.h                  |    2 +-
 src/saga_core/saga_gui/wksp_map_basemap.cpp        |   33 +
 src/saga_core/saga_gui/wksp_map_basemap.h          |    2 +
 src/saga_core/saga_gui/wksp_map_buttons.cpp        |    2 +-
 src/saga_core/saga_gui/wksp_map_buttons.h          |    2 +-
 src/saga_core/saga_gui/wksp_map_control.cpp        |   19 +-
 src/saga_core/saga_gui/wksp_map_control.h          |    2 +-
 src/saga_core/saga_gui/wksp_map_dc.cpp             |    4 +-
 src/saga_core/saga_gui/wksp_map_dc.h               |    2 +-
 src/saga_core/saga_gui/wksp_map_graticule.cpp      |   28 +-
 src/saga_core/saga_gui/wksp_map_layer.cpp          |    2 +-
 src/saga_core/saga_gui/wksp_map_layer.h            |    2 +-
 src/saga_core/saga_gui/wksp_map_manager.cpp        |    2 +-
 src/saga_core/saga_gui/wksp_map_manager.h          |    2 +-
 src/saga_core/saga_gui/wksp_module.cpp             |    2 +-
 src/saga_core/saga_gui/wksp_module.h               |    2 +-
 src/saga_core/saga_gui/wksp_module_control.cpp     |    2 +-
 src/saga_core/saga_gui/wksp_module_control.h       |    2 +-
 src/saga_core/saga_gui/wksp_module_library.cpp     |    2 +-
 src/saga_core/saga_gui/wksp_module_library.h       |    2 +-
 src/saga_core/saga_gui/wksp_module_manager.cpp     |    2 +-
 src/saga_core/saga_gui/wksp_module_manager.h       |    2 +-
 src/saga_core/saga_gui/wksp_module_menu.cpp        |    2 +-
 src/saga_core/saga_gui/wksp_module_menu.h          |    2 +-
 src/saga_core/saga_gui/wksp_pointcloud.cpp         |    2 +-
 src/saga_core/saga_gui/wksp_pointcloud.h           |    2 +-
 src/saga_core/saga_gui/wksp_pointcloud_manager.cpp |    2 +-
 src/saga_core/saga_gui/wksp_pointcloud_manager.h   |    2 +-
 src/saga_core/saga_gui/wksp_shapes.cpp             |   20 +-
 src/saga_core/saga_gui/wksp_shapes.h               |    4 +-
 src/saga_core/saga_gui/wksp_shapes_edit.cpp        |    2 +-
 src/saga_core/saga_gui/wksp_shapes_line.cpp        |   36 +-
 src/saga_core/saga_gui/wksp_shapes_line.h          |    2 +-
 src/saga_core/saga_gui/wksp_shapes_manager.cpp     |    2 +-
 src/saga_core/saga_gui/wksp_shapes_manager.h       |    2 +-
 src/saga_core/saga_gui/wksp_shapes_point.cpp       |    8 +-
 src/saga_core/saga_gui/wksp_shapes_point.h         |    2 +-
 src/saga_core/saga_gui/wksp_shapes_points.cpp      |    2 +-
 src/saga_core/saga_gui/wksp_shapes_points.h        |    2 +-
 src/saga_core/saga_gui/wksp_shapes_polygon.cpp     |    8 +-
 src/saga_core/saga_gui/wksp_shapes_polygon.h       |    2 +-
 src/saga_core/saga_gui/wksp_shapes_type.cpp        |    2 +-
 src/saga_core/saga_gui/wksp_shapes_type.h          |    2 +-
 src/saga_core/saga_gui/wksp_table.cpp              |    2 +-
 src/saga_core/saga_gui/wksp_table.h                |    2 +-
 src/saga_core/saga_gui/wksp_table_manager.cpp      |    2 +-
 src/saga_core/saga_gui/wksp_table_manager.h        |    2 +-
 src/saga_core/saga_gui/wksp_tin.cpp                |    2 +-
 src/saga_core/saga_gui/wksp_tin.h                  |    2 +-
 src/saga_core/saga_gui/wksp_tin_manager.cpp        |    2 +-
 src/saga_core/saga_gui/wksp_tin_manager.h          |    2 +-
 src/scripting/helper/make_arcsaga_toolboxes.bat    |    2 +-
 src/scripting/helper/make_saga_release.bat         |   42 +-
 src/scripting/helper/make_saga_snapshot.bat        |    6 +-
 src/scripting/helper/make_tools_interface.bat      |    6 +-
 src/scripting/helper/make_translation_files.bat    |   18 +-
 .../helpers/saga_cmd_param_interface/tools.py      |   16 +-
 src/scripting/toolchains/terrain_segmentation.xml  |    2 +-
 1085 files changed, 17647 insertions(+), 10015 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 5426f90..1958472 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/configure $(am__configure_deps) \
-	$(srcdir)/config.h.in $(dist_toolchains_DATA) AUTHORS COPYING \
-	ChangeLog NEWS README compile config.guess config.sub depcomp \
-	install-sh missing py-compile ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -95,6 +101,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+	$(am__configure_deps) $(dist_toolchains_DATA) \
+	$(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
@@ -187,6 +196,9 @@ ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
+	COPYING ChangeLog NEWS README compile config.guess config.sub \
+	install-sh ltmain.sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -261,6 +273,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -279,6 +298,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -368,6 +388,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -404,7 +425,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -656,15 +676,15 @@ dist-xz: distdir
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
-	@echo WARNING: "Support for shar distribution archives is" \
-	               "deprecated." >&2
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
-	@echo WARNING: "Support for distribution archives compressed with" \
-		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
@@ -700,17 +720,17 @@ distcheck: dist
 	esac
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_inst
+	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure \
+	  && $(am__cd) $(distdir)/_build/sub \
+	  && ../../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
-	    --srcdir=.. --prefix="$$dc_install_base" \
+	    --srcdir=../.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -891,6 +911,8 @@ uninstall-am: uninstall-dist_toolchainsDATA
 	tags tags-am uninstall uninstall-am \
 	uninstall-dist_toolchainsDATA
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/README b/README
index 0022899..dfbaa78 100755
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 _______________________________________________________________________________
 
-         SAGA 2.2.7 - System for Automated Geoscientific Analyses
+         SAGA 2.3.0 - System for Automated Geoscientific Analyses
 _______________________________________________________________________________
 
 * Introduction
diff --git a/aclocal.m4 b/aclocal.m4
index 99d7934..0af81da 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.15], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -103,15 +103,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 ])
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -142,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -333,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -409,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -499,8 +498,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -573,7 +572,11 @@ to "yes", and re-run configure.
 END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -602,7 +605,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -613,7 +616,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -623,7 +626,7 @@ if test x"${install_sh}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -644,7 +647,7 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -694,7 +697,7 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -733,7 +736,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -762,7 +765,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -809,7 +812,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1044,7 +1047,7 @@ for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
 sys.exit(sys.hexversion < minverhex)"
   AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1063,7 +1066,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1144,7 +1147,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1204,7 +1207,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1232,7 +1235,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1251,7 +1254,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1382,6 +1385,7 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
+m4_include([m4/ax_lib_gdal.m4])
 m4_include([m4/ax_lib_postgresql.m4])
 m4_include([m4/ax_pkg_swig.m4])
 m4_include([m4/ax_python_devel.m4])
diff --git a/compile b/compile
index 531136b..a85b723 100755
--- a/compile
+++ b/compile
@@ -3,7 +3,7 @@
 
 scriptversion=2012-10-14.11; # UTC
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey at cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
diff --git a/config.guess b/config.guess
index b79252d..1659250 100755
--- a/config.guess
+++ b/config.guess
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2013-06-10'
+timestamp='2015-08-20'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -24,12 +24,12 @@ timestamp='2013-06-10'
 # program.  This Exception is an additional permission under section 7
 # of the GNU General Public License, version 3 ("GPLv3").
 #
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 #
-# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+# Please send patches to <config-patches at gnu.org>.
 
 
 me=`echo "$0" | sed -e 's,.*/,,'`
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
 	;;
 esac
 
@@ -168,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# Note: NetBSD doesn't particularly care about the vendor
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+	    /sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || \
+	    echo unknown)`
 	case "${UNAME_MACHINE_ARCH}" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
+	    earmv*)
+		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine=${arch}${endian}-unknown
+		;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently, or will in the future.
 	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
@@ -197,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		os=netbsd
 		;;
 	esac
+	# Determine ABI tags.
+	case "${UNAME_MACHINE_ARCH}" in
+	    earm*)
+		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+		;;
+	esac
 	# The OS release
 	# Debian GNU/NetBSD machines have a different userland, and
 	# thus, need a distinct triplet. However, they do not need
@@ -207,13 +221,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		release='-gnu'
 		;;
 	    *)
-		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
 		;;
 	esac
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
+	echo "${machine}-${os}${release}${abi}"
 	exit ;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -235,6 +249,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:MirBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
 	exit ;;
+    *:Sortix:*:*)
+	echo ${UNAME_MACHINE}-unknown-sortix
+	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
 	*4.0)
@@ -579,8 +596,9 @@ EOF
 	else
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
+	if [ -x /usr/bin/lslpp ] ; then
+		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
@@ -826,7 +844,7 @@ EOF
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -932,6 +950,9 @@ EOF
     crisv32:Linux:*:*)
 	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
+    e2k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     frv:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
@@ -969,10 +990,10 @@ EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or1k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-${LIBC}
 	exit ;;
-    or32:Linux:*:*)
+    or32:Linux:*:* | or1k*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
@@ -1020,7 +1041,7 @@ EOF
 	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
@@ -1260,16 +1281,26 @@ EOF
 	if test "$UNAME_PROCESSOR" = unknown ; then
 	    UNAME_PROCESSOR=powerpc
 	fi
-	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		case $UNAME_PROCESSOR in
-		    i386) UNAME_PROCESSOR=x86_64 ;;
-		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		esac
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		    grep IS_64BIT_ARCH >/dev/null
+		then
+		    case $UNAME_PROCESSOR in
+			i386) UNAME_PROCESSOR=x86_64 ;;
+			powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		    esac
+		fi
 	    fi
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
 	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
@@ -1361,154 +1392,6 @@ EOF
 	exit ;;
 esac
 
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 
diff --git a/config.h.in b/config.h.in
index 1a2aa1a..f7c74cf 100644
--- a/config.h.in
+++ b/config.h.in
@@ -15,6 +15,12 @@
 /* Define to 1 if you have the `floor' function. */
 #undef HAVE_FLOOR
 
+/* Define to 1 if GDAL library are available */
+#undef HAVE_GDAL
+
+/* Define to 1 if GDAL library includes OGR support */
+#undef HAVE_GDAL_OGR
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
@@ -118,8 +124,7 @@
    slash. */
 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
 #undef LT_OBJDIR
 
 /* Name of package */
diff --git a/config.sub b/config.sub
index 9633db7..1acc966 100755
--- a/config.sub
+++ b/config.sub
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2013-08-10'
+timestamp='2015-08-20'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ timestamp='2013-08-10'
 # of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+# Please send patches to <config-patches at gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -68,7 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -117,7 +117,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -255,16 +255,18 @@ case $basic_machine in
 	| arc | arceb \
 	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
 	| avr | avr32 \
+	| ba \
 	| be32 | be64 \
 	| bfin \
 	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
+	| e2k | epiphany \
+	| fido | fr30 | frv | ft32 \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
@@ -282,8 +284,10 @@ case $basic_machine in
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipsr5900 | mipsr5900el \
@@ -295,14 +299,14 @@ case $basic_machine in
 	| nds32 | nds32le | nds32be \
 	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or1k | or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
+	| riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -310,6 +314,7 @@ case $basic_machine in
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| visium \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -324,7 +329,10 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	leon|leon[3-9])
+		basic_machine=sparc-$basic_machine
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -369,18 +377,20 @@ case $basic_machine in
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
+	| ba-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
+	| e2k-* | elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
@@ -400,8 +410,10 @@ case $basic_machine in
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipsr5900-* | mipsr5900el-* \
@@ -413,16 +425,18 @@ case $basic_machine in
 	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
+	| riscv32-* | riscv64-* \
 	| rl78-* | romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
 	| tahoe-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 	| tile*-* \
@@ -430,6 +444,7 @@ case $basic_machine in
 	| ubicom32-* \
 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 	| vax-* \
+	| visium-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -506,6 +521,9 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-aros
 		;;
+        asmjs)
+		basic_machine=asmjs-unknown
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -767,6 +785,9 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	leon-*|leon[3-9]-*)
+		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+		;;
 	m68knommu)
 		basic_machine=m68k-unknown
 		os=-linux
@@ -822,6 +843,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -1354,7 +1379,7 @@ case $os in
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
 	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
+	      | -aos* | -aros* | -cloudabi* | -sortix* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1367,14 +1392,14 @@ case $os in
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1592,9 +1617,6 @@ case $basic_machine in
 	mips*-*)
 		os=-elf
 		;;
-	or1k-*)
-		os=-elf
-		;;
 	or32-*)
 		os=-coff
 		;;
diff --git a/configure b/configure
index d4c07b8..4b67776 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for saga 2.2.7.
+# Generated by GNU Autoconf 2.69 for saga 2.3.0.
 #
 # Report bugs to <BUG-REPORT-ADDRESS>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='saga'
 PACKAGE_TARNAME='saga'
-PACKAGE_VERSION='2.2.7'
-PACKAGE_STRING='saga 2.2.7'
+PACKAGE_VERSION='2.3.0'
+PACKAGE_STRING='saga 2.3.0'
 PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS'
 PACKAGE_URL=''
 
@@ -665,10 +665,19 @@ HAVE_LLAS_FALSE
 HAVE_LLAS_TRUE
 HAVE_CV_FALSE
 HAVE_CV_TRUE
+SYSTEM_DXFLIB_FALSE
+SYSTEM_DXFLIB_TRUE
 LIBFIRE_FALSE
 LIBFIRE_TRUE
 TRIANGLE_FALSE
 TRIANGLE_TRUE
+GDAL2FLAGS
+GDAL_OGR_ENABLED
+GDAL_DEP_LDFLAGS
+GDAL_LDFLAGS
+GDAL_CFLAGS
+GDAL_VERSION
+GDAL_CONFIG
 GOMPFLAGS
 OPENMP_FALSE
 OPENMP_TRUE
@@ -690,6 +699,7 @@ POW_LIB
 LIBOBJS
 CXXCPP
 CPP
+LT_SYS_LIBRARY_PATH
 OTOOL64
 OTOOL
 LIPO
@@ -788,6 +798,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -816,6 +827,7 @@ enable_shared
 enable_static
 with_pic
 enable_fast_install
+with_aix_soname
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
@@ -825,8 +837,10 @@ enable_debug
 enable_gui
 enable_odbc
 enable_openmp
+with_gdal
 enable_triangle
 enable_libfire
+with_system_dxflib
 enable_python
 '
       ac_precious_vars='build_alias
@@ -840,6 +854,7 @@ CPPFLAGS
 CCC
 CC
 CFLAGS
+LT_SYS_LIBRARY_PATH
 CPP
 CXXCPP
 PYTHON
@@ -882,6 +897,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1134,6 +1150,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1271,7 +1296,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1384,7 +1409,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures saga 2.2.7 to adapt to many kinds of systems.
+\`configure' configures saga 2.3.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1424,6 +1449,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1454,7 +1480,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of saga 2.2.7:";;
+     short | recursive ) echo "Configuration of saga 2.3.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1489,12 +1515,18 @@ Optional Packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
+  --with-aix-soname=aix|svr4|both
+                          shared library versioning (aka "SONAME") variant to
+                          provide on AIX, [default=aix].
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot=DIR Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).
+  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
+                          compiler's sysroot if not specified).
   --with-local=dir        search /usr/local or other directory for includes and libs
   --with-postgresql=[ARG] use PostgreSQL library [default=yes], optionally
                           specify path to pg_config
+  --with-gdal=[ARG]       Specify full path to gdal-config script
+  --with-system-dxflib    Use system version of dxflib instead of embedded
+                          copy, requires this library (and the header files)
 
 Some influential environment variables:
   CXX         C++ compiler command
@@ -1506,6 +1538,8 @@ Some influential environment variables:
               you have headers in a nonstandard directory <include dir>
   CC          C compiler command
   CFLAGS      C compiler flags
+  LT_SYS_LIBRARY_PATH
+              User-defined run-time library search path.
   CPP         C preprocessor
   CXXCPP      C++ preprocessor
   PYTHON      the Python interpreter
@@ -1580,7 +1614,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-saga configure 2.2.7
+saga configure 2.3.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2124,7 +2158,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by saga $as_me 2.2.7, which was
+It was created by saga $as_me 2.3.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2476,7 +2510,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ac_config_headers="$ac_config_headers config.h"
 
 
-am__api_version='1.14'
+am__api_version='1.15'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2677,8 +2711,8 @@ test "$program_suffix" != NONE &&
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 if test x"${MISSING+set}" != xset; then
   case $am_aux_dir in
@@ -2697,7 +2731,7 @@ else
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -2991,7 +3025,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='saga'
- VERSION='2.2.7'
+ VERSION='2.3.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3025,8 +3059,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
@@ -3201,6 +3235,7 @@ END
 fi
 
 
+
 # Checks for programs.
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -4635,8 +4670,8 @@ esac
 
 
 
-macro_version='2.4.2'
-macro_revision='1.3337'
+macro_version='2.4.6'
+macro_revision='2.4.6'
 
 
 
@@ -4650,7 +4685,7 @@ macro_revision='1.3337'
 
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
@@ -4770,7 +4805,7 @@ func_echo_all ()
     $ECHO ""
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
 $as_echo "printf" >&6; } ;;
   print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
@@ -5093,19 +5128,19 @@ test -z "$GREP" && GREP=grep
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
 else
   with_gnu_ld=no
 fi
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -5119,7 +5154,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -5130,7 +5165,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
@@ -5141,32 +5176,32 @@ if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi
 fi
 
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
@@ -5209,33 +5244,38 @@ if ${lt_cv_path_NM+:} false; then :
 else
   if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -5246,15 +5286,15 @@ else
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
@@ -5360,9 +5400,9 @@ esac
   fi
 fi
 
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -5370,8 +5410,8 @@ fi
     esac
   fi
 
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -5422,7 +5462,7 @@ if ${lt_cv_sys_max_cmd_len+:} false; then :
   $as_echo_n "(cached) " >&6
 else
     i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -5462,7 +5502,7 @@ else
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -5513,22 +5553,22 @@ else
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-	test undefined != "$lt_cv_sys_max_cmd_len"; then
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -5546,7 +5586,7 @@ else
 
 fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
 else
@@ -5564,30 +5604,6 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
@@ -5710,13 +5726,13 @@ esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -5844,13 +5860,13 @@ lt_cv_deplibs_check_method='unknown'
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[4-9]*)
@@ -5877,8 +5893,7 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -5974,8 +5989,8 @@ newos6*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -6028,6 +6043,9 @@ sysv4 | sysv4.3*)
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 esac
 
 fi
@@ -6185,8 +6203,8 @@ else
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -6198,7 +6216,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 
@@ -6353,7 +6371,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
@@ -6361,7 +6379,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -6374,7 +6392,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
 $as_echo "$lt_cv_ar_at_file" >&6; }
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -6591,7 +6609,7 @@ old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -6681,7 +6699,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   symcode='[ABCDGISTW]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[ABCDEGRST]'
   fi
   ;;
@@ -6714,14 +6732,44 @@ case `$NM -V 2>&1` in
   symcode='[ABCDGIRSTW]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -6739,21 +6787,24 @@ for ac_symprfx in "" "_"; do
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -6801,11 +6852,11 @@ _LT_EOF
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
@@ -6831,7 +6882,7 @@ lt__PROGRAM__LTX_preloaded_symbols[] =
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -6851,13 +6902,13 @@ _LT_EOF
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -6878,7 +6929,7 @@ _LT_EOF
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -6931,6 +6982,16 @@ fi
 
 
 
+
+
+
+
+
+
+
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
 $as_echo_n "checking for sysroot... " >&6; }
 
@@ -6943,9 +7004,9 @@ fi
 
 
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -6955,8 +7016,8 @@ case ${with_sysroot} in #(
  no|'')
    ;; #(
  *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
    as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
    ;;
 esac
@@ -6968,18 +7029,99 @@ $as_echo "${lt_sysroot:-no}" >&6; }
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+  ac_path_lt_DD_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in dd; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi
+      $ac_path_lt_DD_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_lt_DD"; then
+    :
+  fi
+else
+  ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
 # Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then :
   enableval=$enable_libtool_lock;
 fi
 
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -6988,24 +7130,25 @@ ia64-*-hpux*)
   test $ac_status = 0; }; then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '#line '$LINENO' "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -7034,9 +7177,50 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7059,10 +7243,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 		;;
 	    esac
 	    ;;
-	  powerpc64le-*)
+	  powerpc64le-*linux*)
 	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  powerpc64-*)
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -7081,10 +7265,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*)
+	  powerpcle-*linux*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*)
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -7102,7 +7286,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
@@ -7142,13 +7326,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
 $as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7160,7 +7345,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -7169,7 +7354,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -7185,7 +7370,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
@@ -7296,7 +7481,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 
@@ -7799,7 +7984,7 @@ if ${lt_cv_apple_cc_single_mod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -7817,7 +8002,7 @@ else
 	  cat conftest.err >&5
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&5
@@ -7856,7 +8041,7 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
@@ -7885,7 +8070,7 @@ _LT_EOF
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&5
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&5
@@ -7898,32 +8083,32 @@ fi
 $as_echo "$lt_cv_ld_force_load" >&6; }
     case $host_os in
     rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[012]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	10.[012][,.]*)
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -7931,6 +8116,41 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
     ;;
   esac
 
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8216,9 +8436,9 @@ done
 
 func_stripname_cnf ()
 {
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  case $2 in
+  .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;;
   esac
 } # func_stripname_cnf
 
@@ -8245,14 +8465,14 @@ if test "${enable_shared+set}" = set; then :
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8276,14 +8496,14 @@ if test "${enable_static+set}" = set; then :
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8307,14 +8527,14 @@ if test "${with_pic+set}" = set; then :
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8322,8 +8542,6 @@ else
 fi
 
 
-test -z "$pic_mode" && pic_mode=default
-
 
 
 
@@ -8339,14 +8557,14 @@ if test "${enable_fast_install+set}" = set; then :
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -8360,11 +8578,63 @@ fi
 
 
 
+  shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+  withval=$with_aix_soname; case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname
+else
+  if ${lt_cv_with_aix_soname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_with_aix_soname=aix
+fi
+
+    with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+
+
+
+
+
+
 
 
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -8413,7 +8683,7 @@ test -z "$LN_S" && LN_S="ln -s"
 
 
 
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -8452,7 +8722,7 @@ aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -8463,14 +8733,14 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -8479,15 +8749,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$LD" && LD=ld
 test -z "$ac_objext" && ac_objext=o
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
 
 
 # Only perform the check for file, if the check method requires it
@@ -8502,22 +8765,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then :
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+    if test -f "$ac_dir/${ac_tool_prefix}file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -8540,13 +8803,13 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -8568,22 +8831,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then :
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+    if test -f "$ac_dir/file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -8606,13 +8869,13 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -8633,7 +8896,7 @@ esac
 
 # Use C for the default configuration in the libtool script
 
-lt_save_CC="$CC"
+lt_save_CC=$CC
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8695,7 +8958,7 @@ if test -n "$compiler"; then
 
 lt_prog_compiler_no_builtin_flag=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
@@ -8711,7 +8974,7 @@ else
   lt_cv_prog_compiler_rtti_exceptions=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -8741,7 +9004,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
 else
     :
@@ -8759,17 +9022,18 @@ lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
 
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     lt_prog_compiler_wl='-Wl,'
     lt_prog_compiler_static='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       fi
+      lt_prog_compiler_pic='-fPIC'
       ;;
 
     amigaos*)
@@ -8780,8 +9044,8 @@ lt_prog_compiler_static=
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -8797,6 +9061,11 @@ lt_prog_compiler_static=
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -8867,7 +9136,7 @@ lt_prog_compiler_static=
     case $host_os in
     aix*)
       lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       else
@@ -8875,10 +9144,29 @@ lt_prog_compiler_static=
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl='-Wl,-Wl,,'
+        lt_prog_compiler_pic='-PIC'
+        lt_prog_compiler_static='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -8894,7 +9182,7 @@ lt_prog_compiler_static=
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      lt_prog_compiler_static='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -8905,7 +9193,7 @@ lt_prog_compiler_static=
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
@@ -8930,6 +9218,12 @@ lt_prog_compiler_static=
 	lt_prog_compiler_pic='-PIC'
 	lt_prog_compiler_static='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -9027,7 +9321,7 @@ lt_prog_compiler_static=
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	lt_prog_compiler_pic='-Kconform_pic'
 	lt_prog_compiler_static='-Bstatic'
       fi
@@ -9056,7 +9350,7 @@ lt_prog_compiler_static=
   fi
 
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
     ;;
@@ -9088,7 +9382,7 @@ else
   lt_cv_prog_compiler_pic_works=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -9118,7 +9412,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
     case $lt_prog_compiler_pic in
      "" | " "*) ;;
      *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -9150,7 +9444,7 @@ if ${lt_cv_prog_compiler_static_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -9169,13 +9463,13 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works"; then
     :
 else
     lt_prog_compiler_static=
@@ -9295,8 +9589,8 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -9308,9 +9602,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
@@ -9353,9 +9647,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   # included in the symbol list
   include_expsyms=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -9370,7 +9664,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -9378,7 +9672,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
   linux* | k*bsd*-gnu | gnu*)
@@ -9391,7 +9685,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -9413,24 +9707,24 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
+    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       whole_archive_flag_spec=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -9443,7 +9737,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     case $host_os in
     aix[3-9]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
@@ -9462,7 +9756,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -9478,7 +9772,7 @@ _LT_EOF
 	allow_undefined_flag=unsupported
 	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9488,7 +9782,7 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      export_dynamic_flag_spec='$wl--export-all-symbols'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
@@ -9496,61 +9790,89 @@ _LT_EOF
       exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	ld_shlibs=no
       fi
       ;;
 
     haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       link_all_deplibs=yes
       ;;
 
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
     interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
+      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+      export_dynamic_flag_spec='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -9561,42 +9883,47 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  whole_archive_flag_spec=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
+	tcc*)
+	  export_dynamic_flag_spec='-rdynamic'
+	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
 	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -9610,8 +9937,8 @@ _LT_EOF
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -9629,8 +9956,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9642,7 +9969,7 @@ _LT_EOF
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -9657,9 +9984,9 @@ _LT_EOF
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -9676,15 +10003,15 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
       ;;
     esac
 
-    if test "$ld_shlibs" = no; then
+    if test no = "$ld_shlibs"; then
       runpath_var=
       hardcode_libdir_flag_spec=
       export_dynamic_flag_spec=
@@ -9700,7 +10027,7 @@ _LT_EOF
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct=unsupported
@@ -9708,34 +10035,57 @@ _LT_EOF
       ;;
 
     aix[4-9]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
 	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
 	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
 	  ;;
 	esac
 
@@ -9754,13 +10104,21 @@ _LT_EOF
       hardcode_direct_absolute=yes
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
+      file_list_spec='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	hardcode_direct=no
+	hardcode_direct_absolute=no
+	;;
+      esac
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -9779,36 +10137,42 @@ _LT_EOF
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
-	link_all_deplibs=no
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      export_dynamic_flag_spec='${wl}-bexpall'
+      export_dynamic_flag_spec='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	allow_undefined_flag='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        if test "${lt_cv_aix_libpath+set}" = set; then
+        if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -9843,7 +10207,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -9851,17 +10215,17 @@ fi
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 if test "${lt_cv_aix_libpath+set}" = set; then
+	 if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -9896,7 +10260,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -9904,21 +10268,33 @@ fi
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' ${wl}-bernotok'
-	  allow_undefined_flag=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  no_undefined_flag=' $wl-bernotok'
+	  allow_undefined_flag=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    whole_archive_flag_spec='$convenience'
 	  fi
 	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) >  [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
 	fi
       fi
       ;;
@@ -9927,7 +10303,7 @@ fi
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -9957,16 +10333,17 @@ fi
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
 	enable_shared_with_static_runtimes=yes
@@ -9975,18 +10352,18 @@ fi
 	# Don't use ranlib
 	old_postinstall_cmds='chmod 644 $oldlib'
 	postlink_cmds='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -9995,7 +10372,7 @@ fi
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -10014,24 +10391,24 @@ fi
   hardcode_direct=no
   hardcode_automatic=yes
   hardcode_shlibpath_var=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
     whole_archive_flag_spec=''
   fi
   link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
+  allow_undefined_flag=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
 
   else
   ld_shlibs=no
@@ -10073,33 +10450,33 @@ fi
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_direct=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
+      export_dynamic_flag_spec='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='${wl}-E'
+	export_dynamic_flag_spec='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	hardcode_minus_L=yes
@@ -10107,25 +10484,25 @@ fi
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 
@@ -10137,7 +10514,7 @@ if ${lt_cv_prog_compiler__b+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler__b=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS -b"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -10156,14 +10533,14 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
 $as_echo "$lt_cv_prog_compiler__b" >&6; }
 
-if test x"$lt_cv_prog_compiler__b" = xyes; then
-    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+if test yes = "$lt_cv_prog_compiler__b"; then
+    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 else
     archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 fi
@@ -10171,8 +10548,8 @@ fi
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 
 	case $host_cpu in
@@ -10183,7 +10560,7 @@ fi
 	*)
 	  hardcode_direct=yes
 	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='${wl}-E'
+	  export_dynamic_flag_spec='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -10194,8 +10571,8 @@ fi
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
@@ -10205,8 +10582,8 @@ $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >
 if ${lt_cv_irix_exported_symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+  save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int foo (void) { return 0; }
@@ -10218,24 +10595,35 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS="$save_LDFLAGS"
+           LDFLAGS=$save_LDFLAGS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
+	link_all_deplibs=no
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       inherit_rpath=yes
       link_all_deplibs=yes
       ;;
 
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	ld_shlibs=yes
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
     netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
@@ -10250,7 +10638,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
     newsos6)
       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_shlibpath_var=no
       ;;
@@ -10258,27 +10646,19 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	hardcode_direct=yes
 	hardcode_shlibpath_var=no
 	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec='${wl}-E'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+	  export_dynamic_flag_spec='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
 	fi
       else
 	ld_shlibs=no
@@ -10289,33 +10669,53 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -10326,24 +10726,24 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
 
     solaris*)
       no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -10353,11 +10753,11 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
 	fi
@@ -10367,10 +10767,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -10419,43 +10819,43 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
+      no_undefined_flag='$wl-z,text'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
+      no_undefined_flag='$wl-z,text'
+      allow_undefined_flag='$wl-z,nodefs'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_flag_spec='$wl-R,$libdir'
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
+      export_dynamic_flag_spec='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -10470,10 +10870,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	export_dynamic_flag_spec='$wl-Blargedynsym'
 	;;
       esac
     fi
@@ -10481,7 +10881,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
 $as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
+test no = "$ld_shlibs" && can_build_shared=no
 
 with_gnu_ld=$with_gnu_ld
 
@@ -10507,7 +10907,7 @@ x|xyes)
   # Assume -lc should be added
   archive_cmds_need_lc=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $archive_cmds in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -10722,14 +11122,14 @@ esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -10745,28 +11145,35 @@ if test "$GCC" = yes; then
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -10780,7 +11187,7 @@ BEGIN {RS=" "; FS="/|\n";} {
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -10789,7 +11196,7 @@ fi
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -10806,14 +11213,16 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[4-9]*)
@@ -10821,41 +11230,91 @@ aix[4-9]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a(lib.so.V)'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -10865,18 +11324,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -10884,8 +11343,8 @@ beos*)
 bsdi[45]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -10897,7 +11356,7 @@ bsdi[45]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -10906,8 +11365,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -10923,17 +11382,17 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
 
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -10942,8 +11401,8 @@ cygwin* | mingw* | pw32* | cegcc*)
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -10970,7 +11429,7 @@ cygwin* | mingw* | pw32* | cegcc*)
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -10983,8 +11442,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -10997,7 +11456,7 @@ cygwin* | mingw* | pw32* | cegcc*)
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -11010,8 +11469,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -11024,8 +11483,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -11043,12 +11502,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -11078,10 +11538,10 @@ haiku*)
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -11099,14 +11559,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -11114,8 +11575,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -11124,8 +11585,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -11138,8 +11599,8 @@ interix[3-9]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -11150,7 +11611,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -11158,8 +11619,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -11178,8 +11639,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -11188,13 +11649,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -11238,7 +11719,12 @@ fi
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -11270,12 +11756,12 @@ netbsd*)
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -11285,7 +11771,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -11294,58 +11780,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -11356,8 +11852,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -11367,11 +11863,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -11379,8 +11875,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -11401,24 +11897,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -11436,7 +11932,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -11444,8 +11940,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -11455,22 +11951,29 @@ uts4*)
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
 
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
 
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
 
 
 
@@ -11560,20 +12063,28 @@ fi
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
-   test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
 
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test yes = "$hardcode_automatic"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$hardcode_direct" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+     test no != "$hardcode_minus_L"; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
   else
@@ -11588,12 +12099,12 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
 $as_echo "$hardcode_action" >&6; }
 
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
+if test relink = "$hardcode_action" ||
+   test yes = "$inherit_rpath"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -11603,7 +12114,7 @@ fi
 
 
 
-  if test "x$enable_dlopen" != xyes; then
+  if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -11613,23 +12124,23 @@ else
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
 if ${ac_cv_lib_dl_dlopen+:} false; then :
@@ -11667,10 +12178,10 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
 
-    lt_cv_dlopen="dyld"
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
 
@@ -11678,10 +12189,18 @@ fi
 
     ;;
 
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
   *)
     ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
 if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load"
+  lt_cv_dlopen=shl_load
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
 $as_echo_n "checking for shl_load in -ldld... " >&6; }
@@ -11720,11 +12239,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
 else
   ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
 if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen"
+  lt_cv_dlopen=dlopen
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
@@ -11763,7 +12282,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
@@ -11802,7 +12321,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
 $as_echo_n "checking for dld_link in -ldld... " >&6; }
@@ -11841,7 +12360,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
 fi
 
 
@@ -11862,21 +12381,21 @@ fi
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
@@ -11884,7 +12403,7 @@ $as_echo_n "checking whether a program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11931,9 +12450,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -11963,7 +12482,7 @@ _LT_EOF
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -11983,14 +12502,14 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
 $as_echo "$lt_cv_dlopen_self" >&6; }
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -12037,9 +12556,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -12069,7 +12588,7 @@ _LT_EOF
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -12090,9 +12609,9 @@ fi
 $as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -12136,7 +12655,7 @@ else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -12164,7 +12683,7 @@ fi
 
 
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
@@ -12172,13 +12691,13 @@ $as_echo "$can_build_shared" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
 $as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -12186,8 +12705,12 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
     ;;
 
   aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
     fi
     ;;
   esac
@@ -12197,7 +12720,7 @@ $as_echo "$enable_shared" >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
 $as_echo_n "checking whether to build static libraries... " >&6; }
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
 $as_echo "$enable_static" >&6; }
 
@@ -12211,11 +12734,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
+CC=$lt_save_CC
 
-      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
+      if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
   ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -12394,7 +12917,7 @@ objext_CXX=$objext
 # the CXX compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
+if test yes != "$_lt_caught_CXX_error"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="int some_variable = 0;"
 
@@ -12455,46 +12978,39 @@ $RM -r conftest*
   CFLAGS=$CXXFLAGS
   compiler=$CC
   compiler_CXX=$CC
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+  func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
 
 
   if test -n "$compiler"; then
     # We don't want -fno-exception when compiling C++ code, so set the
     # no_builtin_flag separately
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
     else
       lt_prog_compiler_no_builtin_flag_CXX=
     fi
 
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       # Set up default GNU C++ configuration
 
 
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
 else
   with_gnu_ld=no
 fi
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -12508,7 +13024,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -12519,7 +13035,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
@@ -12530,32 +13046,32 @@ if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi
 fi
 
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
@@ -12591,22 +13107,22 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      if test yes = "$with_gnu_ld"; then
+        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+        export_dynamic_flag_spec_CXX='$wl--export-dynamic'
 
         # If archive_cmds runs LD, not CC, wlarc should be empty
         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
+        wlarc='$wl'
 
         # ancient GNU ld didn't support --whole-archive et. al.
         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
 	  $GREP 'no-whole-archive' > /dev/null; then
-          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+          whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
         else
           whole_archive_flag_spec_CXX=
         fi
@@ -12643,18 +13159,30 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
         ld_shlibs_CXX=no
         ;;
       aix[4-9]*)
-        if test "$host_cpu" = ia64; then
+        if test ia64 = "$host_cpu"; then
           # On IA64, the linker does run time linking by default, so we don't
           # have to do anything special.
           aix_use_runtimelinking=no
           exp_sym_flag='-Bexport'
-          no_entry_flag=""
+          no_entry_flag=
         else
           aix_use_runtimelinking=no
 
           # Test if we are trying to use run time linking or normal
           # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
+          # have runtime linking enabled, and use it for executables.
+          # For shared libraries, we enable/disable runtime linking
+          # depending on the kind of the shared library created -
+          # when "with_aix_soname,aix_use_runtimelinking" is:
+          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "aix,yes"  lib.so          shared, rtl:yes, for executables
+          #            lib.a           static archive
+          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+          #            lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a(lib.so.V) shared, rtl:no
+          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a           static archive
           case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	    for ld_flag in $LDFLAGS; do
 	      case $ld_flag in
@@ -12664,6 +13192,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 	        ;;
 	      esac
 	    done
+	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	      # so we don't have lib.a shared libs to link our executables.
+	      # We have to force runtime linking in this case.
+	      aix_use_runtimelinking=yes
+	      LDFLAGS="$LDFLAGS -Wl,-brtl"
+	    fi
 	    ;;
           esac
 
@@ -12682,13 +13217,21 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
         hardcode_direct_absolute_CXX=yes
         hardcode_libdir_separator_CXX=':'
         link_all_deplibs_CXX=yes
-        file_list_spec_CXX='${wl}-f,'
+        file_list_spec_CXX='$wl-f,'
+        case $with_aix_soname,$aix_use_runtimelinking in
+        aix,*) ;;	# no import file
+        svr4,* | *,yes) # use import file
+          # The Import File defines what to hardcode.
+          hardcode_direct_CXX=no
+          hardcode_direct_absolute_CXX=no
+          ;;
+        esac
 
-        if test "$GXX" = yes; then
+        if test yes = "$GXX"; then
           case $host_os in aix4.[012]|aix4.[012].*)
           # We only want to do this on AIX 4.2 and lower, the check
           # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -12706,36 +13249,44 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 	  fi
           esac
           shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
 	  fi
+	  # Need to ensure runtime linking is disabled for the traditional
+	  # shared library, or the linker may eventually find shared libraries
+	  # /with/ Import File - we do not want to mix them.
+	  shared_flag_aix='-shared'
+	  shared_flag_svr4='-shared $wl-G'
         else
           # not using gcc
-          if test "$host_cpu" = ia64; then
+          if test ia64 = "$host_cpu"; then
 	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	  # chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
           else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
 	    else
-	      shared_flag='${wl}-bM:SRE'
+	      shared_flag='$wl-bM:SRE'
 	    fi
+	    shared_flag_aix='$wl-bM:SRE'
+	    shared_flag_svr4='$wl-G'
           fi
         fi
 
-        export_dynamic_flag_spec_CXX='${wl}-bexpall'
+        export_dynamic_flag_spec_CXX='$wl-bexpall'
         # It seems that -bexpall does not export symbols beginning with
         # underscore (_), so it is better to generate a list of symbols to
 	# export.
         always_export_symbols_CXX=yes
-        if test "$aix_use_runtimelinking" = yes; then
+	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
           # Warning - without using the other runtime loading flags (-brtl),
           # -berok will link without error, but may produce a broken library.
-          allow_undefined_flag_CXX='-berok'
+          # The "-G" linker flag allows undefined symbols.
+          no_undefined_flag_CXX='-bernotok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
-          if test "${lt_cv_aix_libpath+set}" = set; then
+          if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath__CXX+:} false; then :
@@ -12770,7 +13321,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath__CXX"; then
-    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+    lt_cv_aix_libpath__CXX=/usr/lib:/lib
   fi
 
 fi
@@ -12778,18 +13329,18 @@ fi
   aix_libpath=$lt_cv_aix_libpath__CXX
 fi
 
-          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+          hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
 
-          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
         else
-          if test "$host_cpu" = ia64; then
-	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+          if test ia64 = "$host_cpu"; then
+	    hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib'
 	    allow_undefined_flag_CXX="-z nodefs"
-	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
-	    if test "${lt_cv_aix_libpath+set}" = set; then
+	    if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath__CXX+:} false; then :
@@ -12824,7 +13375,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath__CXX"; then
-    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+    lt_cv_aix_libpath__CXX=/usr/lib:/lib
   fi
 
 fi
@@ -12832,22 +13383,34 @@ fi
   aix_libpath=$lt_cv_aix_libpath__CXX
 fi
 
-	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
-	    no_undefined_flag_CXX=' ${wl}-bernotok'
-	    allow_undefined_flag_CXX=' ${wl}-berok'
-	    if test "$with_gnu_ld" = yes; then
+	    no_undefined_flag_CXX=' $wl-bernotok'
+	    allow_undefined_flag_CXX=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
 	      # We only use this code for GNU lds that support --whole-archive.
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	      whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    else
 	      # Exported symbols can be pulled into shared objects from archives
 	      whole_archive_flag_spec_CXX='$convenience'
 	    fi
 	    archive_cmds_need_lc_CXX=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	    archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	    # -brtl affects multiple linker settings, -berok does not and is overridden later
+	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	    if test svr4 != "$with_aix_soname"; then
+	      # This is similar to how AIX traditionally builds its shared
+	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	    fi
+	    if test aix != "$with_aix_soname"; then
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_sy [...]
+	    else
+	      # used by -dlpreopen to get the symbols
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	    fi
+	    archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d'
           fi
         fi
         ;;
@@ -12857,7 +13420,7 @@ fi
 	  allow_undefined_flag_CXX=unsupported
 	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	  # support --undefined.  This deserves some investigation.  FIXME
-	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 	else
 	  ld_shlibs_CXX=no
 	fi
@@ -12885,57 +13448,58 @@ fi
 	  # Tell ltmain to make .lib files, not .a files.
 	  libext=lib
 	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=".dll"
+	  shrext_cmds=.dll
 	  # FIXME: Setting linknames here is a bad hack.
-	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	    else
-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	    fi~
-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	    linknames='
+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  archive_expsym_cmds_CXX='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
 	  # The linker will not automatically build a static lib if we build a DLL.
 	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
 	  enable_shared_with_static_runtimes_CXX=yes
 	  # Don't use ranlib
 	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
 	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-	    case $lt_outputfile in
-	      *.exe|*.EXE) ;;
-	      *)
-		lt_outputfile="$lt_outputfile.exe"
-		lt_tool_outputfile="$lt_tool_outputfile.exe"
-		;;
-	    esac~
-	    func_to_tool_file "$lt_outputfile"~
-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	      $RM "$lt_outputfile.manifest";
-	    fi'
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
 	  ;;
 	*)
 	  # g++
 	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
 	  # as there is no search path for DLLs.
 	  hardcode_libdir_flag_spec_CXX='-L$libdir'
-	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+	  export_dynamic_flag_spec_CXX='$wl--export-all-symbols'
 	  allow_undefined_flag_CXX=unsupported
 	  always_export_symbols_CXX=no
 	  enable_shared_with_static_runtimes_CXX=yes
 
 	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file (1st line
-	    # is EXPORTS), use it as is; otherwise, prepend...
-	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      cp $export_symbols $output_objdir/$soname.def;
-	    else
-	      echo EXPORTS > $output_objdir/$soname.def;
-	      cat $export_symbols >> $output_objdir/$soname.def;
-	    fi~
-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    archive_expsym_cmds_CXX='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	  else
 	    ld_shlibs_CXX=no
 	  fi
@@ -12949,27 +13513,27 @@ fi
   hardcode_direct_CXX=no
   hardcode_automatic_CXX=yes
   hardcode_shlibpath_var_CXX=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
     whole_archive_flag_spec_CXX=''
   fi
   link_all_deplibs_CXX=yes
-  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+  allow_undefined_flag_CXX=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+       if test yes != "$lt_cv_apple_cc_single_mod"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
     fi
 
   else
@@ -12978,6 +13542,34 @@ fi
 
 	;;
 
+      os2*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+	hardcode_minus_L_CXX=yes
+	allow_undefined_flag_CXX=unsupported
+	shrext_cmds=.dll
+	archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  prefix_cmds="$SED"~
+	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	    prefix_cmds="$prefix_cmds -e 1d";
+	  fi~
+	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+	enable_shared_with_static_runtimes_CXX=yes
+	;;
+
       dgux*)
         case $cc_basename in
           ec++*)
@@ -13013,14 +13605,14 @@ fi
         ;;
 
       haiku*)
-        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
         link_all_deplibs_CXX=yes
         ;;
 
       hpux9*)
-        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
         hardcode_libdir_separator_CXX=:
-        export_dynamic_flag_spec_CXX='${wl}-E'
+        export_dynamic_flag_spec_CXX='$wl-E'
         hardcode_direct_CXX=yes
         hardcode_minus_L_CXX=yes # Not in the search PATH,
 				             # but as the default
@@ -13032,7 +13624,7 @@ fi
             ld_shlibs_CXX=no
             ;;
           aCC*)
-            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             # Commands to make compiler produce verbose output that lists
             # what "hidden" libraries, object files and flags are used when
             # linking a shared library.
@@ -13041,11 +13633,11 @@ fi
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
-            if test "$GXX" = yes; then
-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            if test yes = "$GXX"; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               ld_shlibs_CXX=no
@@ -13055,15 +13647,15 @@ fi
         ;;
 
       hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        if test no = "$with_gnu_ld"; then
+	  hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
 	  hardcode_libdir_separator_CXX=:
 
           case $host_cpu in
             hppa*64*|ia64*)
               ;;
             *)
-	      export_dynamic_flag_spec_CXX='${wl}-E'
+	      export_dynamic_flag_spec_CXX='$wl-E'
               ;;
           esac
         fi
@@ -13089,13 +13681,13 @@ fi
           aCC*)
 	    case $host_cpu in
 	      hppa*64*)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      ia64*)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      *)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	    esac
 	    # Commands to make compiler produce verbose output that lists
@@ -13106,20 +13698,20 @@ fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
 	        case $host_cpu in
 	          hppa*64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -13134,22 +13726,22 @@ fi
       interix[3-9]*)
 	hardcode_direct_CXX=no
 	hardcode_shlibpath_var_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}-E'
+	hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='$wl-E'
 	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
 	# Instead, shared libraries are loaded at an image base (0x10000000 by
 	# default) and relocated if they conflict, which is a slow very memory
 	# consuming and fragmenting process.  To avoid this, we pick a random,
 	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
 	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
 	;;
       irix5* | irix6*)
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -13158,17 +13750,17 @@ fi
 	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	      else
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
 	      fi
 	    fi
 	    link_all_deplibs_CXX=yes
 	    ;;
         esac
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
         hardcode_libdir_separator_CXX=:
         inherit_rpath_CXX=yes
         ;;
@@ -13181,8 +13773,8 @@ fi
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
 	    # Commands to make compiler produce verbose output that lists
 	    # what "hidden" libraries, object files and flags are used when
 	    # linking a shared library.
@@ -13191,10 +13783,10 @@ fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
@@ -13208,59 +13800,59 @@ fi
 	    # earlier do not add the objects themselves.
 	    case `$CC -V 2>&1` in
 	      *"Version 7."*)
-	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	      *)  # Version 8.0 or newer
 	        tmp_idyn=
 	        case $host_cpu in
 		  ia64*) tmp_idyn=' -i_dynamic';;
 		esac
-	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	    esac
 	    archive_cmds_need_lc_CXX=no
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    ;;
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
 	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
 	      prelink_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      old_archive_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-		$RANLIB $oldlib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
 	      archive_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
-	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    esac
 
-	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	    hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
-	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
 
 	    runpath_var=LD_RUN_PATH
 	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
@@ -13274,18 +13866,18 @@ fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
 	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
 	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
 	    fi
 	    ;;
 	  *)
@@ -13293,10 +13885,10 @@ fi
 	    *Sun\ C*)
 	      # Sun C++ 5.9
 	      no_undefined_flag_CXX=' -zdefs'
-	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
 	      hardcode_libdir_flag_spec_CXX='-R$libdir'
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	      compiler_needs_object_CXX=yes
 
 	      # Not sure whether something based on
@@ -13354,22 +13946,17 @@ fi
         ld_shlibs_CXX=yes
 	;;
 
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	ld_shlibs_CXX=no
-	;;
-
-      openbsd*)
+      openbsd* | bitrig*)
 	if test -f /usr/libexec/ld.so; then
 	  hardcode_direct_CXX=yes
 	  hardcode_shlibpath_var_CXX=no
 	  hardcode_direct_absolute_CXX=yes
 	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    export_dynamic_flag_spec_CXX='${wl}-E'
-	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    export_dynamic_flag_spec_CXX='$wl-E'
+	    whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
 	  fi
 	  output_verbose_link_cmd=func_echo_all
 	else
@@ -13385,9 +13972,9 @@ fi
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
 	    hardcode_libdir_separator_CXX=:
 
 	    # Archives containing C++ object files must be created using
@@ -13405,17 +13992,17 @@ fi
           cxx*)
 	    case $host in
 	      osf3*)
-	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	        allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
+	        archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
 		;;
 	      *)
 	        allow_undefined_flag_CXX=' -expect_unresolved \*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
 	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
 		;;
 	    esac
@@ -13430,21 +14017,21 @@ fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
 	      case $host in
 	        osf3*)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	        *)
-	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	      esac
 
-	      hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	      hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
 	      hardcode_libdir_separator_CXX=:
 
 	      # Commands to make compiler produce verbose output that lists
@@ -13490,9 +14077,9 @@ fi
 	    # Sun C++ 4.2, 5.x and Centerline C++
             archive_cmds_need_lc_CXX=yes
 	    no_undefined_flag_CXX=' -zdefs'
-	    archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	    hardcode_libdir_flag_spec_CXX='-R$libdir'
 	    hardcode_shlibpath_var_CXX=no
@@ -13500,7 +14087,7 @@ fi
 	      solaris2.[0-5] | solaris2.[0-5].*) ;;
 	      *)
 		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
+		# but understands '-z linker_flag'.
 	        # Supported since Solaris 2.6 (maybe 2.5.1?)
 		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
 	        ;;
@@ -13517,30 +14104,30 @@ fi
 	    ;;
           gcx*)
 	    # Green Hills C++ Compiler
-	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 
 	    # The C++ compiler must be used to create the archive.
 	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 	    ;;
           *)
 	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      no_undefined_flag_CXX=' $wl-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
 	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
 	        # platform.
-	        archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
@@ -13548,11 +14135,11 @@ fi
 	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
-	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	      hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
 	      case $host_os in
 		solaris2.[0-5] | solaris2.[0-5].*) ;;
 		*)
-		  whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 		  ;;
 	      esac
 	    fi
@@ -13561,52 +14148,52 @@ fi
         ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_CXX='${wl}-z,text'
+      no_undefined_flag_CXX='$wl-z,text'
       archive_cmds_need_lc_CXX=no
       hardcode_shlibpath_var_CXX=no
       runpath_var='LD_RUN_PATH'
 
       case $cc_basename in
         CC*)
-	  archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
       esac
       ;;
 
       sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
+	# Note: We CANNOT use -z defs as we might desire, because we do not
 	# link with -lc, and that would cause any symbols used from libc to
 	# always be unresolved, which means just about no library would
 	# ever link correctly.  If we're not using GNU ld we use -z text
 	# though, which does catch some bad symbols but isn't as heavy-handed
 	# as -z defs.
-	no_undefined_flag_CXX='${wl}-z,text'
-	allow_undefined_flag_CXX='${wl}-z,nodefs'
+	no_undefined_flag_CXX='$wl-z,text'
+	allow_undefined_flag_CXX='$wl-z,nodefs'
 	archive_cmds_need_lc_CXX=no
 	hardcode_shlibpath_var_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+	hardcode_libdir_flag_spec_CXX='$wl-R,$libdir'
 	hardcode_libdir_separator_CXX=':'
 	link_all_deplibs_CXX=yes
-	export_dynamic_flag_spec_CXX='${wl}-Bexport'
+	export_dynamic_flag_spec_CXX='$wl-Bexport'
 	runpath_var='LD_RUN_PATH'
 
 	case $cc_basename in
           CC*)
-	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
-	      '"$old_archive_cmds_CXX"
+              '"$old_archive_cmds_CXX"
 	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
-	      '"$reload_cmds_CXX"
+              '"$reload_cmds_CXX"
 	    ;;
 	  *)
-	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    ;;
 	esac
       ;;
@@ -13638,10 +14225,10 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
 $as_echo "$ld_shlibs_CXX" >&6; }
-    test "$ld_shlibs_CXX" = no && can_build_shared=no
+    test no = "$ld_shlibs_CXX" && can_build_shared=no
 
-    GCC_CXX="$GXX"
-    LD_CXX="$LD"
+    GCC_CXX=$GXX
+    LD_CXX=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -13685,13 +14272,13 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
+    case $prev$p in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
        # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
 	 prev=$p
 	 continue
        fi
@@ -13707,16 +14294,16 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
        case $p in
        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
        esac
-       if test "$pre_test_object_deps_done" = no; then
-	 case ${prev} in
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
 	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
 	   if test -z "$compiler_lib_search_path_CXX"; then
-	     compiler_lib_search_path_CXX="${prev}${p}"
+	     compiler_lib_search_path_CXX=$prev$p
 	   else
-	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p"
 	   fi
 	   ;;
 	 # The "-l" case would never come before the object being
@@ -13724,9 +14311,9 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
 	 esac
        else
 	 if test -z "$postdeps_CXX"; then
-	   postdeps_CXX="${prev}${p}"
+	   postdeps_CXX=$prev$p
 	 else
-	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+	   postdeps_CXX="${postdeps_CXX} $prev$p"
 	 fi
        fi
        prev=
@@ -13741,15 +14328,15 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
 	 continue
        fi
 
-       if test "$pre_test_object_deps_done" = no; then
+       if test no = "$pre_test_object_deps_done"; then
 	 if test -z "$predep_objects_CXX"; then
-	   predep_objects_CXX="$p"
+	   predep_objects_CXX=$p
 	 else
 	   predep_objects_CXX="$predep_objects_CXX $p"
 	 fi
        else
 	 if test -z "$postdep_objects_CXX"; then
-	   postdep_objects_CXX="$p"
+	   postdep_objects_CXX=$p
 	 else
 	   postdep_objects_CXX="$postdep_objects_CXX $p"
 	 fi
@@ -13779,51 +14366,6 @@ interix[3-9]*)
   postdep_objects_CXX=
   postdeps_CXX=
   ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
 esac
 
 
@@ -13832,7 +14374,7 @@ case " $postdeps_CXX " in
 esac
  compiler_lib_search_dirs_CXX=
 if test -n "${compiler_lib_search_path_CXX}"; then
- compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'`
 fi
 
 
@@ -13871,17 +14413,18 @@ lt_prog_compiler_static_CXX=
 
 
   # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
+  if test yes = "$GXX"; then
     lt_prog_compiler_wl_CXX='-Wl,'
     lt_prog_compiler_static_CXX='-static'
 
     case $host_os in
     aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static_CXX='-Bstatic'
       fi
+      lt_prog_compiler_pic_CXX='-fPIC'
       ;;
 
     amigaos*)
@@ -13892,8 +14435,8 @@ lt_prog_compiler_static_CXX=
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -13908,6 +14451,11 @@ lt_prog_compiler_static_CXX=
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static_CXX='$wl-static'
+	;;
+      esac
       ;;
     darwin* | rhapsody*)
       # PIC is the default on this platform
@@ -13957,7 +14505,7 @@ lt_prog_compiler_static_CXX=
     case $host_os in
       aix[4-9]*)
 	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	  # AIX 5 now supports IA64 processor
 	  lt_prog_compiler_static_CXX='-Bstatic'
 	else
@@ -13997,14 +14545,14 @@ lt_prog_compiler_static_CXX=
 	case $cc_basename in
 	  CC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
+	    lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
 	      lt_prog_compiler_pic_CXX='+Z'
 	    fi
 	    ;;
 	  aCC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
 	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
@@ -14041,7 +14589,7 @@ lt_prog_compiler_static_CXX=
 	    lt_prog_compiler_pic_CXX='-fPIC'
 	    ;;
 	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    # old Intel C++ for x86_64, which still supported -KPIC.
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-static'
@@ -14186,7 +14734,7 @@ lt_prog_compiler_static_CXX=
   fi
 
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_CXX=
     ;;
@@ -14218,7 +14766,7 @@ else
   lt_cv_prog_compiler_pic_works_CXX=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -14248,7 +14796,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
 
-if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
     case $lt_prog_compiler_pic_CXX in
      "" | " "*) ;;
      *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
@@ -14274,7 +14822,7 @@ if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works_CXX=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -14293,13 +14841,13 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
 
-if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
     :
 else
     lt_prog_compiler_static_CXX=
@@ -14413,8 +14961,8 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
 
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -14426,9 +14974,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
@@ -14445,17 +14993,21 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   case $host_os in
   aix[4-9]*)
     # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
+    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+    # Without the "-l" option, or with the "-B" option, AIX nm treats
+    # weak defined symbols like other global defined symbols, whereas
+    # GNU nm marks them as "W".
+    # While the 'weak' keyword is ignored in the Export File, we need
+    # it in the Import File for the 'aix-soname' feature, so we have
+    # to replace the "-B" option with "-P" for AIX nm.
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
     else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
-    export_symbols_cmds_CXX="$ltdll_cmds"
+    export_symbols_cmds_CXX=$ltdll_cmds
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
@@ -14478,7 +15030,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
 $as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
+test no = "$ld_shlibs_CXX" && can_build_shared=no
 
 with_gnu_ld_CXX=$with_gnu_ld
 
@@ -14495,7 +15047,7 @@ x|xyes)
   # Assume -lc should be added
   archive_cmds_need_lc_CXX=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $archive_cmds_CXX in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -14623,7 +15175,7 @@ $as_echo_n "checking dynamic linker characteristics... " >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -14640,14 +15192,16 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[4-9]*)
@@ -14655,41 +15209,91 @@ aix[4-9]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a(lib.so.V)'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -14699,18 +15303,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -14718,8 +15322,8 @@ beos*)
 bsdi[45]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -14731,7 +15335,7 @@ bsdi[45]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -14740,8 +15344,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -14757,16 +15361,16 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
 
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -14775,8 +15379,8 @@ cygwin* | mingw* | pw32* | cegcc*)
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -14803,7 +15407,7 @@ cygwin* | mingw* | pw32* | cegcc*)
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -14816,8 +15420,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -14830,7 +15434,7 @@ cygwin* | mingw* | pw32* | cegcc*)
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -14843,8 +15447,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -14856,8 +15460,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -14875,12 +15479,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -14910,10 +15515,10 @@ haiku*)
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -14931,14 +15536,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -14946,8 +15552,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -14956,8 +15562,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -14970,8 +15576,8 @@ interix[3-9]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -14982,7 +15588,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -14990,8 +15596,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -15010,8 +15616,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -15020,13 +15626,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec_CXX='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -15070,7 +15696,12 @@ fi
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -15102,12 +15733,12 @@ netbsd*)
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -15117,7 +15748,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -15126,58 +15757,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -15188,8 +15829,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -15199,11 +15840,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -15211,8 +15852,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -15233,24 +15874,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -15268,7 +15909,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -15276,8 +15917,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -15287,20 +15928,32 @@ uts4*)
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
 
 
 
@@ -15343,15 +15996,15 @@ $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
 hardcode_action_CXX=
 if test -n "$hardcode_libdir_flag_spec_CXX" ||
    test -n "$runpath_var_CXX" ||
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+   test yes = "$hardcode_automatic_CXX"; then
 
   # We can hardcode non-existent directories.
-  if test "$hardcode_direct_CXX" != no &&
+  if test no != "$hardcode_direct_CXX" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" &&
+     test no != "$hardcode_minus_L_CXX"; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action_CXX=relink
   else
@@ -15366,12 +16019,12 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
 $as_echo "$hardcode_action_CXX" >&6; }
 
-if test "$hardcode_action_CXX" = relink ||
-   test "$inherit_rpath_CXX" = yes; then
+if test relink = "$hardcode_action_CXX" ||
+   test yes = "$inherit_rpath_CXX"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -15394,7 +16047,7 @@ fi
   lt_cv_path_LD=$lt_save_path_LD
   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
+fi # test yes != "$_lt_caught_CXX_error"
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -15793,6 +16446,51 @@ if test "x$ac_cv_lib_gomp_omp_get_num_threads" = xyes; then :
   GOMPFOUND=1
 fi
 
+ac_fn_c_check_header_mongrel "$LINENO" "dxflib/dl_dxf.h" "ac_cv_header_dxflib_dl_dxf_h" "$ac_includes_default"
+if test "x$ac_cv_header_dxflib_dl_dxf_h" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DL_ArcData in -llibdxf" >&5
+$as_echo_n "checking for DL_ArcData in -llibdxf... " >&6; }
+if ${ac_cv_lib_libdxf_DL_ArcData+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llibdxf  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char DL_ArcData ();
+int
+main ()
+{
+return DL_ArcData ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_libdxf_DL_ArcData=yes
+else
+  ac_cv_lib_libdxf_DL_ArcData=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_libdxf_DL_ArcData" >&5
+$as_echo "$ac_cv_lib_libdxf_DL_ArcData" >&6; }
+if test "x$ac_cv_lib_libdxf_DL_ArcData" = xyes; then :
+  LIBDXFFOUND=1
+fi
+
+fi
+
+
 
 # Checks for header files.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
@@ -17213,6 +17911,205 @@ $as_echo "        libgomp not found, OpenMP support disabled" >&6; }
 
 
 
+
+# gdal
+
+
+# Check whether --with-gdal was given.
+if test "${with_gdal+set}" = set; then :
+  withval=$with_gdal; ac_gdal_config_path=$withval
+else
+  gdal_config_system=check
+fi
+
+
+        if test "x$gdal_config_system" = xcheck; then :
+  # Extract the first word of "gdal-config", so it can be a program name with args.
+set dummy gdal-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GDAL_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GDAL_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GDAL_CONFIG="$GDAL_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GDAL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+GDAL_CONFIG=$ac_cv_path_GDAL_CONFIG
+if test -n "$GDAL_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDAL_CONFIG" >&5
+$as_echo "$GDAL_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+else
+  # Extract the first word of "gdal-config", so it can be a program name with args.
+set dummy gdal-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GDAL_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GDAL_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GDAL_CONFIG="$GDAL_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in `dirname $ac_gdal_config_path 2> /dev/null`
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GDAL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_GDAL_CONFIG" && ac_cv_path_GDAL_CONFIG="no"
+  ;;
+esac
+fi
+GDAL_CONFIG=$ac_cv_path_GDAL_CONFIG
+if test -n "$GDAL_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDAL_CONFIG" >&5
+$as_echo "$GDAL_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+fi
+
+    if test ! -x "$GDAL_CONFIG"; then
+        as_fn_error $? "gdal-config does not exist or it is not an exectuable file" "$LINENO" 5
+            GDAL_CONFIG="no"
+            found_gdal="no"
+    fi
+
+    GDAL_VERSION=""
+    GDAL_CFLAGS=""
+    GDAL_LDFLAGS=""
+    GDAL_DEP_LDFLAGS=""
+    GDAL_OGR_ENABLED=""
+
+
+
+    if test "$GDAL_CONFIG" != "no"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GDAL library" >&5
+$as_echo_n "checking for GDAL library... " >&6; }
+
+        GDAL_VERSION="`$GDAL_CONFIG --version`"
+        GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
+        GDAL_LDFLAGS="`$GDAL_CONFIG --libs`"
+        GDAL_DEP_LDFLAGS="`$GDAL_CONFIG --dep-libs`"
+
+
+$as_echo "#define HAVE_GDAL 1" >>confdefs.h
+
+
+        found_gdal="yes"
+    else
+        found_gdal="no"
+    fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_gdal" >&5
+$as_echo "$found_gdal" >&6; }
+
+    if test "$found_gdal" = "yes"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OGR support in GDAL library" >&5
+$as_echo_n "checking for OGR support in GDAL library... " >&6; }
+
+        GDAL_OGR_ENABLED="`$GDAL_CONFIG --ogr-enabled`"
+
+$as_echo "#define HAVE_GDAL_OGR 1" >>confdefs.h
+
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDAL_OGR_ENABLED" >&5
+$as_echo "$GDAL_OGR_ENABLED" >&6; }
+    fi
+
+
+    gdal_version_req=1.7
+    if test "$found_gdal" = "yes" -a -n "$gdal_version_req"; then
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GDAL version is >= $gdal_version_req" >&5
+$as_echo_n "checking if GDAL version is >= $gdal_version_req... " >&6; }
+
+                        gdal_version_req_major=`expr $gdal_version_req : '\([0-9]*\)'`
+        gdal_version_req_minor=`expr $gdal_version_req : '[0-9]*\.\([0-9]*\)'`
+        gdal_version_req_micro=`expr $gdal_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+        if test "x$gdal_version_req_micro" = "x"; then
+            gdal_version_req_micro="0"
+        fi
+
+        gdal_version_req_number=`expr $gdal_version_req_major \* 1000000 \
+                                   \+ $gdal_version_req_minor \* 1000 \
+                                   \+ $gdal_version_req_micro`
+
+                        gdal_version_major=`expr $GDAL_VERSION : '\([0-9]*\)'`
+        gdal_version_minor=`expr $GDAL_VERSION : '[0-9]*\.\([0-9]*\)'`
+        gdal_version_micro=`expr $GDAL_VERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+        if test "x$gdal_version_micro" = "x"; then
+            gdal_version_micro="0"
+        fi
+
+        gdal_version_number=`expr $gdal_version_major \* 1000000 \
+                                   \+ $gdal_version_minor \* 1000 \
+                                   \+ $gdal_version_micro`
+
+        gdal_version_check=`expr $gdal_version_number \>\= $gdal_version_req_number`
+        if test "$gdal_version_check" = "1"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+        else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	    as_fn_error $? "GDAL $GDAL_VERSION found, but required version is $gdal_version_req" "$LINENO" 5
+        fi
+    fi
+
+
+
+
+
+
+
+if test `echo $GDAL_VERSION|cut -d. -f1` -ge 2; then
+  GDAL2FLAGS="-DUSE_GDAL_V2"
+else
+   GDAL2FLAGS=""
+fi
+
+
 # Check whether --enable-triangle was given.
 if test "${enable_triangle+set}" = set; then :
   enableval=$enable_triangle;
@@ -17307,6 +18204,25 @@ if test "x$use_libfire" != xyes; then
 $as_echo "        Libfire disabled" >&6; }
 fi
 
+
+
+# Check whether --with-system_dxflib was given.
+if test "${with_system_dxflib+set}" = set; then :
+  withval=$with_system_dxflib; { $as_echo "$as_me:${as_lineno-$LINENO}: result:         using system libdxf" >&5
+$as_echo "        using system libdxf" >&6; }
+else
+  system_libdxf=true
+fi
+
+ if test -n "$LIBDXFFOUND" -a x$system_libdxf=xtrue; then
+  SYSTEM_DXFLIB_TRUE=
+  SYSTEM_DXFLIB_FALSE='#'
+else
+  SYSTEM_DXFLIB_TRUE='#'
+  SYSTEM_DXFLIB_FALSE=
+fi
+
+
 #AM_CONDITIONAL(X86_64, test "`uname -m`" = "x86_64")
      if test -n "$CVFOUND"; then
   HAVE_CV_TRUE=
@@ -18248,6 +19164,10 @@ if test -z "${LIBFIRE_TRUE}" && test -z "${LIBFIRE_FALSE}"; then
   as_fn_error $? "conditional \"LIBFIRE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${SYSTEM_DXFLIB_TRUE}" && test -z "${SYSTEM_DXFLIB_FALSE}"; then
+  as_fn_error $? "conditional \"SYSTEM_DXFLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_CV_TRUE}" && test -z "${HAVE_CV_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_CV\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -18665,7 +19585,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by saga $as_me 2.2.7, which was
+This file was extended by saga $as_me 2.3.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -18731,7 +19651,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-saga config.status 2.2.7
+saga config.status 2.3.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -18866,6 +19786,7 @@ enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
@@ -18915,10 +19836,13 @@ compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
@@ -18983,7 +19907,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
@@ -19088,9 +20013,12 @@ CFLAGS \
 compiler \
 lt_cv_sys_global_symbol_pipe \
 lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
 lt_cv_sys_global_symbol_to_c_name_address \
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
 nm_file_list_spec \
+lt_cv_truncate_bin \
 lt_prog_compiler_no_builtin_flag \
 lt_prog_compiler_pic \
 lt_prog_compiler_wl \
@@ -19156,7 +20084,7 @@ postdeps_CXX \
 compiler_lib_search_path_CXX; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -19183,7 +20111,8 @@ postinstall_cmds \
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path \
 reload_cmds_CXX \
 old_archive_cmds_CXX \
 old_archive_from_new_cmds_CXX \
@@ -19197,7 +20126,7 @@ prelink_cmds_CXX \
 postlink_cmds_CXX; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -19206,19 +20135,16 @@ postlink_cmds_CXX; do
 done
 
 ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
 
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
 
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'
 
@@ -20025,55 +20951,53 @@ $as_echo X"$file" |
  ;;
     "libtool":C)
 
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
 #
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 # The names of the tagged configurations supported by this script.
-available_tags="CXX "
+available_tags='CXX '
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
 
 # ### BEGIN LIBTOOL CONFIG
 
@@ -20093,6 +21017,9 @@ pic_mode=$pic_mode
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
 
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
 # Shell to use when invoking shell scripts.
 SHELL=$lt_SHELL
 
@@ -20210,18 +21137,27 @@ global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 # Transform the output of nm in a proper C declaration.
 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
 # Transform the output of nm in a C name address pair.
 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
 # Transform the output of nm in a C name address pair when lib prefix is needed.
 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
 # Specify filename containing input files for \$NM.
 nm_file_list_spec=$lt_nm_file_list_spec
 
-# The root where to search for dependent libraries,and in which our libraries should be installed.
+# The root where to search for dependent libraries,and where our libraries should be installed.
 lt_sysroot=$lt_sysroot
 
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
 # The name of the directory that contains temporary libtool files.
 objdir=$objdir
 
@@ -20312,8 +21248,11 @@ hardcode_into_libs=$hardcode_into_libs
 # Compile-time system search path for libraries.
 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
 
 # Whether dlopen is supported.
 dlopen_support=$enable_dlopen
@@ -20406,13 +21345,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=$hardcode_direct
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
 # library is relocated.
 hardcode_direct_absolute=$hardcode_direct_absolute
 
@@ -20478,13 +21417,72 @@ compiler_lib_search_path=$lt_compiler_lib_search_path
 
 _LT_EOF
 
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -20493,7 +21491,7 @@ _LT_EOF
   esac
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 
   # We use sed instead of cat because bash on DJGPP gets confused if
@@ -20503,165 +21501,6 @@ ltmain="$ac_aux_dir/ltmain.sh"
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  if test x"$xsi_shell" = xyes; then
-  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\    # positional parameters, so assign one to ordinary parameter first.\
-\    func_stripname_result=${3}\
-\    func_stripname_result=${func_stripname_result#"${1}"}\
-\    func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\    func_split_long_opt_name=${1%%=*}\
-\    func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\    func_split_short_opt_arg=${1#??}\
-\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\    case ${1} in\
-\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\      *)    func_lo2o_result=${1} ;;\
-\    esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
-    func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
-    func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
-    func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
-    eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\    func_quote_for_eval "${2}"\
-\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
@@ -20748,13 +21587,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=$hardcode_direct_CXX
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
 # library is relocated.
 hardcode_direct_absolute=$hardcode_direct_absolute_CXX
 
diff --git a/configure.ac b/configure.ac
index 1809589..46d18ea 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,9 @@
-# $Id: configure.ac 2878 2016-03-31 13:28:31Z oconrad $
+# $Id$
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT(saga, 2.2.7, BUG-REPORT-ADDRESS)
+AC_INIT(saga, 2.3.0, BUG-REPORT-ADDRESS)
 AC_CONFIG_SRCDIR([src/saga_core/saga_gui/wksp_data_menu_files.cpp])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])
@@ -26,6 +26,7 @@ AC_CHECK_LIB([odbc], [SQLFetch], ODBCFOUND=1,[ODBC \(libodbc\) library not found
 AC_CHECK_LIB([proj], [pj_is_latlong], PROJFOUND=1,,)
 AC_CHECK_LIB([vigraimpex], [VIGRA_RGBE_ReadPixels_Raw],VIGRAFOUND=1,)
 AC_CHECK_LIB([gomp], [omp_get_num_threads], GOMPFOUND=1,,)
+AC_CHECK_HEADER([dxflib/dl_dxf.h],[AC_CHECK_LIB(libdxf,DL_ArcData,LIBDXFFOUND=1)])
 
 # Checks for header files.
 AC_HEADER_STDC
@@ -164,6 +165,16 @@ AC_ARG_ENABLE(openmp,
 
 AC_SUBST(GOMPFLAGS)
 
+
+# gdal
+AX_LIB_GDAL([1.7])
+if test `echo $GDAL_VERSION|cut -d. -f1` -ge 2; then
+  GDAL2FLAGS="-DUSE_GDAL_V2"
+else
+   GDAL2FLAGS=""
+fi
+AC_SUBST(GDAL2FLAGS)
+
 AC_ARG_ENABLE(triangle,
         AS_HELP_STRING([--disable-triangle],[ Compile without triangle.c (only free for non-commercial usage), and use qhull instead (requires qhull)]),
 	,
@@ -188,6 +199,14 @@ if test "x$use_libfire" != xyes; then
     AC_MSG_RESULT([        Libfire disabled])
 fi
 
+
+AC_ARG_WITH(system_dxflib,
+    AS_HELP_STRING([--with-system-dxflib],[Use system version of dxflib instead of embedded copy, requires this library (and the header files)]),
+    AC_MSG_RESULT([        using system libdxf]),
+    system_libdxf=true,
+    )
+AM_CONDITIONAL(SYSTEM_DXFLIB, test -n "$LIBDXFFOUND" -a x$system_libdxf=xtrue)
+
 #AM_CONDITIONAL(X86_64, test "`uname -m`" = "x86_64")
     AM_CONDITIONAL(HAVE_CV, test -n "$CVFOUND")
     AM_CONDITIONAL(HAVE_LLAS, test -n "$LASFOUND")
diff --git a/depcomp b/depcomp
index 4ebd5b3..fc98710 100755
--- a/depcomp
+++ b/depcomp
@@ -3,7 +3,7 @@
 
 scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/install-sh b/install-sh
index 377bb86..59990a1 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2014-09-12.12; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
 # This script is compatible with the BSD install script, but was written
 # from scratch.
 
+tab='	'
 nl='
 '
-IFS=" ""	$nl"
+IFS=" $tab$nl"
 
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
 
-# Don't use :- since 4.3BSD and earlier shells don't like it.
 doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
 
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
 rmprog=${RMPROG-rm}
 stripprog=${STRIPPROG-strip}
 
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
 posix_mkdir=
 
 # Desired mode of installed file.
@@ -97,7 +82,7 @@ dir_arg=
 dst_arg=
 
 copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
 
 usage="\
 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -137,46 +122,57 @@ while test $# -ne 0; do
     -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-	shift;;
+        shift;;
 
     --help) echo "$usage"; exit $?;;
 
     -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
 
     -o) chowncmd="$chownprog $2"
-	shift;;
+        shift;;
 
     -s) stripcmd=$stripprog;;
 
-    -t) dst_arg=$2
-	# Protect names problematic for 'test' and other utilities.
-	case $dst_arg in
-	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
-	esac
-	shift;;
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
 
-    -T) no_target_directory=true;;
+    -T) is_target_a_directory=never;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    --)	shift
-	break;;
+    --) shift
+        break;;
 
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
 
     *)  break;;
   esac
   shift
 done
 
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
@@ -208,6 +204,15 @@ if test $# -eq 0; then
 fi
 
 if test -z "$dir_arg"; then
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
   do_exit='(exit $ret); exit $ret'
   trap "ret=129; $do_exit" 1
   trap "ret=130; $do_exit" 2
@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then
 
     *[0-7])
       if test -z "$stripcmd"; then
-	u_plus_rw=
+        u_plus_rw=
       else
-	u_plus_rw='% 200'
+        u_plus_rw='% 200'
       fi
       cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
     *)
       if test -z "$stripcmd"; then
-	u_plus_rw=
+        u_plus_rw=
       else
-	u_plus_rw=,u+rw
+        u_plus_rw=,u+rw
       fi
       cp_umask=$mode$u_plus_rw;;
   esac
@@ -269,41 +274,15 @@ do
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
-	exit 1
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
       fi
       dstdir=$dst
       dst=$dstdir/`basename "$src"`
       dstdir_status=0
     else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
+      dstdir=`dirname "$dst"`
       test -d "$dstdir"
       dstdir_status=$?
     fi
@@ -314,74 +293,81 @@ do
   if test $dstdir_status != 0; then
     case $posix_mkdir in
       '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            # $RANDOM is not portable (e.g. dash);  use it when possible to
+            # lower collision chance
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
+            # create the $tmpdir first (and fail if unsuccessful) to make sure
+            # that nobody tries to guess the $tmpdir name.
+            if (umask $mkdir_umask &&
+                $mkdirprog $mkdir_mode "$tmpdir" &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   test_tmpdir="$tmpdir/a"
+                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
     esac
 
     if
       $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
       )
     then :
     else
@@ -391,53 +377,51 @@ do
       # directory the slow way, step by step, checking for races as we go.
 
       case $dstdir in
-	/*) prefix='/';;
-	[-=\(\)!]*) prefix='./';;
-	*)  prefix='';;
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
       esac
 
-      eval "$initialize_posix_glob"
-
       oIFS=$IFS
       IFS=/
-      $posix_glob set -f
+      set -f
       set fnord $dstdir
       shift
-      $posix_glob set +f
+      set +f
       IFS=$oIFS
 
       prefixes=
 
       for d
       do
-	test X"$d" = X && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
       done
 
       if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
       fi
     fi
   fi
@@ -472,15 +456,12 @@ do
 
     # If -C, don't bother to copy if it wouldn't change the file.
     if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
        set X $old && old=:$2:$4:$5:$6 &&
        set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
+       set +f &&
        test "$old" = "$new" &&
        $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
     then
@@ -493,24 +474,24 @@ do
       # to itself, or perhaps because mv is so ancient that it does not
       # support -f.
       {
-	# Now remove or move aside any old file at destination location.
-	# We try this two ways since rm can't unlink itself on some
-	# systems and the destination file might be busy for other
-	# reasons.  In this case, the final cleanup might fail but the new
-	# file should still install successfully.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
       }
     fi || exit 1
 
diff --git a/ltmain.sh b/ltmain.sh
index a356aca..147d758 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,9 +1,12 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+##               by inline-source v2014-01-03.01
 
-# libtool (GNU libtool) 2.4.2
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
 # Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -23,881 +26,2112 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#       --config             show all configuration variables
-#       --debug              enable verbose shell tracing
-#   -n, --dry-run            display commands without modifying any files
-#       --features           display basic configuration information and exit
-#       --mode=MODE          use operation mode MODE
-#       --preserve-dup-deps  don't remove duplicate dependency libraries
-#       --quiet, --silent    don't print informational messages
-#       --no-quiet, --no-silent
-#                            print informational messages (default)
-#       --no-warn            don't display warning messages
-#       --tag=TAG            use configuration variables from tag TAG
-#   -v, --verbose            print more informational messages than default
-#       --no-verbose         don't print the extra informational messages
-#       --version            print version information
-#   -h, --help, --help-all   print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-#         clean              remove files from the build directory
-#         compile            compile a source file into a libtool object
-#         execute            automatically set library path, then run a program
-#         finish             complete the installation of libtool libraries
-#         install            install libraries or executables
-#         link               create a library or an executable
-#         uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.  When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#         host-triplet:	$host
-#         shell:		$SHELL
-#         compiler:		$LTCC
-#         compiler flags:		$LTCFLAGS
-#         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
-#         automake:	$automake_version
-#         autoconf:	$autoconf_version
-#
-# Report bugs to <bug-libtool at gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
-TIMESTAMP=""
-package_revision=1.3337
+VERSION="2.4.6 Debian-2.4.6-0.1"
+package_revision=2.4.6
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
 
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+	  export $_G_var
+	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
 	fi"
 done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
 
-$lt_unset CDPATH
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp	$nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
 
 
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+    test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+    _G_progs_list=$1
+    _G_check_func=$2
+    _G_PATH=${3-"$PATH"}
+
+    _G_path_prog_max=0
+    _G_path_prog_found=false
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+    for _G_dir in $_G_PATH; do
+      IFS=$_G_save_IFS
+      test -z "$_G_dir" && _G_dir=.
+      for _G_prog_name in $_G_progs_list; do
+        for _exeext in '' .EXE; do
+          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+          func_executable_p "$_G_path_prog" || continue
+          case `"$_G_path_prog" --version 2>&1` in
+            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+            *)     $_G_check_func $_G_path_prog
+		   func_path_progs_result=$func_check_prog_result
+		   ;;
+          esac
+          $_G_path_prog_found && break 3
+        done
+      done
+    done
+    IFS=$_G_save_IFS
+    test -z "$func_path_progs_result" && {
+      echo "no acceptable sed could be found in \$PATH" >&2
+      exit 1
+    }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+  for _G_i in 1 2 3 4 5 6 7; do
+    _G_sed_script=$_G_sed_script$nl$_G_sed_script
+  done
+  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+  _G_sed_script=
+
+  func_check_prog_sed ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo '' >> conftest.nl
+      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  rm -f conftest.sed
+  SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+  func_check_prog_grep ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    _G_path_prog_max=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo 'GREP' >> conftest.nl
+      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
 
 : ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
 
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
 
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-} # func_dirname may be replaced by extended shell implementation
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
 
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
 
-# func_basename file
-func_basename ()
-{
-    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
 
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-    # Extract subdirectory from the argument.
-    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
 
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion.  Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+  s/$_G_bs4/&\\
+/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+  s/\n//g"
 
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-    case ${2} in
-      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-    esac
-} # func_stripname may be replaced by extended shell implementation
 
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
 
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
-		s@/\./@/@g
-		t dotsl
-		s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
 
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-#             value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
-  # Start from root dir and reassemble the path.
-  func_normal_abspath_result=
-  func_normal_abspath_tpath=$1
-  func_normal_abspath_altnamespace=
-  case $func_normal_abspath_tpath in
-    "")
-      # Empty path, that just means $cwd.
-      func_stripname '' '/' "`pwd`"
-      func_normal_abspath_result=$func_stripname_result
-      return
-    ;;
-    # The next three entries are used to spot a run of precisely
-    # two leading slashes without using negated character classes;
-    # we take advantage of case's first-match behaviour.
-    ///*)
-      # Unusual form of absolute path, do nothing.
-    ;;
-    //*)
-      # Not necessarily an ordinary path; POSIX reserves leading '//'
-      # and for example Cygwin uses it to access remote file shares
-      # over CIFS/SMB, so we conserve a leading double slash if found.
-      func_normal_abspath_altnamespace=/
-    ;;
-    /*)
-      # Absolute path, do nothing.
-    ;;
-    *)
-      # Relative path, prepend $cwd.
-      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-    ;;
-  esac
-  # Cancel out all the simple stuff to save iterations.  We also want
-  # the path to end with a slash for ease of parsing, so make sure
-  # there is one (and only one) here.
-  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
-  while :; do
-    # Processed it all yet?
-    if test "$func_normal_abspath_tpath" = / ; then
-      # If we ascended to the root using ".." the result may be empty now.
-      if test -z "$func_normal_abspath_result" ; then
-        func_normal_abspath_result=/
-      fi
-      break
-    fi
-    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcar"`
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcdr"`
-    # Figure out what to do with it
-    case $func_normal_abspath_tcomponent in
-      "")
-        # Trailing empty path component, ignore it.
-      ;;
-      ..)
-        # Parent dir; strip last assembled component from result.
-        func_dirname "$func_normal_abspath_result"
-        func_normal_abspath_result=$func_dirname_result
-      ;;
-      *)
-        # Actual path component, append it.
-        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
-      ;;
-    esac
-  done
-  # Restore leading double-slash if one was found on entry.
-  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
 
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-#             value returned in "$func_relative_path_result"
-func_relative_path ()
-{
-  func_relative_path_result=
-  func_normal_abspath "$1"
-  func_relative_path_tlibdir=$func_normal_abspath_result
-  func_normal_abspath "$2"
-  func_relative_path_tbindir=$func_normal_abspath_result
-
-  # Ascend the tree starting from libdir
-  while :; do
-    # check if we have found a prefix of bindir
-    case $func_relative_path_tbindir in
-      $func_relative_path_tlibdir)
-        # found an exact match
-        func_relative_path_tcancelled=
-        break
-        ;;
-      $func_relative_path_tlibdir*)
-        # found a matching prefix
-        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-        func_relative_path_tcancelled=$func_stripname_result
-        if test -z "$func_relative_path_result"; then
-          func_relative_path_result=.
-        fi
-        break
-        ;;
-      *)
-        func_dirname $func_relative_path_tlibdir
-        func_relative_path_tlibdir=${func_dirname_result}
-        if test "x$func_relative_path_tlibdir" = x ; then
-          # Have to descend all the way to the root!
-          func_relative_path_result=../$func_relative_path_result
-          func_relative_path_tcancelled=$func_relative_path_tbindir
-          break
-        fi
-        func_relative_path_result=../$func_relative_path_result
-        ;;
-    esac
-  done
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
 
-  # Now calculate path; take care to avoid doubling-up slashes.
-  func_stripname '' '/' "$func_relative_path_result"
-  func_relative_path_result=$func_stripname_result
-  func_stripname '/' '/' "$func_relative_path_tcancelled"
-  if test "x$func_stripname_result" != x ; then
-    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
-  fi
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
 
-  # Normalisation. If bindir is libdir, return empty string,
-  # else relative path ending with a slash; either way, target
-  # file name can be directly appended.
-  if test ! -z "$func_relative_path_result"; then
-    func_stripname './' '' "$func_relative_path_result/"
-    func_relative_path_result=$func_stripname_result
-  fi
-}
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
 
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
 
-# Make sure we have an absolute path for reexecution:
+# Make sure we have an absolute progpath for reexecution:
 case $progpath in
   [\\/]*|[A-Za-z]:\\*) ;;
   *[\\/]*)
-     progdir=$func_dirname_result
+     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
      progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
+     progpath=$progdir/$progname
      ;;
   *)
-     save_IFS="$IFS"
+     _G_IFS=$IFS
      IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
-       IFS="$save_IFS"
+       IFS=$_G_IFS
        test -x "$progdir/$progname" && break
      done
-     IFS="$save_IFS"
+     IFS=$_G_IFS
      test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
+     progpath=$progdir/$progname
      ;;
 esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
 
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
-  s/$bs4/&\\
-/g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
-  s/\n//g"
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
 
-# Standard options:
 opt_dry_run=false
-opt_help=false
 opt_quiet=false
 opt_verbose=false
-opt_warning=:
 
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
 
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
 
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
 
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
 
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
 
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
-    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
 
-    # bash bug again:
-    :
-}
 
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
 {
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset=''
+        tc_bold='';   tc_standout=''
+        tc_red='';   tc_green=''
+        tc_blue='';  tc_cyan=''
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
 
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
+    require_term_colors=:
 }
-help="Try \`$progname --help' for more information."  ## default
 
 
-# func_grep expression filename
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+    $debug_cmd
+
+    eval _G_current_value='`$ECHO $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+    $debug_cmd
+
+    '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
 # Check whether EXPRESSION matches any line of FILENAME, without output.
 func_grep ()
 {
+    $debug_cmd
+
     $GREP "$1" "$2" >/dev/null 2>&1
 }
 
 
-# func_mkdir_p directory-path
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
 # Make sure the entire path to DIRECTORY-PATH is available.
 func_mkdir_p ()
 {
-    my_directory_path="$1"
-    my_dir_list=
+    $debug_cmd
 
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+    _G_directory_path=$1
+    _G_dir_list=
 
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
       esac
 
       # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
+      while test ! -d "$_G_directory_path"; do
         # ...make a list in topmost first order.  Use a colon delimited
 	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
+        _G_dir_list=$_G_directory_path:$_G_dir_list
 
         # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
+        case $_G_directory_path in */*) ;; *) break ;; esac
 
         # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
       done
-      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
 
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+	IFS=$func_mkdir_p_IFS
+        # mkdir can fail with a 'File exist' error if two processes
         # try to create one of the directories concurrently.  Don't
         # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
+        $MKDIR "$_G_dir" 2>/dev/null || :
       done
-      IFS="$save_mkdir_p_IFS"
+      IFS=$func_mkdir_p_IFS
 
       # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
     fi
 }
 
 
-# func_mktempdir [string]
+# func_mktempdir [BASENAME]
+# -------------------------
 # Make a temporary directory that won't clash with other running
 # libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
+# given, BASENAME is the basename for that directory.
 func_mktempdir ()
 {
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
+    $debug_cmd
+
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
 
-    if test "$opt_dry_run" = ":"; then
+    if test : = "$opt_dry_run"; then
       # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
+      _G_tmpdir=$_G_template-$$
     else
 
       # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
 
-      if test ! -d "$my_tmpdir"; then
+      if test ! -d "$_G_tmpdir"; then
         # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
 
-        save_mktempdir_umask=`umask`
+        func_mktempdir_umask=`umask`
         umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
       fi
 
       # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+    fi
+
+    $ECHO "$_G_tmpdir"
+}
+
+
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
+{
+    $debug_cmd
+
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+		s|/\./|/|g
+		t dotsl
+		s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # Start from root dir and reassemble the path.
+    func_normal_abspath_result=
+    func_normal_abspath_tpath=$1
+    func_normal_abspath_altnamespace=
+    case $func_normal_abspath_tpath in
+      "")
+        # Empty path, that just means $cwd.
+        func_stripname '' '/' "`pwd`"
+        func_normal_abspath_result=$func_stripname_result
+        return
+        ;;
+      # The next three entries are used to spot a run of precisely
+      # two leading slashes without using negated character classes;
+      # we take advantage of case's first-match behaviour.
+      ///*)
+        # Unusual form of absolute path, do nothing.
+        ;;
+      //*)
+        # Not necessarily an ordinary path; POSIX reserves leading '//'
+        # and for example Cygwin uses it to access remote file shares
+        # over CIFS/SMB, so we conserve a leading double slash if found.
+        func_normal_abspath_altnamespace=/
+        ;;
+      /*)
+        # Absolute path, do nothing.
+        ;;
+      *)
+        # Relative path, prepend $cwd.
+        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+        ;;
+    esac
+
+    # Cancel out all the simple stuff to save iterations.  We also want
+    # the path to end with a slash for ease of parsing, so make sure
+    # there is one (and only one) here.
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+    while :; do
+      # Processed it all yet?
+      if test / = "$func_normal_abspath_tpath"; then
+        # If we ascended to the root using ".." the result may be empty now.
+        if test -z "$func_normal_abspath_result"; then
+          func_normal_abspath_result=/
+        fi
+        break
+      fi
+      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcdr"`
+      # Figure out what to do with it
+      case $func_normal_abspath_tcomponent in
+        "")
+          # Trailing empty path component, ignore it.
+          ;;
+        ..)
+          # Parent dir; strip last assembled component from result.
+          func_dirname "$func_normal_abspath_result"
+          func_normal_abspath_result=$func_dirname_result
+          ;;
+        *)
+          # Actual path component, append it.
+          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+          ;;
+      esac
+    done
+    # Restore leading double-slash if one was found on entry.
+    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+    $debug_cmd
+
+    $opt_quiet || func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+    $debug_cmd
+
+    func_relative_path_result=
+    func_normal_abspath "$1"
+    func_relative_path_tlibdir=$func_normal_abspath_result
+    func_normal_abspath "$2"
+    func_relative_path_tbindir=$func_normal_abspath_result
+
+    # Ascend the tree starting from libdir
+    while :; do
+      # check if we have found a prefix of bindir
+      case $func_relative_path_tbindir in
+        $func_relative_path_tlibdir)
+          # found an exact match
+          func_relative_path_tcancelled=
+          break
+          ;;
+        $func_relative_path_tlibdir*)
+          # found a matching prefix
+          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+          func_relative_path_tcancelled=$func_stripname_result
+          if test -z "$func_relative_path_result"; then
+            func_relative_path_result=.
+          fi
+          break
+          ;;
+        *)
+          func_dirname $func_relative_path_tlibdir
+          func_relative_path_tlibdir=$func_dirname_result
+          if test -z "$func_relative_path_tlibdir"; then
+            # Have to descend all the way to the root!
+            func_relative_path_result=../$func_relative_path_result
+            func_relative_path_tcancelled=$func_relative_path_tbindir
+            break
+          fi
+          func_relative_path_result=../$func_relative_path_result
+          ;;
+      esac
+    done
+
+    # Now calculate path; take care to avoid doubling-up slashes.
+    func_stripname '' '/' "$func_relative_path_result"
+    func_relative_path_result=$func_stripname_result
+    func_stripname '/' '/' "$func_relative_path_tcancelled"
+    if test -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
+    fi
+
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
     fi
 
-    $ECHO "$my_tmpdir"
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
+    :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
+func_quote_for_eval ()
+{
+    $debug_cmd
+
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+	  ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+	func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    $debug_cmd
+
+    case $1 in
+      *[\\\`\"]*)
+	_G_arg=`$ECHO "$1" | $SED \
+	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        _G_arg=$1 ;;
+    esac
+
+    case $_G_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        _G_arg=\"$_G_arg\"
+        ;;
+    esac
+
+    func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    $opt_dry_run || {
+      eval "$_G_user_locale
+	    $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $debug_cmd
+
+    $opt_verbose && func_echo "$*"
+
+    :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    printf '%s\n%s\n' "$1" "$2" \
+      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false.  Use it like this:
+#
+#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+    $debug_cmd
+
+    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next 'cmd' execution.
+      eval _G_hook_result=\$${_G_hook}_result
+      eval set dummy "$_G_hook_result"; shift
+    done
+
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_options_prep_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_silent_option_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_option_validation_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+    $debug_cmd
+
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
+
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
+
+    # save modified positional parameters for caller
+    func_options_result=$func_run_hooks_result
 }
 
 
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
 {
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
+    $debug_cmd
 
-    case $func_quote_for_eval_unquoted_result in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
-        ;;
-      *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
-    esac
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
+
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
 }
 
 
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
 {
-    case $1 in
-      *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        my_arg="$1" ;;
-    esac
+    $debug_cmd
 
-    case $my_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
-        ;;
-    esac
+    func_parse_options_result=
 
-    func_quote_for_expand_result="$my_arg"
-}
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
 
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy "$func_run_hooks_result"; shift
 
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+		      ;;
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+	# Separate optargs to long options (plugins may need this):
+	--*=*)        func_split_equals "$_G_opt"
+	              set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
 }
 
 
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
+    func_run_hooks func_validate_options ${1+"$@"}
 
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
-  case $1 in
-  [0-9]* | *[!a-zA-Z0-9_]*)
-    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-    ;;
-  * )
-    func_tr_sh_result=$1
-    ;;
-  esac
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
 }
 
 
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $opt_debug
 
-    $SED -n '/(C)/!b go
-	:more
-	/\./!{
-	  N
-	  s/\n# / /
-	  b more
-	}
-	:go
-	/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
-}
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
 
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
+    eval \$ECHO \""Usage: $usage"\"
+    eval \$ECHO \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
 }
 
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
 func_help ()
 {
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-	:print
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
-	p
-	d
-     }
-     /^# .* home page:/b print
-     /^# General help using/b print
-     ' < "$progpath"
-    ret=$?
-    if test -z "$1"; then
-      exit $ret
-    fi
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message"
+    exit 0
 }
 
-# func_missing_arg argname
+
+# func_missing_arg ARGNAME
+# ------------------------
 # Echo program name prefixed message to standard error and set global
 # exit_cmd.
 func_missing_arg ()
 {
-    $opt_debug
+    $debug_cmd
 
-    func_error "missing argument for $1."
+    func_error "Missing argument for '$1'."
     exit_cmd=exit
 }
 
 
-# func_split_short_opt shortopt
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
 # Set func_split_short_opt_name and func_split_short_opt_arg shell
 # variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
 {
-    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
-    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+    $debug_cmd
 
-    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
-    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
+    func_usage_message
+    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
 
 
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
 {
-    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
-    my_sed_long_arg='1s/^--[^=]*=//'
+    $debug_cmd
 
-    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
-    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
+    eval \$ECHO \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+	h
+	/^Written by/q' < "$progpath"
+    echo
+    eval \$ECHO \""$usage_message"\"
+}
 
-exit_cmd=:
 
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
 
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
 
+    exit $?
+}
 
 
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
 
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
 
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
 
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
 {
-    eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
+    $debug_cmd
 
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
-    func_quote_for_eval "${2}"
-    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
+    _G_message=$*
 
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
 
-# func_arith arithmetic-term...
-func_arith ()
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
 {
-    func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
+    $debug_cmd
 
+    $warning_func ${1+"$@"}
+}
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
 
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --config             show all configuration variables
+       --debug              enable verbose shell tracing
+   -n, --dry-run            display commands without modifying any files
+       --features           display basic configuration information and exit
+       --mode=MODE          use operation mode MODE
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
 
-# func_lo2o object
-func_lo2o ()
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
 {
-    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message
+
+MODE must be one of the following:
+
+       clean           remove files from the build directory
+       compile         compile a source file into a libtool object
+       execute         automatically set library path, then run a program
+       finish          complete the installation of libtool libraries
+       install         install libraries or executables
+       link            create a library or an executable
+       uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+       host-triplet:   $host
+       shell:          $SHELL
+       compiler:       $LTCC
+       compiler flags: $LTCFLAGS
+       linker:         $LD (gnu? $with_gnu_ld)
+       version:        $progname (GNU libtool) 2.4.6
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool at gnu.org>.
+GNU libtool home page: <http://www.gnu.org/s/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+    exit 0
+}
 
 
-# func_xform libobj-or-source
-func_xform ()
-{
-    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
+    func_xform_result=${1%.*}.lo
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
 
 
-# func_fatal_configuration arg...
+# func_fatal_configuration ARG...
+# -------------------------------
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
 func_fatal_configuration ()
 {
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
+    func__fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "Fatal configuration error."
 }
 
 
 # func_config
+# -----------
 # Display the configuration for all the tags in this script.
 func_config ()
 {
@@ -915,17 +2149,19 @@ func_config ()
     exit $?
 }
 
+
 # func_features
+# -------------
 # Display the features supported by this script.
 func_features ()
 {
     echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       echo "enable shared libraries"
     else
       echo "disable shared libraries"
     fi
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       echo "enable static libraries"
     else
       echo "disable static libraries"
@@ -934,314 +2170,350 @@ func_features ()
     exit $?
 }
 
-# func_enable_tag tagname
+
+# func_enable_tag TAGNAME
+# -----------------------
 # Verify that TAGNAME is valid, and either flag an error and exit, or
 # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
 # variable here.
 func_enable_tag ()
 {
-  # Global variable:
-  tagname="$1"
+    # Global variable:
+    tagname=$1
 
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+    sed_extractcf=/$re_begincf/,/$re_endcf/p
 
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
+    # Validate tagname.
+    case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+        func_fatal_error "invalid tag name: $tagname"
+        ;;
+    esac
 
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
+    # Don't test for the "default" C tag, as we know it's
+    # there but not specially marked.
+    case $tagname in
+        CC) ;;
     *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
-
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
+        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	  taglist="$taglist $tagname"
+
+	  # Evaluate the configuration.  Be careful to quote the path
+	  # and the sed script, to avoid splitting on whitespace, but
+	  # also don't use non-portable quotes within backquotes within
+	  # quotes we have to do it in 2 steps:
+	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	  eval "$extractedcf"
+        else
+	  func_error "ignoring unknown tag $tagname"
+        fi
+        ;;
+    esac
 }
 
+
 # func_check_version_match
+# ------------------------
 # Ensure that we are using m4 macros, and libtool script from the same
 # release of libtool.
 func_check_version_match ()
 {
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
+    if test "$package_revision" != "$macro_revision"; then
+      if test "$VERSION" != "$macro_version"; then
+        if test -z "$macro_version"; then
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from an older release.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      else
-        cat >&2 <<_LT_EOF
+        else
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
+        fi
+      else
+        cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
 $progname: of $PACKAGE $VERSION and run autoconf again.
 _LT_EOF
-    fi
+      fi
 
-    exit $EXIT_MISMATCH
-  fi
+      exit $EXIT_MISMATCH
+    fi
 }
 
 
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
-  shift; set dummy --mode clean ${1+"$@"}; shift
-  ;;
-compile|compil|compi|comp|com|co|c)
-  shift; set dummy --mode compile ${1+"$@"}; shift
-  ;;
-execute|execut|execu|exec|exe|ex|e)
-  shift; set dummy --mode execute ${1+"$@"}; shift
-  ;;
-finish|finis|fini|fin|fi|f)
-  shift; set dummy --mode finish ${1+"$@"}; shift
-  ;;
-install|instal|insta|inst|ins|in|i)
-  shift; set dummy --mode install ${1+"$@"}; shift
-  ;;
-link|lin|li|l)
-  shift; set dummy --mode link ${1+"$@"}; shift
-  ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-  shift; set dummy --mode uninstall ${1+"$@"}; shift
-  ;;
-esac
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+    $debug_mode
 
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
 
+    nonopt=
+    preserve_args=
 
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
+    # Shorthand for --mode=foo, only valid as the first argument
+    case $1 in
+    clean|clea|cle|cl)
+      shift; set dummy --mode clean ${1+"$@"}; shift
+      ;;
+    compile|compil|compi|comp|com|co|c)
+      shift; set dummy --mode compile ${1+"$@"}; shift
+      ;;
+    execute|execut|execu|exec|exe|ex|e)
+      shift; set dummy --mode execute ${1+"$@"}; shift
+      ;;
+    finish|finis|fini|fin|fi|f)
+      shift; set dummy --mode finish ${1+"$@"}; shift
+      ;;
+    install|instal|insta|inst|ins|in|i)
+      shift; set dummy --mode install ${1+"$@"}; shift
+      ;;
+    link|lin|li|l)
+      shift; set dummy --mode link ${1+"$@"}; shift
+      ;;
+    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+      shift; set dummy --mode uninstall ${1+"$@"}; shift
+      ;;
+    esac
+
+    # Pass back the list of options.
+    func_quote_for_eval ${1+"$@"}
+    libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
 
 
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
 {
-  # this just eases exit handling
-  while test $# -gt 0; do
-    opt="$1"
-    shift
-    case $opt in
-      --debug|-x)	opt_debug='set -x'
-			func_echo "enabling shell trace mode"
-			$opt_debug
-			;;
-      --dry-run|--dryrun|-n)
-			opt_dry_run=:
-			;;
-      --config)
-			opt_config=:
-func_config
-			;;
-      --dlopen|-dlopen)
-			optarg="$1"
-			opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
-			shift
-			;;
-      --preserve-dup-deps)
-			opt_preserve_dup_deps=:
-			;;
-      --features)
-			opt_features=:
-func_features
-			;;
-      --finish)
-			opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
-			;;
-      --help)
-			opt_help=:
-			;;
-      --help-all)
-			opt_help_all=:
-opt_help=': help-all'
-			;;
-      --mode)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_mode="$optarg"
-case $optarg in
-  # Valid mode arguments:
-  clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-  # Catch anything else as an error
-  *) func_error "invalid argument for $opt"
-     exit_cmd=exit
-     break
-     ;;
-esac
-			shift
-			;;
-      --no-silent|--no-quiet)
-			opt_silent=false
-func_append preserve_args " $opt"
-			;;
-      --no-warning|--no-warn)
-			opt_warning=false
-func_append preserve_args " $opt"
-			;;
-      --no-verbose)
-			opt_verbose=false
-func_append preserve_args " $opt"
-			;;
-      --silent|--quiet)
-			opt_silent=:
-func_append preserve_args " $opt"
-        opt_verbose=false
-			;;
-      --verbose|-v)
-			opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
-			;;
-      --tag)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
-			shift
-			;;
-
-      -\?|-h)		func_usage				;;
-      --help)		func_help				;;
-      --version)	func_version				;;
-
-      # Separate optargs to long options:
-      --*=*)
-			func_split_long_opt "$opt"
-			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      # Separate non-argument short options:
-      -\?*|-h*|-n*|-v*)
-			func_split_short_opt "$opt"
-			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      --)		break					;;
-      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
-    esac
-  done
+    $debug_cmd
 
-  # Validate options:
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+	# An option not handled by this hook function:
+        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+      esac
+    done
 
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
 
-  # preserve --debug
-  test "$opt_debug" = : || func_append preserve_args " --debug"
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
 
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-      ;;
-  esac
 
-  $opt_help || {
-    # Sanity checks first:
-    func_check_version_match
 
-    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-      func_fatal_configuration "not configured to build any kind of library"
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
     fi
 
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
 
-    # Only execute mode is allowed to have -dlopen flags.
-    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-      func_error "unrecognized option \`-dlopen'"
-      $ECHO "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    case $host in
+      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+        # don't eliminate duplications in $postdeps and $predeps
+        opt_duplicate_compiler_generated_deps=:
+        ;;
+      *)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
+    esac
 
-    # Change the help message to a mode-specific one.
-    generic_help="$help"
-    help="Try \`$progname --help --mode=$opt_mode' for more information."
-  }
+    $opt_help || {
+      # Sanity checks first:
+      func_check_version_match
+
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
+
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+        func_error "unrecognized option '-dlopen'"
+        $ECHO "$help" 1>&2
+        exit $EXIT_FAILURE
+      fi
 
+      # Change the help message to a mode-specific one.
+      generic_help=$help
+      help="Try '$progname --help --mode=$opt_mode' for more information."
+    }
 
-  # Bail if the options were screwed
-  $exit_cmd $EXIT_FAILURE
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
 }
+func_add_hook func_validate_options libtool_validate_options
 
 
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
 
 
 ## ----------- ##
 ##    Main.    ##
 ## ----------- ##
 
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
 # func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function is only a basic sanity check; it will hardly flush out
 # determined imposters.
 func_lalib_p ()
 {
     test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null \
-        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function implements the same check as func_lalib_p without
 # resorting to external programs.  To this end, it redirects stdin and
 # closes it afterwards, without saving the original file descriptor.
 # As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
+# fatal anyway.  Works if 'file' does not exist.
 func_lalib_unsafe_p ()
 {
     lalib_p=no
@@ -1249,13 +2521,13 @@ func_lalib_unsafe_p ()
 	for lalib_p_l in 1 2 3 4
 	do
 	    read lalib_p_line
-	    case "$lalib_p_line" in
+	    case $lalib_p_line in
 		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
 	    esac
 	done
 	exec 0<&5 5<&-
     fi
-    test "$lalib_p" = yes
+    test yes = "$lalib_p"
 }
 
 # func_ltwrapper_script_p file
@@ -1264,7 +2536,8 @@ func_lalib_unsafe_p ()
 # determined imposters.
 func_ltwrapper_script_p ()
 {
-    func_lalib_p "$1"
+    test -f "$1" &&
+      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_ltwrapper_executable_p file
@@ -1289,7 +2562,7 @@ func_ltwrapper_scriptname ()
 {
     func_dirname_and_basename "$1" "" "."
     func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
 }
 
 # func_ltwrapper_p file
@@ -1308,11 +2581,13 @@ func_ltwrapper_p ()
 # FAIL_CMD may read-access the current command in variable CMD!
 func_execute_cmds ()
 {
-    $opt_debug
+    $debug_cmd
+
     save_ifs=$IFS; IFS='~'
     for cmd in $1; do
-      IFS=$save_ifs
+      IFS=$sp$nl
       eval cmd=\"$cmd\"
+      IFS=$save_ifs
       func_show_eval "$cmd" "${2-:}"
     done
     IFS=$save_ifs
@@ -1324,10 +2599,11 @@ func_execute_cmds ()
 # Note that it is not necessary on cygwin/mingw to append a dot to
 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
 # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
+# 'FILE.' does not work on cygwin managed mounts.
 func_source ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $1 in
     */* | *\\*)	. "$1" ;;
     *)		. "./$1" ;;
@@ -1354,10 +2630,10 @@ func_resolve_sysroot ()
 # store the result into func_replace_sysroot_result.
 func_replace_sysroot ()
 {
-  case "$lt_sysroot:$1" in
+  case $lt_sysroot:$1 in
   ?*:"$lt_sysroot"*)
     func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
+    func_replace_sysroot_result='='$func_stripname_result
     ;;
   *)
     # Including no sysroot.
@@ -1374,7 +2650,8 @@ func_replace_sysroot ()
 # arg is usually of the form 'gcc ...'
 func_infer_tag ()
 {
-    $opt_debug
+    $debug_cmd
+
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -1393,7 +2670,7 @@ func_infer_tag ()
 	for z in $available_tags; do
 	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
@@ -1418,7 +2695,7 @@ func_infer_tag ()
 	# line option must be used.
 	if test -z "$tagname"; then
 	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
+	  func_fatal_error "specify a tag with '--tag'"
 #	else
 #	  func_verbose "using $tagname tagged configuration"
 	fi
@@ -1434,15 +2711,15 @@ func_infer_tag ()
 # but don't create it if we're doing a dry run.
 func_write_libtool_object ()
 {
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
+    write_libobj=$1
+    if test yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
     else
       write_lobj=none
     fi
 
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
+    if test yes = "$build_old_libs"; then
+      write_oldobj=\'$3\'
     else
       write_oldobj=none
     fi
@@ -1450,7 +2727,7 @@ func_write_libtool_object ()
     $opt_dry_run || {
       cat >${write_libobj}T <<EOF
 # $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -1462,7 +2739,7 @@ pic_object=$write_lobj
 non_pic_object=$write_oldobj
 
 EOF
-      $MV "${write_libobj}T" "${write_libobj}"
+      $MV "${write_libobj}T" "$write_libobj"
     }
 }
 
@@ -1482,8 +2759,9 @@ EOF
 # be empty on error (or when ARG is empty)
 func_convert_core_file_wine_to_w32 ()
 {
-  $opt_debug
-  func_convert_core_file_wine_to_w32_result="$1"
+  $debug_cmd
+
+  func_convert_core_file_wine_to_w32_result=$1
   if test -n "$1"; then
     # Unfortunately, winepath does not exit with a non-zero error code, so we
     # are forced to check the contents of stdout. On the other hand, if the
@@ -1491,9 +2769,9 @@ func_convert_core_file_wine_to_w32 ()
     # *an error message* to stdout. So we must check for both error code of
     # zero AND non-empty stdout, which explains the odd construction:
     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
+        $SED -e "$sed_naive_backslashify"`
     else
       func_convert_core_file_wine_to_w32_result=
     fi
@@ -1514,18 +2792,19 @@ func_convert_core_file_wine_to_w32 ()
 # are convertible, then the result may be empty.
 func_convert_core_path_wine_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=""
+  func_convert_core_path_wine_to_w32_result=
   if test -n "$1"; then
     oldIFS=$IFS
     IFS=:
     for func_convert_core_path_wine_to_w32_f in $1; do
       IFS=$oldIFS
       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+      if test -n "$func_convert_core_file_wine_to_w32_result"; then
         if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
         else
           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
         fi
@@ -1554,7 +2833,8 @@ func_convert_core_path_wine_to_w32 ()
 # environment variable; do not put it in $PATH.
 func_cygpath ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     if test "$?" -ne 0; then
@@ -1563,7 +2843,7 @@ func_cygpath ()
     fi
   else
     func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
   fi
 }
 #end: func_cygpath
@@ -1574,10 +2854,11 @@ func_cygpath ()
 # result in func_convert_core_msys_to_w32_result.
 func_convert_core_msys_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # awkward: cmd appends spaces to result
   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
 }
 #end: func_convert_core_msys_to_w32
 
@@ -1588,13 +2869,14 @@ func_convert_core_msys_to_w32 ()
 # func_to_host_file_result to ARG1).
 func_convert_file_check ()
 {
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
+  $debug_cmd
+
+  if test -z "$2" && test -n "$1"; then
     func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
+    func_error "  '$1'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback:
-    func_to_host_file_result="$1"
+    func_to_host_file_result=$1
   fi
 }
 # end func_convert_file_check
@@ -1606,10 +2888,11 @@ func_convert_file_check ()
 # func_to_host_file_result to a simplistic fallback value (see below).
 func_convert_path_check ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$4" && test -n "$3"; then
     func_error "Could not determine the host path corresponding to"
-    func_error "  \`$3'"
+    func_error "  '$3'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback.  This is a deliberately simplistic "conversion" and
     # should not be "improved".  See libtool.info.
@@ -1618,7 +2901,7 @@ func_convert_path_check ()
       func_to_host_path_result=`echo "$3" |
         $SED -e "$lt_replace_pathsep_chars"`
     else
-      func_to_host_path_result="$3"
+      func_to_host_path_result=$3
     fi
   fi
 }
@@ -1630,9 +2913,10 @@ func_convert_path_check ()
 # and appending REPL if ORIG matches BACKPAT.
 func_convert_path_front_back_pathsep ()
 {
-  $opt_debug
+  $debug_cmd
+
   case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+  $1 ) func_to_host_path_result=$3$func_to_host_path_result
     ;;
   esac
   case $4 in
@@ -1646,7 +2930,7 @@ func_convert_path_front_back_pathsep ()
 ##################################################
 # $build to $host FILE NAME CONVERSION FUNCTIONS #
 ##################################################
-# invoked via `$to_host_file_cmd ARG'
+# invoked via '$to_host_file_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # Result will be available in $func_to_host_file_result.
@@ -1657,7 +2941,8 @@ func_convert_path_front_back_pathsep ()
 # in func_to_host_file_result.
 func_to_host_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   $to_host_file_cmd "$1"
 }
 # end func_to_host_file
@@ -1669,7 +2954,8 @@ func_to_host_file ()
 # in (the comma separated) LAZY, no conversion takes place.
 func_to_tool_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   case ,$2, in
     *,"$to_tool_file_cmd",*)
       func_to_tool_file_result=$1
@@ -1687,7 +2973,7 @@ func_to_tool_file ()
 # Copy ARG to func_to_host_file_result.
 func_convert_file_noop ()
 {
-  func_to_host_file_result="$1"
+  func_to_host_file_result=$1
 }
 # end func_convert_file_noop
 
@@ -1698,11 +2984,12 @@ func_convert_file_noop ()
 # func_to_host_file_result.
 func_convert_file_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result=$func_convert_core_msys_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1714,8 +3001,9 @@ func_convert_file_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_file_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     # LT_CYGPATH in this case.
@@ -1731,11 +3019,12 @@ func_convert_file_cygwin_to_w32 ()
 # and a working winepath. Returns result in func_to_host_file_result.
 func_convert_file_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1747,12 +3036,13 @@ func_convert_file_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_file_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
     func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1765,13 +3055,14 @@ func_convert_file_msys_to_cygwin ()
 # in func_to_host_file_result.
 func_convert_file_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
     func_convert_core_file_wine_to_w32 "$1"
     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1781,7 +3072,7 @@ func_convert_file_nix_to_cygwin ()
 #############################################
 # $build to $host PATH CONVERSION FUNCTIONS #
 #############################################
-# invoked via `$to_host_path_cmd ARG'
+# invoked via '$to_host_path_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # The result will be available in $func_to_host_path_result.
@@ -1805,10 +3096,11 @@ func_convert_file_nix_to_cygwin ()
 to_host_path_cmd=
 func_init_to_host_path_cmd ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$to_host_path_cmd"; then
     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+    to_host_path_cmd=func_convert_path_$func_stripname_result
   fi
 }
 
@@ -1818,7 +3110,8 @@ func_init_to_host_path_cmd ()
 # in func_to_host_path_result.
 func_to_host_path ()
 {
-  $opt_debug
+  $debug_cmd
+
   func_init_to_host_path_cmd
   $to_host_path_cmd "$1"
 }
@@ -1829,7 +3122,7 @@ func_to_host_path ()
 # Copy ARG to func_to_host_path_result.
 func_convert_path_noop ()
 {
-  func_to_host_path_result="$1"
+  func_to_host_path_result=$1
 }
 # end func_convert_path_noop
 
@@ -1840,8 +3133,9 @@ func_convert_path_noop ()
 # func_to_host_path_result.
 func_convert_path_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from ARG.  MSYS
     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -1849,7 +3143,7 @@ func_convert_path_msys_to_w32 ()
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result=$func_convert_core_msys_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1863,8 +3157,9 @@ func_convert_path_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_path_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
@@ -1883,14 +3178,15 @@ func_convert_path_cygwin_to_w32 ()
 # a working winepath.  Returns result in func_to_host_file_result.
 func_convert_path_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1904,15 +3200,16 @@ func_convert_path_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_path_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1927,8 +3224,9 @@ func_convert_path_msys_to_cygwin ()
 # func_to_host_file_result.
 func_convert_path_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from
     # ARG. msys behavior is inconsistent here, cygpath turns them
@@ -1937,7 +3235,7 @@ func_convert_path_nix_to_cygwin ()
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1946,13 +3244,31 @@ func_convert_path_nix_to_cygwin ()
 # end func_convert_path_nix_to_cygwin
 
 
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[	 ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
 # func_mode_compile arg...
 func_mode_compile ()
 {
-    $opt_debug
+    $debug_cmd
+
     # Get the compilation command and the source file.
     base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
     suppress_opt=yes
     suppress_output=
     arg_mode=normal
@@ -1965,12 +3281,12 @@ func_mode_compile ()
       case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
+	lastarg=$arg
 	arg_mode=normal
 	;;
 
       target )
-	libobj="$arg"
+	libobj=$arg
 	arg_mode=normal
 	continue
 	;;
@@ -1980,7 +3296,7 @@ func_mode_compile ()
 	case $arg in
 	-o)
 	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
+	    func_fatal_error "you cannot specify '-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
@@ -2009,12 +3325,12 @@ func_mode_compile ()
 	  func_stripname '-Wc,' '' "$arg"
 	  args=$func_stripname_result
 	  lastarg=
-	  save_ifs="$IFS"; IFS=','
+	  save_ifs=$IFS; IFS=,
 	  for arg in $args; do
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 	    func_append_quoted lastarg "$arg"
 	  done
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
@@ -2027,8 +3343,8 @@ func_mode_compile ()
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
+	  lastarg=$srcfile
+	  srcfile=$arg
 	  ;;
 	esac  #  case $arg
 	;;
@@ -2043,13 +3359,13 @@ func_mode_compile ()
       func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      func_fatal_error "you must specify a target with \`-o'"
+      func_fatal_error "you must specify a target with '-o'"
       ;;
     *)
       # Get the name of the library object.
       test -z "$libobj" && {
 	func_basename "$srcfile"
-	libobj="$func_basename_result"
+	libobj=$func_basename_result
       }
       ;;
     esac
@@ -2069,7 +3385,7 @@ func_mode_compile ()
     case $libobj in
     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      func_fatal_error "cannot determine name of library object from '$libobj'"
       ;;
     esac
 
@@ -2078,8 +3394,8 @@ func_mode_compile ()
     for arg in $later; do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes = "$build_libtool_libs" \
+	  || func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	continue
 	;;
@@ -2105,17 +3421,17 @@ func_mode_compile ()
     func_quote_for_eval "$libobj"
     test "X$libobj" != "X$func_quote_for_eval_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+      && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
+    objname=$func_basename_result
+    xdir=$func_dirname_result
+    lobj=$xdir$objdir/$objname
 
     test -z "$base_compile" && \
       func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       removelist="$obj $lobj $libobj ${libobj}T"
     else
       removelist="$lobj $libobj ${libobj}T"
@@ -2127,16 +3443,16 @@ func_mode_compile ()
       pic_mode=default
       ;;
     esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
       # non-PIC code in shared libraries is not supported
       pic_mode=default
     fi
 
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
+    if test no = "$compiler_c_o"; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+      lockfile=$output_obj.lock
     else
       output_obj=
       need_locks=no
@@ -2145,12 +3461,12 @@ func_mode_compile ()
 
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
+    if test yes = "$need_locks"; then
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
-    elif test "$need_locks" = warn; then
+    elif test warn = "$need_locks"; then
       if test -f "$lockfile"; then
 	$ECHO "\
 *** ERROR, $lockfile exists and contains:
@@ -2158,7 +3474,7 @@ func_mode_compile ()
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2180,11 +3496,11 @@ compiler."
     qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       # Without this assignment, base_compile gets emptied.
       fbsd_hideous_sh_bug=$base_compile
 
-      if test "$pic_mode" != no; then
+      if test no != "$pic_mode"; then
 	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
@@ -2201,7 +3517,7 @@ compiler."
       func_show_eval_locale "$command"	\
           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2212,7 +3528,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2228,20 +3544,20 @@ compiler."
       fi
 
       # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
+      if test yes = "$suppress_opt"; then
 	suppress_output=' >/dev/null 2>&1'
       fi
     fi
 
     # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
 	# Don't build PIC code
 	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
-      if test "$compiler_c_o" = yes; then
+      if test yes = "$compiler_c_o"; then
 	func_append command " -o $obj"
       fi
 
@@ -2250,7 +3566,7 @@ compiler."
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2261,7 +3577,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2281,7 +3597,7 @@ compiler."
       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
 
       # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
+      if test no != "$need_locks"; then
 	removelist=$lockfile
         $RM "$lockfile"
       fi
@@ -2291,7 +3607,7 @@ compiler."
 }
 
 $opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
@@ -2311,7 +3627,7 @@ func_mode_help ()
 Remove files from the build directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, object or program, all the files associated
@@ -2330,16 +3646,16 @@ This mode accepts the following additional options:
   -no-suppress      do not suppress compiler output for multiple passes
   -prefer-pic       try to build PIC objects only
   -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
+  -shared           do not build a '.o' file suitable for static linking
+  -static           only build a '.o' file suitable for static linking
   -Wc,FLAG          pass FLAG directly to the compiler
 
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
 from the given SOURCEFILE.
 
 The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
         ;;
 
       execute)
@@ -2352,7 +3668,7 @@ This mode accepts the following additional options:
 
   -dlopen FILE      add the directory containing FILE to the library path
 
-This mode sets the library path environment variable according to \`-dlopen'
+This mode sets the library path environment variable according to '-dlopen'
 flags.
 
 If any of the ARGS are libtool executable wrappers, then they are translated
@@ -2371,7 +3687,7 @@ Complete the installation of libtool libraries.
 Each LIBDIR is a directory that contains libtool libraries.
 
 The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
+the '--dry-run' option if you just want to see what would be executed."
         ;;
 
       install)
@@ -2381,7 +3697,7 @@ the \`--dry-run' option if you just want to see what would be executed."
 Install executables or libraries.
 
 INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
+either the 'install' or 'cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
@@ -2407,7 +3723,7 @@ The following components of LINK-COMMAND are treated specially:
   -avoid-version    do not add a version suffix if possible
   -bindir BINDIR    specify path to binaries directory (for systems where
                     libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
   -export-symbols SYMFILE
@@ -2421,7 +3737,8 @@ The following components of LINK-COMMAND are treated specially:
   -no-install       link a not-installable executable
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -objectlist FILE  use a list of object files found in FILE to specify objects
+  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
   -precious-files-regex REGEX
                     don't remove output files matching REGEX
   -release RELEASE  specify package release information
@@ -2441,20 +3758,20 @@ The following components of LINK-COMMAND are treated specially:
   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
-All other options (arguments beginning with \`-') are ignored.
+All other options (arguments beginning with '-') are ignored.
 
-Every other argument is treated as a filename.  Files ending in \`.la' are
+Every other argument is treated as a filename.  Files ending in '.la' are
 treated as uninstalled libtool libraries, other files are standard or library
 object files.
 
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
 required, except when creating a convenience library.
 
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
 
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
 is created, otherwise an executable program is created."
         ;;
 
@@ -2465,7 +3782,7 @@ is created, otherwise an executable program is created."
 Remove libraries from an installation directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, all the files associated with it are deleted.
@@ -2473,17 +3790,17 @@ Otherwise, only FILE itself is deleted using RM."
         ;;
 
       *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
+        func_fatal_help "invalid operation mode '$opt_mode'"
         ;;
     esac
 
     echo
-    $ECHO "Try \`$progname --help' for more information about other modes."
+    $ECHO "Try '$progname --help' for more information about other modes."
 }
 
 # Now that we've collected a possible --mode arg, show help if necessary
 if $opt_help; then
-  if test "$opt_help" = :; then
+  if test : = "$opt_help"; then
     func_mode_help
   else
     {
@@ -2491,7 +3808,7 @@ if $opt_help; then
       for opt_mode in compile link execute install finish uninstall clean; do
 	func_mode_help
       done
-    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
     {
       func_help noexit
       for opt_mode in compile link execute install finish uninstall clean; do
@@ -2499,7 +3816,7 @@ if $opt_help; then
 	func_mode_help
       done
     } |
-    sed '1d
+    $SED '1d
       /^When reporting/,/^Report/{
 	H
 	d
@@ -2516,16 +3833,17 @@ fi
 # func_mode_execute arg...
 func_mode_execute ()
 {
-    $opt_debug
+    $debug_cmd
+
     # The first argument is the command name.
-    cmd="$nonopt"
+    cmd=$nonopt
     test -z "$cmd" && \
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
     for file in $opt_dlopen; do
       test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
+	|| func_fatal_help "'$file' is not a file"
 
       dir=
       case $file in
@@ -2535,7 +3853,7 @@ func_mode_execute ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+	  || func_fatal_help "'$lib' is not a valid libtool archive"
 
 	# Read the libtool library.
 	dlname=
@@ -2546,18 +3864,18 @@ func_mode_execute ()
 	if test -z "$dlname"; then
 	  # Warn if it was a shared library.
 	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	    func_warning "'$file' was not linked with '-export-dynamic'"
 	  continue
 	fi
 
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 
 	if test -f "$dir/$objdir/$dlname"; then
 	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
 	  fi
 	fi
 	;;
@@ -2565,18 +3883,18 @@ func_mode_execute ()
       *.lo)
 	# Just add the directory containing the .lo file.
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	;;
 
       *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
 	continue
 	;;
       esac
 
       # Get the absolute pathname.
       absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
+      test -n "$absdir" && dir=$absdir
 
       # Now add the directory to shlibpath_var.
       if eval "test -z \"\$$shlibpath_var\""; then
@@ -2588,7 +3906,7 @@ func_mode_execute ()
 
     # This variable tells wrapper scripts just to set shlibpath_var
     # rather than running their programs.
-    libtool_execute_magic="$magic"
+    libtool_execute_magic=$magic
 
     # Check if any of the arguments is a wrapper script.
     args=
@@ -2601,12 +3919,12 @@ func_mode_execute ()
 	if func_ltwrapper_script_p "$file"; then
 	  func_source "$file"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	elif func_ltwrapper_executable_p "$file"; then
 	  func_ltwrapper_scriptname "$file"
 	  func_source "$func_ltwrapper_scriptname_result"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	fi
 	;;
       esac
@@ -2614,7 +3932,15 @@ func_mode_execute ()
       func_append_quoted args "$file"
     done
 
-    if test "X$opt_dry_run" = Xfalse; then
+    if $opt_dry_run; then
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    else
       if test -n "$shlibpath_var"; then
 	# Export the shlibpath_var.
 	eval "export $shlibpath_var"
@@ -2631,25 +3957,18 @@ func_mode_execute ()
       done
 
       # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
+      exec_cmd=\$cmd$args
     fi
 }
 
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
-    $opt_debug
+    $debug_cmd
+
     libs=
     libdirs=
     admincmds=
@@ -2663,11 +3982,11 @@ func_mode_finish ()
 	if func_lalib_unsafe_p "$opt"; then
 	  func_append libs " $opt"
 	else
-	  func_warning "\`$opt' is not a valid libtool archive"
+	  func_warning "'$opt' is not a valid libtool archive"
 	fi
 
       else
-	func_fatal_error "invalid argument \`$opt'"
+	func_fatal_error "invalid argument '$opt'"
       fi
     done
 
@@ -2682,12 +4001,12 @@ func_mode_finish ()
       # Remove sysroot references
       if $opt_dry_run; then
         for lib in $libs; do
-          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
         done
       else
         tmpdir=`func_mktempdir`
         for lib in $libs; do
-	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 	    > $tmpdir/tmp-la
 	  mv -f $tmpdir/tmp-la $lib
 	done
@@ -2712,7 +4031,7 @@ func_mode_finish ()
     fi
 
     # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
+    $opt_quiet && exit $EXIT_SUCCESS
 
     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       echo "----------------------------------------------------------------------"
@@ -2723,27 +4042,27 @@ func_mode_finish ()
       echo
       echo "If you ever happen to want to link against installed libraries"
       echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
       echo "flag during linking and do at least one of the following:"
       if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
 	echo "     during execution"
       fi
       if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "   - add LIBDIR to the '$runpath_var' environment variable"
 	echo "     during linking"
       fi
       if test -n "$hardcode_libdir_flag_spec"; then
 	libdir=LIBDIR
 	eval flag=\"$hardcode_libdir_flag_spec\"
 
-	$ECHO "   - use the \`$flag' linker flag"
+	$ECHO "   - use the '$flag' linker flag"
       fi
       if test -n "$admincmds"; then
 	$ECHO "   - have your system administrator run these commands:$admincmds"
       fi
       if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
       fi
       echo
 
@@ -2762,18 +4081,20 @@ func_mode_finish ()
     exit $EXIT_SUCCESS
 }
 
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
 func_mode_install ()
 {
-    $opt_debug
+    $debug_cmd
+
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
        # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
+       case $nonopt in *shtool*) :;; *) false;; esac
+    then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -2800,7 +4121,7 @@ func_mode_install ()
     opts=
     prev=
     install_type=
-    isdir=no
+    isdir=false
     stripme=
     no_mode=:
     for arg
@@ -2813,7 +4134,7 @@ func_mode_install ()
       fi
 
       case $arg in
-      -d) isdir=yes ;;
+      -d) isdir=: ;;
       -f)
 	if $install_cp; then :; else
 	  prev=$arg
@@ -2831,7 +4152,7 @@ func_mode_install ()
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
-	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
 	    arg2=$install_override_mode
 	    no_mode=false
 	  fi
@@ -2856,7 +4177,7 @@ func_mode_install ()
       func_fatal_help "you must specify an install program"
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
+      func_fatal_help "the '$prev' option requires an argument"
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
@@ -2878,19 +4199,19 @@ func_mode_install ()
     dest=$func_stripname_result
 
     # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
+    test -d "$dest" && isdir=:
+    if $isdir; then
+      destdir=$dest
       destname=
     else
       func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
+      destdir=$func_dirname_result
+      destname=$func_basename_result
 
       # Not a directory, so check to see that there is only one file specified.
       set dummy $files; shift
       test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
+	func_fatal_help "'$dest' is not a directory"
     fi
     case $destdir in
     [\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -2899,7 +4220,7 @@ func_mode_install ()
 	case $file in
 	*.lo) ;;
 	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  func_fatal_help "'$destdir' must be an absolute directory name"
 	  ;;
 	esac
       done
@@ -2908,7 +4229,7 @@ func_mode_install ()
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     staticlibs=
     future_libdirs=
@@ -2928,7 +4249,7 @@ func_mode_install ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
+	  || func_fatal_help "'$file' is not a valid libtool archive"
 
 	library_names=
 	old_library=
@@ -2950,7 +4271,7 @@ func_mode_install ()
 	fi
 
 	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
@@ -2964,7 +4285,7 @@ func_mode_install ()
 	  # are installed into $libdir/../bin (currently, that works fine)
 	  # but it's something to keep an eye on.
 	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
@@ -2973,29 +4294,36 @@ func_mode_install ()
 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
-	  func_warning "relinking \`$file'"
+	  func_warning "relinking '$file'"
 	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
 	fi
 
 	# See the names of the shared library.
 	set dummy $library_names; shift
 	if test -n "$1"; then
-	  realname="$1"
+	  realname=$1
 	  shift
 
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
+	  srcname=$realname
+	  test -n "$relink_command" && srcname=${realname}T
 
 	  # Install the shared library and build the symlinks.
 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
-	  tstripme="$stripme"
+	  tstripme=$stripme
 	  case $host_os in
 	  cygwin* | mingw* | pw32* | cegcc*)
 	    case $realname in
 	    *.dll.a)
-	      tstripme=""
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  os2*)
+	    case $realname in
+	    *_dll.a)
+	      tstripme=
 	      ;;
 	    esac
 	    ;;
@@ -3006,7 +4334,7 @@ func_mode_install ()
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # Try 'ln -sf' first, because the 'ln' binary might depend on
 	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
 	    # so we also need to try rm && ln -s.
 	    for linkname
@@ -3017,14 +4345,14 @@ func_mode_install ()
 	  fi
 
 	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
+	  lib=$destdir/$realname
 	  func_execute_cmds "$postinstall_cmds" 'exit $?'
 	fi
 
 	# Install the pseudo-library for information purposes.
 	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
+	name=$func_basename_result
+	instname=$dir/${name}i
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
@@ -3036,11 +4364,11 @@ func_mode_install ()
 
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# Deduce the name of the destination old-style object file.
@@ -3050,11 +4378,11 @@ func_mode_install ()
 	  staticdest=$func_lo2o_result
 	  ;;
 	*.$objext)
-	  staticdest="$destfile"
+	  staticdest=$destfile
 	  destfile=
 	  ;;
 	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  func_fatal_help "cannot copy a libtool object to '$destfile'"
 	  ;;
 	esac
 
@@ -3063,7 +4391,7 @@ func_mode_install ()
 	  func_show_eval "$install_prog $file $destfile" 'exit $?'
 
 	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
+	if test yes = "$build_old_libs"; then
 	  # Deduce the name of the old-style object file.
 	  func_lo2o "$file"
 	  staticobj=$func_lo2o_result
@@ -3075,23 +4403,23 @@ func_mode_install ()
       *)
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# If the file is missing, and there is a .exe on the end, strip it
 	# because it is most likely a libtool script we actually want to
 	# install
-	stripped_ext=""
+	stripped_ext=
 	case $file in
 	  *.exe)
 	    if test ! -f "$file"; then
 	      func_stripname '' '.exe' "$file"
 	      file=$func_stripname_result
-	      stripped_ext=".exe"
+	      stripped_ext=.exe
 	    fi
 	    ;;
 	esac
@@ -3119,19 +4447,19 @@ func_mode_install ()
 
 	  # Check the variables that should have been set.
 	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
 
-	  finalize=yes
+	  finalize=:
 	  for lib in $notinst_deplibs; do
 	    # Check to see that each library is installed.
 	    libdir=
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
 	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
+	      func_warning "'$lib' has not been installed in '$libdir'"
+	      finalize=false
 	    fi
 	  done
 
@@ -3139,29 +4467,29 @@ func_mode_install ()
 	  func_source "$wrapper"
 
 	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
+	  if test no = "$fast_install" && test -n "$relink_command"; then
 	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
+	      if $finalize; then
 	        tmpdir=`func_mktempdir`
 		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
+		file=$func_basename_result
+	        outputname=$tmpdir/$file
 	        # Replace the output file specification.
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
-	        $opt_silent || {
+	        $opt_quiet || {
 	          func_quote_for_expand "$relink_command"
 		  eval "func_echo $func_quote_for_expand_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
+		  func_error "error: relink '$file' with the above command before installing it"
 		  $opt_dry_run || ${RM}r "$tmpdir"
 		  continue
 	        fi
-	        file="$outputname"
+	        file=$outputname
 	      else
-	        func_warning "cannot relink \`$file'"
+	        func_warning "cannot relink '$file'"
 	      fi
 	    }
 	  else
@@ -3198,10 +4526,10 @@ func_mode_install ()
 
     for file in $staticlibs; do
       func_basename "$file"
-      name="$func_basename_result"
+      name=$func_basename_result
 
       # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
+      oldlib=$destdir/$name
       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
       tool_oldlib=$func_to_tool_file_result
 
@@ -3216,18 +4544,18 @@ func_mode_install ()
     done
 
     test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
+      func_warning "remember to run '$progname --finish$future_libdirs'"
 
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
     else
       exit $EXIT_SUCCESS
     fi
 }
 
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -3235,16 +4563,17 @@ test "$opt_mode" = install && func_mode_install ${1+"$@"}
 # a dlpreopen symbol table.
 func_generate_dlsyms ()
 {
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
-    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
+    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
     my_dlsyms=
 
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
       if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
+	my_dlsyms=${my_outputname}S.c
       else
 	func_error "not configured to extract global symbols from dlpreopened files"
       fi
@@ -3255,7 +4584,7 @@ func_generate_dlsyms ()
       "") ;;
       *.c)
 	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
+	nlist=$output_objdir/$my_outputname.nm
 
 	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
 
@@ -3263,34 +4592,36 @@ func_generate_dlsyms ()
 	func_verbose "creating $output_objdir/$my_dlsyms"
 
 	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
 
 #ifdef __cplusplus
 extern \"C\" {
 #endif
 
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
 # define LT_DLSYM_CONST const
 #endif
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* External symbol declarations for the compiler. */\
 "
 
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
+	if test yes = "$dlself"; then
+	  func_verbose "generating symbol list for '$output'"
 
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
@@ -3298,7 +4629,7 @@ extern \"C\" {
 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
 	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
 	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
@@ -3318,10 +4649,10 @@ extern \"C\" {
 
 	  # Prepare the list of exported symbols
 	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
+	    export_symbols=$output_objdir/$outputname.exp
 	    $opt_dry_run || {
 	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 	      case $host in
 	      *cygwin* | *mingw* | *cegcc* )
                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -3331,7 +4662,7 @@ extern \"C\" {
 	    }
 	  else
 	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
@@ -3345,22 +4676,22 @@ extern \"C\" {
 	fi
 
 	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_verbose "extracting global C symbols from '$dlprefile'"
 	  func_basename "$dlprefile"
-	  name="$func_basename_result"
+	  name=$func_basename_result
           case $host in
 	    *cygwin* | *mingw* | *cegcc* )
 	      # if an import library, we need to obtain dlname
 	      if func_win32_import_lib_p "$dlprefile"; then
 	        func_tr_sh "$dlprefile"
 	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=""
+	        dlprefile_dlbasename=
 	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 	          # Use subshell, to avoid clobbering current variable values
 	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname" ; then
+	          if test -n "$dlprefile_dlname"; then
 	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
+	            dlprefile_dlbasename=$func_basename_result
 	          else
 	            # no lafile. user explicitly requested -dlpreopen <import library>.
 	            $sharedlib_from_linklib_cmd "$dlprefile"
@@ -3368,7 +4699,7 @@ extern \"C\" {
 	          fi
 	        fi
 	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
+	          if test -n "$dlprefile_dlbasename"; then
 	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 	          else
 	            func_warning "Could not compute DLL name from $name"
@@ -3424,6 +4755,11 @@ extern \"C\" {
 	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
+	  func_show_eval '$RM "${nlist}I"'
+	  if test -n "$global_symbol_to_import"; then
+	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+	  fi
+
 	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
@@ -3432,11 +4768,30 @@ typedef struct {
   void *address;
 } lt_dlsymlist;
 extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+	    echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+	  fi
+	  echo >> "$output_objdir/$my_dlsyms" "\
 LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
+{ {\"$my_originator\", (void *) 0},"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+	  fi
 
 	  case $need_lib_prefix in
 	  no)
@@ -3478,9 +4833,7 @@ static const void *lt_preloaded_setup() {
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
 	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
+	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
 	    ;;
 	  esac
 	  ;;
@@ -3497,10 +4850,10 @@ static const void *lt_preloaded_setup() {
 	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
 
 	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
 
 	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	symfileobj=$output_objdir/${my_outputname}S.$objext
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
@@ -3518,7 +4871,7 @@ static const void *lt_preloaded_setup() {
 	esac
 	;;
       *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	func_fatal_error "unknown suffix for '$my_dlsyms'"
 	;;
       esac
     else
@@ -3532,6 +4885,32 @@ static const void *lt_preloaded_setup() {
     fi
 }
 
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -3541,8 +4920,9 @@ static const void *lt_preloaded_setup() {
 # Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
-  $opt_debug
-  win32_libid_type="unknown"
+  $debug_cmd
+
+  win32_libid_type=unknown
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
   *ar\ archive\ import\ library*) # definitely import
@@ -3552,16 +4932,29 @@ func_win32_libid ()
     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      func_to_tool_file "$1" func_convert_file_msys_to_w32
-      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	$SED -n -e '
+      case $nm_interface in
+      "MS dumpbin")
+	if func_cygming_ms_implib_p "$1" ||
+	   func_cygming_gnu_implib_p "$1"
+	then
+	  win32_nmres=import
+	else
+	  win32_nmres=
+	fi
+	;;
+      *)
+	func_to_tool_file "$1" func_convert_file_msys_to_w32
+	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	  $SED -n -e '
 	    1,100{
 		/ I /{
-		    s,.*,import,
+		    s|.*|import|
 		    p
 		    q
 		}
 	    }'`
+	;;
+      esac
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
@@ -3593,7 +4986,8 @@ func_win32_libid ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib ()
 {
-  $opt_debug
+  $debug_cmd
+
   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 }
 
@@ -3610,7 +5004,8 @@ func_cygming_dll_for_implib ()
 # specified import library.
 func_cygming_dll_for_implib_fallback_core ()
 {
-  $opt_debug
+  $debug_cmd
+
   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     $SED '/^Contents of section '"$match_literal"':/{
@@ -3646,8 +5041,8 @@ func_cygming_dll_for_implib_fallback_core ()
       /./p' |
     # we now have a list, one entry per line, of the stringified
     # contents of the appropriate section of all members of the
-    # archive which possess that section. Heuristic: eliminate
-    # all those which have a first or second character that is
+    # archive that possess that section. Heuristic: eliminate
+    # all those that have a first or second character that is
     # a '.' (that is, objdump's representation of an unprintable
     # character.) This should work for all archives with less than
     # 0x302f exports -- but will fail for DLLs whose name actually
@@ -3658,30 +5053,6 @@ func_cygming_dll_for_implib_fallback_core ()
     $SED -e '/^\./d;/^.\./d;q'
 }
 
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
 # func_cygming_dll_for_implib_fallback ARG
 # Platform-specific function to extract the
 # name of the DLL associated with the specified
@@ -3695,16 +5066,17 @@ func_cygming_ms_implib_p ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib_fallback ()
 {
-  $opt_debug
-  if func_cygming_gnu_implib_p "$1" ; then
+  $debug_cmd
+
+  if func_cygming_gnu_implib_p "$1"; then
     # binutils import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1" ; then
+  elif func_cygming_ms_implib_p "$1"; then
     # ms-generated import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
   else
     # unknown
-    sharedlib_from_linklib_result=""
+    sharedlib_from_linklib_result=
   fi
 }
 
@@ -3712,10 +5084,11 @@ func_cygming_dll_for_implib_fallback ()
 # func_extract_an_archive dir oldlib
 func_extract_an_archive ()
 {
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    if test "$lock_old_archive_extraction" = yes; then
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; then
       lockfile=$f_ex_an_ar_oldlib.lock
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
@@ -3724,7 +5097,7 @@ func_extract_an_archive ()
     fi
     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test "$lock_old_archive_extraction" = yes; then
+    if test yes = "$lock_old_archive_extraction"; then
       $opt_dry_run || rm -f "$lockfile"
     fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -3738,22 +5111,23 @@ func_extract_an_archive ()
 # func_extract_archives gentop oldlib ...
 func_extract_archives ()
 {
-    $opt_debug
-    my_gentop="$1"; shift
+    $debug_cmd
+
+    my_gentop=$1; shift
     my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
+    my_oldobjs=
+    my_xlib=
+    my_xabs=
+    my_xdir=
 
     for my_xlib in $my_oldlibs; do
       # Extract the objects.
       case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
 	*) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
+      my_xlib=$func_basename_result
       my_xlib_u=$my_xlib
       while :; do
         case " $extracted_archives " in
@@ -3765,7 +5139,7 @@ func_extract_archives ()
 	esac
       done
       extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+      my_xdir=$my_gentop/$my_xlib_u
 
       func_mkdir_p "$my_xdir"
 
@@ -3778,22 +5152,23 @@ func_extract_archives ()
 	  cd $my_xdir || exit $?
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
+	  func_basename "$darwin_archive"
+	  darwin_base_archive=$func_basename_result
 	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
 	  if test -n "$darwin_arches"; then
 	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
 	    darwin_arch=
 	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	    for darwin_arch in  $darwin_arches; do
+	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
 	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
 	    done # $darwin_arches
             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
@@ -3815,7 +5190,7 @@ func_extract_archives ()
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
-    func_extract_archives_result="$my_oldobjs"
+    func_extract_archives_result=$my_oldobjs
 }
 
 
@@ -3830,7 +5205,7 @@ func_extract_archives ()
 #
 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 # variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
+# will assume that the directory where it is stored is
 # the $objdir directory.  This is a cygwin/mingw-specific
 # behavior.
 func_emit_wrapper ()
@@ -3841,7 +5216,7 @@ func_emit_wrapper ()
 #! $SHELL
 
 # $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # The $output program cannot be directly executed until all the libtool
 # libraries that it depends on are installed.
@@ -3898,9 +5273,9 @@ _LTECHO_EOF'
 
 # Very basic option parsing. These options are (a) specific to
 # the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
+# /script/ and the wrapper /executable/ that is used only on
 # windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
+# (application programs are unlikely to have options that match
 # this pattern).
 #
 # There are only two supported options: --lt-debug and
@@ -3933,7 +5308,7 @@ func_parse_lt_options ()
 
   # Print the debug banner immediately:
   if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
   fi
 }
 
@@ -3944,7 +5319,7 @@ func_lt_dump_args ()
   lt_dump_args_N=1;
   for lt_arg
   do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
   done
 }
@@ -3958,7 +5333,7 @@ func_exec_program_core ()
   *-*-mingw | *-*-os2* | *-cegcc*)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -3968,7 +5343,7 @@ func_exec_program_core ()
   *)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -4043,13 +5418,13 @@ func_exec_program ()
   test -n \"\$absdir\" && thisdir=\"\$absdir\"
 "
 
-	if test "$fast_install" = yes; then
+	if test yes = "$fast_install"; then
 	  $ECHO "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
     file=\"\$\$-\$program\"
@@ -4066,7 +5441,7 @@ func_exec_program ()
     if test -n \"\$relink_command\"; then
       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
       else
-	$ECHO \"\$relink_command_output\" >&2
+	\$ECHO \"\$relink_command_output\" >&2
 	$RM \"\$progdir/\$file\"
 	exit 1
       fi
@@ -4101,7 +5476,7 @@ func_exec_program ()
 	fi
 
 	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
     # Add our own library path to $shlibpath_var
     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -4121,7 +5496,7 @@ func_exec_program ()
     fi
   else
     # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
@@ -4140,7 +5515,7 @@ func_emit_cwrapperexe_src ()
 	cat <<EOF
 
 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
@@ -4175,47 +5550,45 @@ EOF
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
 # ifdef __STRICT_ANSI__
 int _putenv (const char *);
 # endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # ifdef __STRICT_ANSI__
 char *realpath (const char *, char *);
 int putenv (char *);
 int setenv (const char *, const char *, int);
 # endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other_platform || defined ... */
 #endif
 
 /* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
 # define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-#  define _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # define HAVE_SETENV
 # define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
 #endif
 
-#if defined(PATH_MAX)
+#if defined PATH_MAX
 # define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
 # define LT_PATHMAX MAXPATHLEN
 #else
 # define LT_PATHMAX 1024
@@ -4234,8 +5607,8 @@ int setenv (const char *, const char *, int);
 # define PATH_SEPARATOR ':'
 #endif
 
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+  defined __OS2__
 # define HAVE_DOS_BASED_FILE_SYSTEM
 # define FOPEN_WB "wb"
 # ifndef DIR_SEPARATOR_2
@@ -4268,10 +5641,10 @@ int setenv (const char *, const char *, int);
 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
+  if (stale) { free (stale); stale = 0; } \
 } while (0)
 
-#if defined(LT_DEBUGWRAPPER)
+#if defined LT_DEBUGWRAPPER
 static int lt_debug = 1;
 #else
 static int lt_debug = 0;
@@ -4300,11 +5673,16 @@ void lt_dump_script (FILE *f);
 EOF
 
 	    cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
               func_to_host_path "$temp_rpath"
 	      cat <<EOF
 const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
@@ -4328,7 +5706,7 @@ const char * EXE_PATH_VALUE   = "";
 EOF
 	    fi
 
-	    if test "$fast_install" = yes; then
+	    if test yes = "$fast_install"; then
 	      cat <<EOF
 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
 EOF
@@ -4357,12 +5735,12 @@ main (int argc, char *argv[])
   char *actual_cwrapper_name;
   char *target_name;
   char *lt_argv_zero;
-  intptr_t rval = 127;
+  int rval = 127;
 
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
+  newargz = XMALLOC (char *, (size_t) argc + 1);
 
   /* very simple arg parsing; don't want to rely on getopt
    * also, copy all non cwrapper options to newargz, except
@@ -4371,10 +5749,10 @@ main (int argc, char *argv[])
   newargc=0;
   for (i = 1; i < argc; i++)
     {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
+      if (STREQ (argv[i], dumpscript_opt))
 	{
 EOF
-	    case "$host" in
+	    case $host in
 	      *mingw* | *cygwin* )
 		# make stdout use "unix" line endings
 		echo "          setmode(1,_O_BINARY);"
@@ -4385,12 +5763,12 @@ EOF
 	  lt_dump_script (stdout);
 	  return 0;
 	}
-      if (strcmp (argv[i], debug_opt) == 0)
+      if (STREQ (argv[i], debug_opt))
 	{
           lt_debug = 1;
           continue;
 	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+      if (STREQ (argv[i], ltwrapper_option_prefix))
         {
           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
              namespace, but it is not one of the ones we know about and
@@ -4413,7 +5791,7 @@ EOF
 EOF
 	    cat <<EOF
   /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
 EOF
 	    cat <<"EOF"
   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -4524,7 +5902,7 @@ EOF
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
   newargz = prepare_spawn (newargz);
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
@@ -4569,7 +5947,7 @@ base_name (const char *name)
 {
   const char *base;
 
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   /* Skip over the disk name in MSDOS pathnames. */
   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     name += 2;
@@ -4628,7 +6006,7 @@ find_executable (const char *wrapper)
   const char *p_next;
   /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
-  int tmp_len;
+  size_t tmp_len;
   char *concat_name;
 
   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -4638,7 +6016,7 @@ find_executable (const char *wrapper)
     return NULL;
 
   /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
     {
       concat_name = xstrdup (wrapper);
@@ -4656,7 +6034,7 @@ find_executable (const char *wrapper)
 	    return concat_name;
 	  XFREE (concat_name);
 	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
     }
 #endif
 
@@ -4679,7 +6057,7 @@ find_executable (const char *wrapper)
 	      for (q = p; *q; q++)
 		if (IS_PATH_SEPARATOR (*q))
 		  break;
-	      p_len = q - p;
+	      p_len = (size_t) (q - p);
 	      p_next = (*q == '\0' ? q : q + 1);
 	      if (p_len == 0)
 		{
@@ -4798,7 +6176,7 @@ strendzap (char *str, const char *pat)
   if (patlen <= len)
     {
       str += len - patlen;
-      if (strcmp (str, pat) == 0)
+      if (STREQ (str, pat))
 	*str = '\0';
     }
   return str;
@@ -4863,7 +6241,7 @@ lt_setenv (const char *name, const char *value)
     char *str = xstrdup (value);
     setenv (name, str, 1);
 #else
-    int len = strlen (name) + 1 + strlen (value) + 1;
+    size_t len = strlen (name) + 1 + strlen (value) + 1;
     char *str = XMALLOC (char, len);
     sprintf (str, "%s=%s", name, value);
     if (putenv (str) != EXIT_SUCCESS)
@@ -4880,8 +6258,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
   char *new_value;
   if (orig_value && *orig_value)
     {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
+      size_t orig_value_len = strlen (orig_value);
+      size_t add_len = strlen (add);
       new_value = XMALLOC (char, add_len + orig_value_len + 1);
       if (to_end)
         {
@@ -4912,10 +6290,10 @@ lt_update_exe_path (const char *name, const char *value)
     {
       char *new_value = lt_extend_str (getenv (name), value, 0);
       /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
         {
-          new_value[len-1] = '\0';
+          new_value[--len] = '\0';
         }
       lt_setenv (name, new_value);
       XFREE (new_value);
@@ -5082,27 +6460,47 @@ EOF
 # True if ARG is an import lib, as indicated by $file_magic_cmd
 func_win32_import_lib_p ()
 {
-    $opt_debug
+    $debug_cmd
+
     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
     *import*) : ;;
     *) false ;;
     esac
 }
 
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
 # func_mode_link arg...
 func_mode_link ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
+      # what system we are compiling for in order to pass an extra
       # flag for every libtool invocation.
       # allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
+      # to make a dll that has undefined symbols, in which case not
       # even a static library is built.  For now, we need to specify
       # -no-undefined on the libtool link line when we can be certain
       # that all symbols are satisfied, otherwise we get a static library.
@@ -5146,10 +6544,11 @@ func_mode_link ()
     module=no
     no_install=no
     objs=
+    os2dllname=
     non_pic_objects=
     precious_files_regex=
     prefer_static_libs=no
-    preload=no
+    preload=false
     prev=
     prevarg=
     release=
@@ -5161,7 +6560,7 @@ func_mode_link ()
     vinfo=
     vinfo_number=no
     weak_libs=
-    single_module="${wl}-single_module"
+    single_module=$wl-single_module
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
@@ -5169,15 +6568,15 @@ func_mode_link ()
     do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes != "$build_libtool_libs" \
+	  && func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	break
 	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
 	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
@@ -5210,7 +6609,7 @@ func_mode_link ()
 
     # Go through the arguments, transforming them on the way.
     while test "$#" -gt 0; do
-      arg="$1"
+      arg=$1
       shift
       func_quote_for_eval "$arg"
       qarg=$func_quote_for_eval_unquoted_result
@@ -5227,21 +6626,21 @@ func_mode_link ()
 
 	case $prev in
 	bindir)
-	  bindir="$arg"
+	  bindir=$arg
 	  prev=
 	  continue
 	  ;;
 	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
+	  $preload || {
 	    # Add the symbol object into the linking commands.
 	    func_append compile_command " @SYMFILE@"
 	    func_append finalize_command " @SYMFILE@"
-	    preload=yes
-	  fi
+	    preload=:
+	  }
 	  case $arg in
 	  *.la | *.lo) ;;  # We handle these cases below.
 	  force)
-	    if test "$dlself" = no; then
+	    if test no = "$dlself"; then
 	      dlself=needless
 	      export_dynamic=yes
 	    fi
@@ -5249,9 +6648,9 @@ func_mode_link ()
 	    continue
 	    ;;
 	  self)
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
 	      dlself=yes
 	    else
 	      dlself=needless
@@ -5261,7 +6660,7 @@ func_mode_link ()
 	    continue
 	    ;;
 	  *)
-	    if test "$prev" = dlfiles; then
+	    if test dlfiles = "$prev"; then
 	      func_append dlfiles " $arg"
 	    else
 	      func_append dlprefiles " $arg"
@@ -5272,14 +6671,14 @@ func_mode_link ()
 	  esac
 	  ;;
 	expsyms)
-	  export_symbols="$arg"
+	  export_symbols=$arg
 	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
+	    || func_fatal_error "symbol file '$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
 	expsyms_regex)
-	  export_symbols_regex="$arg"
+	  export_symbols_regex=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5297,7 +6696,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	inst_prefix)
-	  inst_prefix_dir="$arg"
+	  inst_prefix_dir=$arg
+	  prev=
+	  continue
+	  ;;
+	mllvm)
+	  # Clang does not use LLVM to link, so we can simply discard any
+	  # '-mllvm $arg' options when doing the link step.
 	  prev=
 	  continue
 	  ;;
@@ -5321,21 +6726,21 @@ func_mode_link ()
 
 		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
+		   test none = "$pic_object" &&
+		   test none = "$non_pic_object"; then
+		  func_fatal_error "cannot find name of object for '$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
 		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
+		xdir=$func_dirname_result
 
-		if test "$pic_object" != none; then
+		if test none != "$pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
+		  pic_object=$xdir$pic_object
 
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		  if test dlfiles = "$prev"; then
+		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
@@ -5346,7 +6751,7 @@ func_mode_link ()
 		  fi
 
 		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
+		  if test dlprefiles = "$prev"; then
 		    # Preload the old-style object.
 		    func_append dlprefiles " $pic_object"
 		    prev=
@@ -5354,23 +6759,23 @@ func_mode_link ()
 
 		  # A PIC object.
 		  func_append libobjs " $pic_object"
-		  arg="$pic_object"
+		  arg=$pic_object
 		fi
 
 		# Non-PIC object.
-		if test "$non_pic_object" != none; then
+		if test none != "$non_pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
+		  non_pic_object=$xdir$non_pic_object
 
 		  # A standard non-PIC object
 		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
+		  if test -z "$pic_object" || test none = "$pic_object"; then
+		    arg=$non_pic_object
 		  fi
 		else
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
+		  non_pic_object=$pic_object
 		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
@@ -5378,7 +6783,7 @@ func_mode_link ()
 		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
 		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
+		  xdir=$func_dirname_result
 
 		  func_lo2o "$arg"
 		  pic_object=$xdir$objdir/$func_lo2o_result
@@ -5386,24 +6791,29 @@ func_mode_link ()
 		  func_append libobjs " $pic_object"
 		  func_append non_pic_objects " $non_pic_object"
 	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
+		  func_fatal_error "'$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
+	    func_fatal_error "link input file '$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
+	os2dllname)
+	  os2dllname=$arg
+	  prev=
+	  continue
+	  ;;
 	precious_regex)
-	  precious_files_regex="$arg"
+	  precious_files_regex=$arg
 	  prev=
 	  continue
 	  ;;
 	release)
-	  release="-$arg"
+	  release=-$arg
 	  prev=
 	  continue
 	  ;;
@@ -5415,7 +6825,7 @@ func_mode_link ()
 	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
-	  if test "$prev" = rpath; then
+	  if test rpath = "$prev"; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
 	    *) func_append rpath " $arg" ;;
@@ -5430,7 +6840,7 @@ func_mode_link ()
 	  continue
 	  ;;
 	shrext)
-	  shrext_cmds="$arg"
+	  shrext_cmds=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5470,7 +6880,7 @@ func_mode_link ()
 	esac
       fi # test -n "$prev"
 
-      prevarg="$arg"
+      prevarg=$arg
 
       case $arg in
       -all-static)
@@ -5484,7 +6894,7 @@ func_mode_link ()
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	func_fatal_error "'-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -5516,7 +6926,7 @@ func_mode_link ()
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
-	if test "X$arg" = "X-export-symbols"; then
+	if test X-export-symbols = "X$arg"; then
 	  prev=expsyms
 	else
 	  prev=expsyms_regex
@@ -5550,9 +6960,9 @@ func_mode_link ()
 	func_stripname "-L" '' "$arg"
 	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
+	    func_fatal_error "require no space between '-L' and '$1'"
 	  else
-	    func_fatal_error "need path for \`-L' option"
+	    func_fatal_error "need path for '-L' option"
 	  fi
 	fi
 	func_resolve_sysroot "$func_stripname_result"
@@ -5563,8 +6973,8 @@ func_mode_link ()
 	*)
 	  absdir=`cd "$dir" && pwd`
 	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
+	    func_fatal_error "cannot determine absolute directory name of '$dir'"
+	  dir=$absdir
 	  ;;
 	esac
 	case "$deplibs " in
@@ -5599,7 +7009,7 @@ func_mode_link ()
 	;;
 
       -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
@@ -5607,11 +7017,11 @@ func_mode_link ()
 	    ;;
 	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
@@ -5620,16 +7030,16 @@ func_mode_link ()
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
 	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  esac
-	elif test "X$arg" = "X-lc_r"; then
+	elif test X-lc_r = "X$arg"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
@@ -5639,6 +7049,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -mllvm)
+	prev=mllvm
+	continue
+	;;
+
       -module)
 	module=yes
 	continue
@@ -5668,7 +7083,7 @@ func_mode_link ()
 	;;
 
       -multi_module)
-	single_module="${wl}-multi_module"
+	single_module=$wl-multi_module
 	continue
 	;;
 
@@ -5682,8 +7097,8 @@ func_mode_link ()
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
+	  func_warning "'-no-install' is ignored for $host"
+	  func_warning "assuming '-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -5701,6 +7116,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -os2dllname)
+	prev=os2dllname
+	continue
+	;;
+
       -o) prev=output ;;
 
       -precious-files-regex)
@@ -5788,14 +7208,14 @@ func_mode_link ()
 	func_stripname '-Wc,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $func_quote_for_eval_result"
 	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5804,15 +7224,15 @@ func_mode_link ()
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $wl$func_quote_for_eval_result"
 	  func_append compiler_flags " $wl$func_quote_for_eval_result"
 	  func_append linker_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5835,7 +7255,7 @@ func_mode_link ()
       # -msg_* for osf cc
       -msg_*)
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -5847,25 +7267,49 @@ func_mode_link ()
       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
       # -F/path              path to uninstalled frameworks, gcc on darwin
       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # -fstack-protector*   stack protector flags for GCC
       # @file                GCC response files
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -specs=*             GCC specs files
+      # -stdlib=*            select c++ std lib with clang
+      # -fsanitize=*         Clang/GCC memory and address sanitizer
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+      -specs=*|-fsanitize=*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
         continue
         ;;
 
+      -Z*)
+        if test os2 = "`expr $host : '.*\(os2\)'`"; then
+          # OS/2 uses -Zxxx to specify OS/2-specific options
+	  compiler_flags="$compiler_flags $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  case $arg in
+	  -Zlinker | -Zstack)
+	    prev=xcompiler
+	    ;;
+	  esac
+	  continue
+        else
+	  # Otherwise treat like 'Some other compiler flag' below
+	  func_quote_for_eval "$arg"
+	  arg=$func_quote_for_eval_result
+        fi
+	;;
+
       # Some other compiler flag.
       -* | +*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       *.$objext)
@@ -5886,21 +7330,21 @@ func_mode_link ()
 
 	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
+	     test none = "$pic_object" &&
+	     test none = "$non_pic_object"; then
+	    func_fatal_error "cannot find name of object for '$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
 	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
+	  xdir=$func_dirname_result
 
-	  if test "$pic_object" != none; then
+	  test none = "$pic_object" || {
 	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
+	    pic_object=$xdir$pic_object
 
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+	    if test dlfiles = "$prev"; then
+	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		func_append dlfiles " $pic_object"
 		prev=
 		continue
@@ -5911,7 +7355,7 @@ func_mode_link ()
 	    fi
 
 	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      # Preload the old-style object.
 	      func_append dlprefiles " $pic_object"
 	      prev=
@@ -5919,23 +7363,23 @@ func_mode_link ()
 
 	    # A PIC object.
 	    func_append libobjs " $pic_object"
-	    arg="$pic_object"
-	  fi
+	    arg=$pic_object
+	  }
 
 	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
+	  if test none != "$non_pic_object"; then
 	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
+	    non_pic_object=$xdir$non_pic_object
 
 	    # A standard non-PIC object
 	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
+	    if test -z "$pic_object" || test none = "$pic_object"; then
+	      arg=$non_pic_object
 	    fi
 	  else
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
+	    non_pic_object=$pic_object
 	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
@@ -5943,7 +7387,7 @@ func_mode_link ()
 	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
 	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
+	    xdir=$func_dirname_result
 
 	    func_lo2o "$arg"
 	    pic_object=$xdir$objdir/$func_lo2o_result
@@ -5951,7 +7395,7 @@ func_mode_link ()
 	    func_append libobjs " $pic_object"
 	    func_append non_pic_objects " $non_pic_object"
 	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
+	    func_fatal_error "'$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
@@ -5967,11 +7411,11 @@ func_mode_link ()
 	# A libtool-controlled library.
 
 	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
+	if test dlfiles = "$prev"; then
 	  # This library was specified with -dlopen.
 	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
-	elif test "$prev" = dlprefiles; then
+	elif test dlprefiles = "$prev"; then
 	  # The library was specified with -dlpreopen.
 	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
@@ -5986,7 +7430,7 @@ func_mode_link ()
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
       esac # arg
 
@@ -5998,9 +7442,9 @@ func_mode_link ()
     done # argument parsing loop
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
+      func_fatal_help "the '$prevarg' option requires an argument"
 
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
       func_append compile_command " $arg"
       func_append finalize_command " $arg"
@@ -6009,20 +7453,23 @@ func_mode_link ()
     oldlibs=
     # calculate the name of the file, without its directory
     func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
+    outputname=$func_basename_result
+    libobjs_save=$libobjs
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
     func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
+    output_objdir=$func_dirname_result$objdir
     func_to_tool_file "$output_objdir/"
     tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
@@ -6045,7 +7492,7 @@ func_mode_link ()
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_preserve_dup_deps ; then
+      if $opt_preserve_dup_deps; then
 	case "$libs " in
 	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
@@ -6053,7 +7500,7 @@ func_mode_link ()
       func_append libs " $deplib"
     done
 
-    if test "$linkmode" = lib; then
+    if test lib = "$linkmode"; then
       libs="$predeps $libs $compiler_lib_search_path $postdeps"
 
       # Compute libraries that are listed more than once in $predeps
@@ -6085,7 +7532,7 @@ func_mode_link ()
 	  case $file in
 	  *.la) ;;
 	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -6093,7 +7540,7 @@ func_mode_link ()
     prog)
 	compile_deplibs=
 	finalize_deplibs=
-	alldeplibs=no
+	alldeplibs=false
 	newdlfiles=
 	newdlprefiles=
 	passes="conv scan dlopen dlpreopen link"
@@ -6105,32 +7552,32 @@ func_mode_link ()
     for pass in $passes; do
       # The preopen pass in lib mode reverses $deplibs; put it back here
       # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
+      if test lib,link = "$linkmode,$pass"; then
 	## FIXME: Find the place where the list is rebuilt in the wrong
 	##        order, and fix it there properly
         tmp_deplibs=
 	for deplib in $deplibs; do
 	  tmp_deplibs="$deplib $tmp_deplibs"
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
       fi
 
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
+      if test lib,link = "$linkmode,$pass" ||
+	 test prog,scan = "$linkmode,$pass"; then
+	libs=$deplibs
 	deplibs=
       fi
-      if test "$linkmode" = prog; then
+      if test prog = "$linkmode"; then
 	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
+	dlopen) libs=$dlfiles ;;
+	dlpreopen) libs=$dlprefiles ;;
 	link)
 	  libs="$deplibs %DEPLIBS%"
 	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
 	  ;;
 	esac
       fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+      if test lib,dlpreopen = "$linkmode,$pass"; then
 	# Collect and forward deplibs of preopened libtool libs
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
@@ -6151,26 +7598,26 @@ func_mode_link ()
 	    esac
 	  done
 	done
-	libs="$dlprefiles"
+	libs=$dlprefiles
       fi
-      if test "$pass" = dlopen; then
+      if test dlopen = "$pass"; then
 	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
+	save_deplibs=$deplibs
 	deplibs=
       fi
 
       for deplib in $libs; do
 	lib=
-	found=no
+	found=false
 	case $deplib in
 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    func_append compiler_flags " $deplib"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6180,13 +7627,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
+	  if test lib != "$linkmode" && test prog != "$linkmode"; then
+	    func_warning "'-l' is ignored for archives/objects"
 	    continue
 	  fi
 	  func_stripname '-l' '' "$deplib"
 	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
 	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -6194,31 +7641,22 @@ func_mode_link ()
 	  for searchdir in $searchdirs; do
 	    for search_ext in .la $std_shrext .so .a; do
 	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
+	      lib=$searchdir/lib$name$search_ext
 	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
+		if test .la = "$search_ext"; then
+		  found=:
 		else
-		  found=no
+		  found=false
 		fi
 		break 2
 	      fi
 	    done
 	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
+	  if $found; then
+	    # deplib is a libtool library
 	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
 	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
 		if func_lalib_p "$lib"; then
@@ -6226,19 +7664,19 @@ func_mode_link ()
 		  old_library=
 		  func_source "$lib"
 		  for l in $old_library $library_names; do
-		    ll="$l"
+		    ll=$l
 		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
+		  if test "X$ll" = "X$old_library"; then # only static version available
+		    found=false
 		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
+		    ladir=$func_dirname_result
 		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
+		    if test prog,link = "$linkmode,$pass"; then
 		      compile_deplibs="$deplib $compile_deplibs"
 		      finalize_deplibs="$deplib $finalize_deplibs"
 		    else
 		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
 		    fi
 		    continue
 		  fi
@@ -6247,15 +7685,25 @@ func_mode_link ()
 	      *) ;;
 	      esac
 	    fi
+	  else
+	    # deplib doesn't seem to be a libtool library
+	    if test prog,link = "$linkmode,$pass"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
 	  fi
 	  ;; # -l
 	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6268,18 +7716,18 @@ func_mode_link ()
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
+	    test conv = "$pass" && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
-	    if test "$pass" = conv; then
+	    if test conv = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	      continue
 	    fi
-	    if test "$pass" = scan; then
+	    if test scan = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6290,13 +7738,13 @@ func_mode_link ()
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
+	    func_warning "'-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
-	  if test "$pass" = link; then
+	  if test link = "$pass"; then
 	    func_stripname '-R' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    dir=$func_resolve_sysroot_result
@@ -6314,7 +7762,7 @@ func_mode_link ()
 	  lib=$func_resolve_sysroot_result
 	  ;;
 	*.$libext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
 	    continue
 	  fi
@@ -6325,21 +7773,26 @@ func_mode_link ()
 	    case " $dlpreconveniencelibs " in
 	    *" $deplib "*) ;;
 	    *)
-	      valid_a_lib=no
+	      valid_a_lib=false
 	      case $deplibs_check_method in
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
+		    valid_a_lib=:
 		  fi
 		;;
 		pass_all)
-		  valid_a_lib=yes
+		  valid_a_lib=:
 		;;
 	      esac
-	      if test "$valid_a_lib" != yes; then
+	      if $valid_a_lib; then
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      else
 		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
 		echo "*** I have the capability to make that library automatically link in when"
@@ -6347,18 +7800,13 @@ func_mode_link ()
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because the file extensions .$libext of this argument makes me believe"
 		echo "*** that it is just a static archive that I should not use here."
-	      else
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
 	      fi
 	      ;;
 	    esac
 	    continue
 	    ;;
 	  prog)
-	    if test "$pass" != link; then
+	    if test link != "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6369,10 +7817,10 @@ func_mode_link ()
 	  esac # linkmode
 	  ;; # *.$libext
 	*.lo | *.$objext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	  elif test prog = "$linkmode"; then
+	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
 	      func_append newdlprefiles " $deplib"
@@ -6385,22 +7833,20 @@ func_mode_link ()
 	  continue
 	  ;;
 	%DEPLIBS%)
-	  alldeplibs=yes
+	  alldeplibs=:
 	  continue
 	  ;;
 	esac # case $deplib
 
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
+	$found || test -f "$lib" \
+	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+	  || func_fatal_error "'$lib' is not a valid libtool archive"
 
 	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
+	ladir=$func_dirname_result
 
 	dlname=
 	dlopen=
@@ -6430,19 +7876,19 @@ func_mode_link ()
 	  done
 	fi
 	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	if test lib,link = "$linkmode,$pass" ||
+	   test prog,scan = "$linkmode,$pass" ||
+	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
 	  test -n "$dlopen" && func_append dlfiles " $dlopen"
 	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
-	if test "$pass" = conv; then
+	if test conv = "$pass"; then
 	  # Only check for convenience libraries
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
+	      func_fatal_error "cannot find name of link library for '$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
@@ -6450,15 +7896,15 @@ func_mode_link ()
 	    tmp_libs=
 	    for deplib in $dependency_libs; do
 	      deplibs="$deplib $deplibs"
-	      if $opt_preserve_dup_deps ; then
+	      if $opt_preserve_dup_deps; then
 		case "$tmp_libs " in
 		*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 		esac
 	      fi
 	      func_append tmp_libs " $deplib"
 	    done
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
+	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
+	    func_fatal_error "'$lib' is not a convenience library"
 	  fi
 	  continue
 	fi # $pass = conv
@@ -6467,26 +7913,26 @@ func_mode_link ()
 	# Get the name of the library we link against.
 	linklib=
 	if test -n "$old_library" &&
-	   { test "$prefer_static_libs" = yes ||
-	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	   { test yes = "$prefer_static_libs" ||
+	     test built,no = "$prefer_static_libs,$installed"; }; then
 	  linklib=$old_library
 	else
 	  for l in $old_library $library_names; do
-	    linklib="$l"
+	    linklib=$l
 	  done
 	fi
 	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
+	  func_fatal_error "cannot find name of link library for '$lib'"
 	fi
 
 	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
+	if test dlopen = "$pass"; then
+	  test -z "$libdir" \
+	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
 	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
+	     test yes != "$dlopen_support" ||
+	     test no = "$build_libtool_libs"
+	  then
 	    # If there is no dlname, no dlopen support or we're linking
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
@@ -6500,40 +7946,40 @@ func_mode_link ()
 
 	# We need an absolute path.
 	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "cannot determine absolute directory name of '$ladir'"
 	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
+	    abs_ladir=$ladir
 	  fi
 	  ;;
 	esac
 	func_basename "$lib"
-	laname="$func_basename_result"
+	laname=$func_basename_result
 
 	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
+	if test yes = "$installed"; then
 	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
+	    func_warning "library '$lib' was moved."
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    libdir=$abs_ladir
 	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
+	    dir=$lt_sysroot$libdir
+	    absdir=$lt_sysroot$libdir
 	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
 	else
 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
+	    dir=$ladir
+	    absdir=$abs_ladir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
+	    dir=$ladir/$objdir
+	    absdir=$abs_ladir/$objdir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  fi
@@ -6542,11 +7988,11 @@ func_mode_link ()
 	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	if test dlpreopen = "$pass"; then
+	  if test -z "$libdir" && test prog = "$linkmode"; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
 	  fi
-	  case "$host" in
+	  case $host in
 	    # special handling for platforms with PE-DLLs.
 	    *cygwin* | *mingw* | *cegcc* )
 	      # Linker will automatically link against shared library if both
@@ -6590,9 +8036,9 @@ func_mode_link ()
 
 	if test -z "$libdir"; then
 	  # Link the convenience library
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
+	  elif test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$dir/$old_library $compile_deplibs"
 	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
 	  else
@@ -6602,14 +8048,14 @@ func_mode_link ()
 	fi
 
 
-	if test "$linkmode" = prog && test "$pass" != link; then
+	if test prog = "$linkmode" && test link != "$pass"; then
 	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
+	  linkalldeplibs=false
+	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
+	     test no = "$build_libtool_libs"; then
+	    linkalldeplibs=:
 	  fi
 
 	  tmp_libs=
@@ -6621,14 +8067,14 @@ func_mode_link ()
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
+	    if $linkalldeplibs; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      # Need to hardcode shared library paths
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
@@ -6638,15 +8084,15 @@ func_mode_link ()
 	  continue
 	fi # $linkmode = prog...
 
-	if test "$linkmode,$pass" = "prog,link"; then
+	if test prog,link = "$linkmode,$pass"; then
 	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	     { { test no = "$prefer_static_libs" ||
+	         test built,yes = "$prefer_static_libs,$installed"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
 	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
+	      case $temp_rpath: in
 	      *"$absdir:"*) ;;
 	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
@@ -6675,9 +8121,9 @@ func_mode_link ()
 	    esac
 	  fi # $linkmode,$pass = prog,link...
 
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
+	  if $alldeplibs &&
+	     { test pass_all = "$deplibs_check_method" ||
+	       { test yes = "$build_libtool_libs" &&
 		 test -n "$library_names"; }; }; then
 	    # We only need to search for static libraries
 	    continue
@@ -6686,19 +8132,19 @@ func_mode_link ()
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
+	if test built = "$use_static_libs" && test yes = "$installed"; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
 	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
+	  *cygwin* | *mingw* | *cegcc* | *os2*)
 	      # No point in relinking DLLs because paths are not encoded
 	      func_append notinst_deplibs " $lib"
 	      need_relink=no
 	    ;;
 	  *)
-	    if test "$installed" = no; then
+	    if test no = "$installed"; then
 	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
@@ -6708,24 +8154,24 @@ func_mode_link ()
 
 	  # Warn about portability, can't link against -module's on some
 	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
+	  dlopenmodule=
 	  for dlpremoduletest in $dlprefiles; do
 	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
+	      dlopenmodule=$dlpremoduletest
 	      break
 	    fi
 	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
 	    echo
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
 	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
 	    $ECHO "*** $linklib is not portable!"
 	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
+	  if test lib = "$linkmode" &&
+	     test yes = "$hardcode_into_libs"; then
 	    # Hardcode the library path.
 	    # Skip directories that are in the system default run-time
 	    # search path.
@@ -6753,43 +8199,43 @@ func_mode_link ()
 	    # figure out the soname
 	    set dummy $library_names
 	    shift
-	    realname="$1"
+	    realname=$1
 	    shift
 	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
-	      soname="$dlname"
+	      soname=$dlname
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
+	      *cygwin* | mingw* | *cegcc* | *os2*)
 	        func_arith $current - $age
 		major=$func_arith_result
-		versuffix="-$major"
+		versuffix=-$major
 		;;
 	      esac
 	      eval soname=\"$soname_spec\"
 	    else
-	      soname="$realname"
+	      soname=$realname
 	    fi
 
 	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
+	    soroot=$soname
 	    func_basename "$soroot"
-	    soname="$func_basename_result"
+	    soname=$func_basename_result
 	    func_stripname 'lib' '.dll' "$soname"
 	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_verbose "extracting exported symbol list from '$soname'"
 	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
+	      func_verbose "generating import library for '$soname'"
 	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
@@ -6797,58 +8243,58 @@ func_mode_link ()
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    lib_linked=yes
 	    case $hardcode_action in
 	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
+	      if test no = "$hardcode_direct"; then
+		add=$dir/$linklib
 		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
+		    *-*-unixware7*) add_dir=-L$dir ;;
 		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
+		    # if the lib is a (non-dlopened) module then we cannot
 		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
+			 $GREP ": [^:]* bundle" >/dev/null; then
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
+			if test -z "$old_library"; then
 			  echo
 			  echo "*** And there doesn't seem to be a static archive available"
 			  echo "*** The link will probably fail, sorry"
 			else
-			  add="$dir/$old_library"
+			  add=$dir/$old_library
 			fi
 		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
+			add=$dir/$old_library
 		      fi
 		    fi
 		esac
-	      elif test "$hardcode_minus_L" = no; then
+	      elif test no = "$hardcode_minus_L"; then
 		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
+		*-*-sunos*) add_shlibpath=$dir ;;
 		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add_dir=-L$dir
+		add=-l$name
+	      elif test no = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
 	      ;;
 	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$absdir"
+	      if test yes = "$hardcode_direct" &&
+	         test no = "$hardcode_direct_absolute"; then
+		add=$dir/$linklib
+	      elif test yes = "$hardcode_minus_L"; then
+		add_dir=-L$absdir
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
@@ -6857,10 +8303,10 @@ func_mode_link ()
 		      ;;
 		  esac
 		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add=-l$name
+	      elif test yes = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
@@ -6868,7 +8314,7 @@ func_mode_link ()
 	    *) lib_linked=no ;;
 	    esac
 
-	    if test "$lib_linked" != yes; then
+	    if test yes != "$lib_linked"; then
 	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
@@ -6878,15 +8324,15 @@ func_mode_link ()
 	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
 	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
+	      if test yes != "$hardcode_direct" &&
+		 test yes != "$hardcode_minus_L" &&
+		 test yes = "$hardcode_shlibpath_var"; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
 		*) func_append finalize_shlibpath "$libdir:" ;;
@@ -6895,33 +8341,33 @@ func_mode_link ()
 	    fi
 	  fi
 
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
+	    if test yes = "$hardcode_direct" &&
+	       test no = "$hardcode_direct_absolute"; then
+	      add=$libdir/$linklib
+	    elif test yes = "$hardcode_minus_L"; then
+	      add_dir=-L$libdir
+	      add=-l$name
+	    elif test yes = "$hardcode_shlibpath_var"; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
 	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
+	      add=-l$name
+	    elif test yes = "$hardcode_automatic"; then
 	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
+		 test -f "$inst_prefix_dir$libdir/$linklib"; then
+		add=$inst_prefix_dir$libdir/$linklib
 	      else
-		add="$libdir/$linklib"
+		add=$libdir/$linklib
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
+	      add_dir=-L$libdir
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
@@ -6930,10 +8376,10 @@ func_mode_link ()
 		    ;;
 		esac
 	      fi
-	      add="-l$name"
+	      add=-l$name
 	    fi
 
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
 	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
 	    else
@@ -6941,43 +8387,43 @@ func_mode_link ()
 	      test -n "$add" && deplibs="$add $deplibs"
 	    fi
 	  fi
-	elif test "$linkmode" = prog; then
+	elif test prog = "$linkmode"; then
 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
 	  # is not unsupported.  This is valid on all known static and
 	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
+	  if test unsupported != "$hardcode_direct"; then
+	    test -n "$old_library" && linklib=$old_library
 	    compile_deplibs="$dir/$linklib $compile_deplibs"
 	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
 	  else
 	    compile_deplibs="-l$name -L$dir $compile_deplibs"
 	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
 	  fi
-	elif test "$build_libtool_libs" = yes; then
+	elif test yes = "$build_libtool_libs"; then
 	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
+	  if test pass_all != "$deplibs_check_method"; then
 	    # We're trying link a shared library against a static one
 	    # but the system doesn't support it.
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
 	    echo
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
 	    echo "*** I have the capability to make that library automatically link in when"
 	    echo "*** you link to this library.  But I can only do this if you have a"
 	    echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
+	    if test yes = "$module"; then
 	      echo "*** But as you try to build a module library, libtool will still create "
 	      echo "*** a static module, that should work as long as the dlopening application"
 	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
 		echo
 		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+		echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	      fi
-	      if test "$build_old_libs" = no; then
+	      if test no = "$build_old_libs"; then
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -6990,11 +8436,11 @@ func_mode_link ()
 	  fi
 	fi # link shared/static library?
 
-	if test "$linkmode" = lib; then
+	if test lib = "$linkmode"; then
 	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
+	     { test yes != "$hardcode_into_libs" ||
+	       test yes = "$build_old_libs" ||
+	       test yes = "$link_static"; }; then
 	    # Extract -R from dependency_libs
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
@@ -7008,12 +8454,12 @@ func_mode_link ()
 	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
-	    dependency_libs="$temp_deplibs"
+	    dependency_libs=$temp_deplibs
 	  fi
 
 	  func_append newlib_search_path " $absdir"
 	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
@@ -7023,7 +8469,7 @@ func_mode_link ()
                    func_resolve_sysroot "$func_stripname_result";;
               *) func_resolve_sysroot "$deplib" ;;
             esac
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $func_resolve_sysroot_result "*)
                 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@@ -7032,12 +8478,12 @@ func_mode_link ()
 	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
-	  if test "$link_all_deplibs" != no; then
+	  if test no != "$link_all_deplibs"; then
 	    # Add the search paths of all dependency libraries
 	    for deplib in $dependency_libs; do
 	      path=
 	      case $deplib in
-	      -L*) path="$deplib" ;;
+	      -L*) path=$deplib ;;
 	      *.la)
 	        func_resolve_sysroot "$deplib"
 	        deplib=$func_resolve_sysroot_result
@@ -7045,12 +8491,12 @@ func_mode_link ()
 		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
+		    func_warning "cannot determine absolute directory name of '$dir'"
+		    absdir=$dir
 		  fi
 		  ;;
 		esac
@@ -7058,35 +8504,35 @@ func_mode_link ()
 		case $host in
 		*-*-darwin*)
 		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
+		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names"; then
+		    for tmp in $deplibrary_names; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+		    if test -f "$absdir/$objdir/$depdepl"; then
+		      depdepl=$absdir/$objdir/$depdepl
+		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
                       if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
 		      path=
 		    fi
 		  fi
 		  ;;
 		*)
-		  path="-L$absdir/$objdir"
+		  path=-L$absdir/$objdir
 		  ;;
 		esac
 		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		    func_fatal_error "'$deplib' is not a valid libtool archive"
 		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
+		    func_warning "'$deplib' seems to be moved"
 
-		  path="-L$absdir"
+		  path=-L$absdir
 		fi
 		;;
 	      esac
@@ -7098,23 +8544,23 @@ func_mode_link ()
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
+      if test link = "$pass"; then
+	if test prog = "$linkmode"; then
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
 	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
+      dependency_libs=$newdependency_libs
+      if test dlpreopen = "$pass"; then
 	# Link the dlpreopened libraries before other libraries
 	for deplib in $save_deplibs; do
 	  deplibs="$deplib $deplibs"
 	done
       fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
+      if test dlopen != "$pass"; then
+	test conv = "$pass" || {
 	  # Make sure lib_search_path contains only unique directories.
 	  lib_search_path=
 	  for dir in $newlib_search_path; do
@@ -7124,12 +8570,12 @@ func_mode_link ()
 	    esac
 	  done
 	  newlib_search_path=
-	fi
+	}
 
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
+	if test prog,link = "$linkmode,$pass"; then
 	  vars="compile_deplibs finalize_deplibs"
+	else
+	  vars=deplibs
 	fi
 	for var in $vars dependency_libs; do
 	  # Add libraries to $var in reverse order
@@ -7187,62 +8633,93 @@ func_mode_link ()
 	  eval $var=\"$tmp_libs\"
 	done # for var
       fi
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
       # Last step: remove runtime libs from dependency_libs
       # (they stay in deplibs)
       tmp_libs=
-      for i in $dependency_libs ; do
+      for i in $dependency_libs; do
 	case " $predeps $postdeps $compiler_lib_search_path " in
 	*" $i "*)
-	  i=""
+	  i=
 	  ;;
 	esac
-	if test -n "$i" ; then
+	if test -n "$i"; then
 	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
     done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
+    if test prog = "$linkmode"; then
+      dlfiles=$newdlfiles
     fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
     fi
 
     case $linkmode in
     oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for archives"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+	func_warning "'-l' and '-L' are ignored for archives" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
+	func_warning "'-rpath' is ignored for archives"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
+	func_warning "'-R' is ignored for archives"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
+	func_warning "'-version-info/-version-number' is ignored for archives"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
+	func_warning "'-release' is ignored for archives"
 
       test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
+	func_warning "'-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
-      oldlibs="$output"
+      oldlibs=$output
       func_append objs "$old_deplibs"
       ;;
 
     lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
+      # Make sure we only generate libraries of the form 'libNAME.la'.
       case $outputname in
       lib*)
 	func_stripname 'lib' '.la' "$outputname"
@@ -7251,10 +8728,10 @@ func_mode_link ()
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+	test no = "$module" \
+	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
 
-	if test "$need_lib_prefix" != no; then
+	if test no != "$need_lib_prefix"; then
 	  # Add the "lib" prefix for modules if required
 	  func_stripname '' '.la' "$outputname"
 	  name=$func_stripname_result
@@ -7268,8 +8745,8 @@ func_mode_link ()
       esac
 
       if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	if test pass_all != "$deplibs_check_method"; then
+	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
 	else
 	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
@@ -7278,21 +8755,21 @@ func_mode_link ()
 	fi
       fi
 
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
+      test no = "$dlself" \
+	|| func_warning "'-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
       shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
+      test 1 -lt "$#" \
+	&& func_warning "ignoring multiple '-rpath's for a libtool library"
 
-      install_libdir="$1"
+      install_libdir=$1
 
       oldlibs=
       if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
+	if test yes = "$build_libtool_libs"; then
 	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
+	  # Some compilers have problems with a '.al' extension so
 	  # convenience libraries should have the same extension an
 	  # archive normally would.
 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -7301,20 +8778,20 @@ func_mode_link ()
 	fi
 
 	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
 
 	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
+	  func_warning "'-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
+	save_ifs=$IFS; IFS=:
 	set dummy $vinfo 0 0 0
 	shift
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
+	  func_fatal_help "too many parameters to '-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -7322,45 +8799,45 @@ func_mode_link ()
 
 	case $vinfo_number in
 	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
+	  number_major=$1
+	  number_minor=$2
+	  number_revision=$3
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
 	  # and those that subtract age and use age as
 	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
+	  # that has an extra 1 added just for fun
 	  #
 	  case $version_type in
 	  # correct linux to gnu/linux during the next big refactor
-	  darwin|linux|osf|windows|none)
+	  darwin|freebsd-elf|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
+	    age=$number_minor
+	    revision=$number_revision
 	    ;;
-	  freebsd-aout|freebsd-elf|qnx|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
+	  freebsd-aout|qnx|sunos)
+	    current=$number_major
+	    revision=$number_minor
+	    age=0
 	    ;;
 	  irix|nonstopux)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
+	    age=$number_minor
+	    revision=$number_minor
 	    lt_irix_increment=no
 	    ;;
 	  *)
-	    func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+	    func_fatal_configuration "$modename: unknown library version type '$version_type'"
 	    ;;
 	  esac
 	  ;;
 	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
+	  current=$1
+	  revision=$2
+	  age=$3
 	  ;;
 	esac
 
@@ -7368,30 +8845,30 @@ func_mode_link ()
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "CURRENT '$current' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "REVISION '$revision' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' is greater than the current interface number '$current'"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -7406,26 +8883,36 @@ func_mode_link ()
 	  # verstring for coding it into the library header
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  # Darwin ld doesn't like 0 for these options...
 	  func_arith $current + 1
 	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
 	  ;;
 
 	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
+	  if test no = "$lt_irix_increment"; then
 	    func_arith $current - $age
 	  else
 	    func_arith $current - $age + 1
@@ -7436,69 +8923,74 @@ func_mode_link ()
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
 	  esac
-	  verstring="$verstring_prefix$major.$revision"
+	  verstring=$verstring_prefix$major.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $revision - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
+	    verstring=$verstring_prefix$major.$iface:$verstring
 	  done
 
-	  # Before this point, $major must not contain `.'.
+	  # Before this point, $major must not contain '.'.
 	  major=.$major
-	  versuffix="$major.$revision"
+	  versuffix=$major.$revision
 	  ;;
 
 	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	osf)
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
+	  versuffix=.$current.$age.$revision
+	  verstring=$current.$age.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $current - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
+	    verstring=$verstring:$iface.0
 	  done
 
 	  # Make executables depend on our current version.
-	  func_append verstring ":${current}.0"
+	  func_append verstring ":$current.0"
 	  ;;
 
 	qnx)
-	  major=".$current"
-	  versuffix=".$current"
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sco)
+	  major=.$current
+	  versuffix=.$current
 	  ;;
 
 	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	windows)
 	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
+	  # extension on DOS 8.3 file systems.
 	  func_arith $current - $age
 	  major=$func_arith_result
-	  versuffix="-$major"
+	  versuffix=-$major
 	  ;;
 
 	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  func_fatal_configuration "unknown library version type '$version_type'"
 	  ;;
 	esac
 
@@ -7512,42 +9004,45 @@ func_mode_link ()
 	    verstring=
 	    ;;
 	  *)
-	    verstring="0.0"
+	    verstring=0.0
 	    ;;
 	  esac
-	  if test "$need_version" = no; then
+	  if test no = "$need_version"; then
 	    versuffix=
 	  else
-	    versuffix=".0.0"
+	    versuffix=.0.0
 	  fi
 	fi
 
 	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
+	if test yes,no = "$avoid_version,$need_version"; then
 	  major=
 	  versuffix=
-	  verstring=""
+	  verstring=
 	fi
 
 	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
+	if test yes = "$allow_undefined"; then
+	  if test unsupported = "$allow_undefined_flag"; then
+	    if test yes = "$build_old_libs"; then
+	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+	      build_libtool_libs=no
+	    else
+	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+	    fi
 	  fi
 	else
 	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
+	  allow_undefined_flag=$no_undefined_flag
 	fi
 
       fi
 
-      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_generate_dlsyms "$libname" "$libname" :
       func_append libobjs " $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
+      test " " = "$libobjs" && libobjs=
 
-      if test "$opt_mode" != relink; then
+      if test relink != "$opt_mode"; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -7556,8 +9051,8 @@ func_mode_link ()
 	  case $p in
 	    *.$objext | *.gcno)
 	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+	       if test -n "$precious_files_regex"; then
 		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 		 then
 		   continue
@@ -7573,11 +9068,11 @@ func_mode_link ()
       fi
 
       # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
 	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
@@ -7598,13 +9093,13 @@ func_mode_link ()
 	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
 	  dependency_libs="$temp_xrpath $dependency_libs"
 	fi
       fi
 
       # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
+      old_dlfiles=$dlfiles
       dlfiles=
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
@@ -7614,7 +9109,7 @@ func_mode_link ()
       done
 
       # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
+      old_dlprefiles=$dlprefiles
       dlprefiles=
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
@@ -7623,7 +9118,7 @@ func_mode_link ()
 	esac
       done
 
-      if test "$build_libtool_libs" = yes; then
+      if test yes = "$build_libtool_libs"; then
 	if test -n "$rpath"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -7647,7 +9142,7 @@ func_mode_link ()
 	    ;;
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
+	    if test yes = "$build_libtool_need_lc"; then
 	      func_append deplibs " -lc"
 	    fi
 	    ;;
@@ -7663,9 +9158,9 @@ func_mode_link ()
 	# I'm not sure if I'm treating the release correctly.  I think
 	# release should show up in the -l (ie -lgmp5) so we don't want to
 	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
+	release=
+	versuffix=
+	major=
 	newdeplibs=
 	droppeddeps=no
 	case $deplibs_check_method in
@@ -7694,20 +9189,20 @@ EOF
 	      -l*)
 		func_stripname -l '' "$i"
 		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
 		    func_append newdeplibs " $i"
-		    i=""
+		    i=
 		    ;;
 		  esac
 		fi
-		if test -n "$i" ; then
+		if test -n "$i"; then
 		  libname=`eval "\\$ECHO \"$libname_spec\""`
 		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
@@ -7737,20 +9232,20 @@ EOF
 		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
 		      func_append newdeplibs " $i"
-		      i=""
+		      i=
 		      ;;
 		    esac
 		  fi
-		  if test -n "$i" ; then
+		  if test -n "$i"; then
 		    libname=`eval "\\$ECHO \"$libname_spec\""`
 		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
@@ -7787,24 +9282,24 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		if test -n "$file_magic_glob"; then
 		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 		else
 		  libnameglob=$libname
 		fi
-		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
+		  if test yes = "$want_nocaseglob"; then
 		    shopt -s nocaseglob
 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 		    $nocaseglob
@@ -7822,25 +9317,25 @@ EOF
 		      # We might still enter an endless loop, since a link
 		      # loop can be closed while we follow links,
 		      # but so what?
-		      potlib="$potent_lib"
+		      potlib=$potent_lib
 		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
 			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
 			func_append newdeplibs " $a_deplib"
-			a_deplib=""
+			a_deplib=
 			break 2
 		      fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7848,7 +9343,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7871,30 +9366,30 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    potlib=$potent_lib # see symlink-check above in file_magic test
 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
 		      func_append newdeplibs " $a_deplib"
-		      a_deplib=""
+		      a_deplib=
 		      break 2
 		    fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7902,7 +9397,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7918,18 +9413,18 @@ EOF
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
-	  newdeplibs=""
+	  newdeplibs=
 	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
+	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    for i in $predeps $postdeps; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
 	    done
 	  fi
 	  case $tmp_deplibs in
 	  *[!\	\ ]*)
 	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
+	    if test none = "$deplibs_check_method"; then
 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
 	      echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -7953,8 +9448,8 @@ EOF
 	  ;;
 	esac
 
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
+	if test yes = "$droppeddeps"; then
+	  if test yes = "$module"; then
 	    echo
 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
@@ -7963,12 +9458,12 @@ EOF
 	    if test -z "$global_symbol_pipe"; then
 	      echo
 	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
+	    if test no = "$build_old_libs"; then
+	      oldlibs=$output_objdir/$libname.$libext
 	      build_libtool_libs=module
 	      build_old_libs=yes
 	    else
@@ -7979,14 +9474,14 @@ EOF
 	    echo "*** automatically added whenever a program is linked with this library"
 	    echo "*** or is declared to -dlopen it."
 
-	    if test "$allow_undefined" = no; then
+	    if test no = "$allow_undefined"; then
 	      echo
 	      echo "*** Since this library must not contain undefined symbols,"
 	      echo "*** because either the platform does not support them or"
 	      echo "*** it was explicitly requested with -no-undefined,"
 	      echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
+	      if test no = "$build_old_libs"; then
+		oldlibs=$output_objdir/$libname.$libext
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -8032,7 +9527,7 @@ EOF
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      deplibs="$new_libs"
+      deplibs=$new_libs
 
       # All the library-specific variables (install_libdir is set above).
       library_names=
@@ -8040,25 +9535,25 @@ EOF
       dlname=
 
       # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	# Remove ${wl} instances when linking with ld.
+      if test yes = "$build_libtool_libs"; then
+	# Remove $wl instances when linking with ld.
 	# FIXME: should test the right _cmds variable.
 	case $archive_cmds in
 	  *\$LD\ *) wl= ;;
         esac
-	if test "$hardcode_into_libs" = yes; then
+	if test yes = "$hardcode_into_libs"; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+	  rpath=$finalize_rpath
+	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
 		func_replace_sysroot "$libdir"
 		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
+		  hardcode_libdirs=$libdir
 		else
 		  # Just accumulate the unique libdirs.
 		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8083,7 +9578,7 @@ EOF
 	  # Substitute the hardcoded libdirs into the rpath.
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
+	    libdir=$hardcode_libdirs
 	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
@@ -8097,8 +9592,8 @@ EOF
 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
 
-	shlibpath="$finalize_shlibpath"
-	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	shlibpath=$finalize_shlibpath
+	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -8108,19 +9603,19 @@ EOF
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
 	shift
-	realname="$1"
+	realname=$1
 	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
 	else
-	  soname="$realname"
+	  soname=$realname
 	fi
 	if test -z "$dlname"; then
 	  dlname=$soname
 	fi
 
-	lib="$output_objdir/$realname"
+	lib=$output_objdir/$realname
 	linknames=
 	for link
 	do
@@ -8134,7 +9629,7 @@ EOF
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
+	  export_symbols=$output_objdir/$libname.uexp
 	  func_append delfiles " $export_symbols"
 	fi
 
@@ -8143,31 +9638,31 @@ EOF
 	cygwin* | mingw* | cegcc*)
 	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
 	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	    func_dll_def_p "$export_symbols" || {
 	      # and it's NOT already a .def file. Must figure out
 	      # which of the given symbols are data symbols and tag
 	      # them as such. So, trigger use of export_symbols_cmds.
 	      # export_symbols gets reassigned inside the "prepare
 	      # the list of exported symbols" if statement, so the
 	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
+	      orig_export_symbols=$export_symbols
 	      export_symbols=
 	      always_export_symbols=yes
-	    fi
+	    }
 	  fi
 	  ;;
 	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
+	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for '$libname.la'"
+	    export_symbols=$output_objdir/$libname.exp
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd1 in $cmds; do
-	      IFS="$save_ifs"
+	      IFS=$save_ifs
 	      # Take the normal branch if the nm_file_list_spec branch
 	      # doesn't work or if tool conversion is not needed.
 	      case $nm_file_list_spec~$to_tool_file_cmd in
@@ -8181,7 +9676,7 @@ EOF
 		  try_normal_branch=no
 		  ;;
 	      esac
-	      if test "$try_normal_branch" = yes \
+	      if test yes = "$try_normal_branch" \
 		 && { test "$len" -lt "$max_cmd_len" \
 		      || test "$max_cmd_len" -le -1; }
 	      then
@@ -8192,7 +9687,7 @@ EOF
 		output_la=$func_basename_result
 		save_libobjs=$libobjs
 		save_output=$output
-		output=${output_objdir}/${output_la}.nm
+		output=$output_objdir/$output_la.nm
 		func_to_tool_file "$output"
 		libobjs=$nm_file_list_spec$func_to_tool_file_result
 		func_append delfiles " $output"
@@ -8215,8 +9710,8 @@ EOF
 		break
 	      fi
 	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	    IFS=$save_ifs
+	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
@@ -8224,16 +9719,16 @@ EOF
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  tmp_export_symbols=$export_symbols
+	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
 	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # 's' commands, which not all seds can handle. GNU sed should be fine
 	  # though. Also, the filter scales superlinearly with the number of
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
@@ -8252,11 +9747,11 @@ EOF
 	    ;;
 	  esac
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
 
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
+	    test yes = "$compiler_needs_object" &&
 	    test -z "$libobjs"; then
 	    # extract the archives, so we have objects to list.
 	    # TODO: could optimize this to just extract one archive.
@@ -8267,7 +9762,7 @@ EOF
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 	    test "X$libobjs" = "X " && libobjs=
 	  else
-	    gentop="$output_objdir/${outputname}x"
+	    gentop=$output_objdir/${outputname}x
 	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
@@ -8276,18 +9771,18 @@ EOF
 	  fi
 	fi
 
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
+	if test yes = "$module" && test -n "$module_cmds"; then
 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	    eval test_cmds=\"$module_expsym_cmds\"
 	    cmds=$module_expsym_cmds
@@ -8305,7 +9800,7 @@ EOF
 	  fi
 	fi
 
-	if test "X$skipped_export" != "X:" &&
+	if test : != "$skipped_export" &&
 	   func_len " $test_cmds" &&
 	   len=$func_len_result &&
 	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -8338,8 +9833,8 @@ EOF
 	  last_robj=
 	  k=1
 
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
+	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+	    output=$output_objdir/$output_la.lnkscript
 	    func_verbose "creating GNU ld script: $output"
 	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
@@ -8351,14 +9846,14 @@ EOF
 	    func_append delfiles " $output"
 	    func_to_tool_file "$output"
 	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
+	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+	    output=$output_objdir/$output_la.lnk
 	    func_verbose "creating linker input file list: $output"
 	    : > $output
 	    set x $save_libobjs
 	    shift
 	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
+	    if test yes = "$compiler_needs_object"; then
 	      firstobj="$1 "
 	      shift
 	    fi
@@ -8373,7 +9868,7 @@ EOF
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
+	      output=$output_objdir/$output_la-$k.$objext
 	      eval test_cmds=\"$reload_cmds\"
 	      func_len " $test_cmds"
 	      len0=$func_len_result
@@ -8385,13 +9880,13 @@ EOF
 		func_len " $obj"
 		func_arith $len + $func_len_result
 		len=$func_arith_result
-		if test "X$objlist" = X ||
+		if test -z "$objlist" ||
 		   test "$len" -lt "$max_cmd_len"; then
 		  func_append objlist " $obj"
 		else
 		  # The command $test_cmds is almost too long, add a
 		  # command to the queue.
-		  if test "$k" -eq 1 ; then
+		  if test 1 -eq "$k"; then
 		    # The first file doesn't have a previous command to add.
 		    reload_objs=$objlist
 		    eval concat_cmds=\"$reload_cmds\"
@@ -8401,10 +9896,10 @@ EOF
 		    reload_objs="$objlist $last_robj"
 		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  last_robj=$output_objdir/$output_la-$k.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
+		  output=$output_objdir/$output_la-$k.$objext
 		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
@@ -8416,9 +9911,9 @@ EOF
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
 	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
 	      func_append delfiles " $output"
 
@@ -8426,9 +9921,9 @@ EOF
 	      output=
 	    fi
 
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
+	    ${skipped_export-false} && {
+	      func_verbose "generating symbol list for '$libname.la'"
+	      export_symbols=$output_objdir/$libname.exp
 	      $opt_dry_run || $RM $export_symbols
 	      libobjs=$output
 	      # Append the command to create the export file.
@@ -8437,16 +9932,16 @@ EOF
 	      if test -n "$last_robj"; then
 		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	    fi
+	    }
 
 	    test -n "$save_libobjs" &&
 	      func_verbose "creating a temporary reloadable object file: $output"
 
 	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
+	      IFS=$save_ifs
+	      $opt_quiet || {
 		  func_quote_for_expand "$cmd"
 		  eval "func_echo $func_quote_for_expand_result"
 	      }
@@ -8454,7 +9949,7 @@ EOF
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
+		if test relink = "$opt_mode"; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -8463,7 +9958,7 @@ EOF
 		exit $lt_exit
 	      }
 	    done
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 
 	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -8471,18 +9966,18 @@ EOF
 	    fi
 	  fi
 
-          if ${skipped_export-false}; then
+          ${skipped_export-false} && {
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      tmp_export_symbols=$export_symbols
+	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
 	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # 's' commands, which not all seds can handle. GNU sed should be fine
 	      # though. Also, the filter scales superlinearly with the number of
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
@@ -8491,7 +9986,7 @@ EOF
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
-	  fi
+	  }
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -8505,7 +10000,7 @@ EOF
 	  # value of $libobjs for piecewise linking.
 
 	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test yes = "$module" && test -n "$module_cmds"; then
 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	      cmds=$module_expsym_cmds
 	    else
@@ -8527,7 +10022,7 @@ EOF
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -8535,11 +10030,12 @@ EOF
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
-	save_ifs="$IFS"; IFS='~'
+	save_ifs=$IFS; IFS='~'
 	for cmd in $cmds; do
-	  IFS="$save_ifs"
+	  IFS=$sp$nl
 	  eval cmd=\"$cmd\"
-	  $opt_silent || {
+	  IFS=$save_ifs
+	  $opt_quiet || {
 	    func_quote_for_expand "$cmd"
 	    eval "func_echo $func_quote_for_expand_result"
 	  }
@@ -8547,7 +10043,7 @@ EOF
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
+	    if test relink = "$opt_mode"; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -8556,10 +10052,10 @@ EOF
 	    exit $lt_exit
 	  }
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -8579,39 +10075,39 @@ EOF
 	done
 
 	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
+	if test yes = "$module" || test yes = "$export_dynamic"; then
 	  # On all known operating systems, these are identical.
-	  dlname="$soname"
+	  dlname=$soname
 	fi
       fi
       ;;
 
     obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for objects"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+	func_warning "'-l' and '-L' are ignored for objects" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
+	func_warning "'-rpath' is ignored for objects"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
+	func_warning "'-R' is ignored for objects"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
+	func_warning "'-version-info' is ignored for objects"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
+	func_warning "'-release' is ignored for objects"
 
       case $output in
       *.lo)
 	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
 
 	libobj=$output
 	func_lo2o "$libobj"
@@ -8619,7 +10115,7 @@ EOF
 	;;
       *)
 	libobj=
-	obj="$output"
+	obj=$output
 	;;
       esac
 
@@ -8632,17 +10128,19 @@ EOF
       # the extraction.
       reload_conv_objs=
       gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD[\ \$]*) wl= ;;
+      esac
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
 	else
-	  gentop="$output_objdir/${obj}x"
+	  gentop=$output_objdir/${obj}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
@@ -8651,12 +10149,12 @@ EOF
       fi
 
       # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
 
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
 
-      output="$obj"
+      output=$obj
       func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
@@ -8668,7 +10166,7 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$build_libtool_libs" != yes; then
+      test yes = "$build_libtool_libs" || {
 	if test -n "$gentop"; then
 	  func_show_eval '${RM}r "$gentop"'
 	fi
@@ -8678,12 +10176,12 @@ EOF
 	# $show "echo timestamp > $libobj"
 	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
-      fi
+      }
 
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
+      if test -n "$pic_flag" || test default != "$pic_mode"; then
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
+	output=$libobj
 	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
@@ -8700,16 +10198,14 @@ EOF
 	          output=$func_stripname_result.exe;;
       esac
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
+	func_warning "'-version-info' is ignored for programs"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
+	func_warning "'-release' is ignored for programs"
 
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+      $preload \
+	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
@@ -8723,11 +10219,11 @@ EOF
       *-*-darwin*)
 	# Don't allow lazy linking, it breaks C++ global constructors
 	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
+	if test CXX = "$tagname"; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      func_append compile_command " ${wl}-bind_at_load"
-	      func_append finalize_command " ${wl}-bind_at_load"
+	      func_append compile_command " $wl-bind_at_load"
+	      func_append finalize_command " $wl-bind_at_load"
 	    ;;
 	  esac
 	fi
@@ -8763,7 +10259,7 @@ EOF
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      compile_deplibs="$new_libs"
+      compile_deplibs=$new_libs
 
 
       func_append compile_command " $compile_deplibs"
@@ -8787,7 +10283,7 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8810,7 +10306,7 @@ EOF
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
@@ -8827,10 +10323,10 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      compile_rpath="$rpath"
+      compile_rpath=$rpath
 
       rpath=
       hardcode_libdirs=
@@ -8838,7 +10334,7 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8863,45 +10359,43 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      finalize_rpath="$rpath"
+      finalize_rpath=$rpath
 
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+      if test -n "$libobjs" && test yes = "$build_old_libs"; then
 	# Transform all the library objects into standard objects.
 	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+      func_generate_dlsyms "$outputname" "@PROGRAM@" false
 
       # template prelinking step
       if test -n "$prelink_cmds"; then
 	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      wrappers_required=yes
+      wrappers_required=:
       case $host in
       *cegcc* | *mingw32ce*)
         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
+        wrappers_required=false
         ;;
       *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
+        test yes = "$build_libtool_libs" || wrappers_required=false
         ;;
       *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
         fi
         ;;
       esac
-      if test "$wrappers_required" = no; then
+      $wrappers_required || {
 	# Replace the output file specification.
 	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
+	link_command=$compile_command$compile_rpath
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
@@ -8914,12 +10408,12 @@ EOF
 	fi
 
 	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	if test -f "$output_objdir/${outputname}S.$objext"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
 	fi
 
 	exit $exit_status
-      fi
+      }
 
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -8949,9 +10443,9 @@ EOF
 	fi
       fi
 
-      if test "$no_install" = yes; then
+      if test yes = "$no_install"; then
 	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
+	link_command=$compile_var$compile_command$compile_rpath
 	# Replace the output file specification.
 	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
@@ -8968,27 +10462,28 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
+      case $hardcode_action,$fast_install in
+        relink,*)
+	  # Fast installation is not supported
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
 
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
+	  func_warning "this platform does not like uninstalled shared libraries"
+	  func_warning "'$output' will be relinked during installation"
+	  ;;
+        *,yes)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+	*,no)
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+	*,needless)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=
+          ;;
+      esac
 
       # Replace the output file specification.
       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -9045,8 +10540,8 @@ EOF
 	    func_dirname_and_basename "$output" "" "."
 	    output_name=$func_basename_result
 	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
+	    cwrappersource=$output_path/$objdir/lt-$output_name.c
+	    cwrapper=$output_path/$output_name.exe
 	    $RM $cwrappersource $cwrapper
 	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
@@ -9067,7 +10562,7 @@ EOF
 	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
+	      if test "x$build" = "x$host"; then
 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9090,25 +10585,27 @@ EOF
     # See if we need to build an old-fashioned archive.
     for oldlib in $oldlibs; do
 
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
+      case $build_libtool_libs in
+        convenience)
+	  oldobjs="$libobjs_save $symfileobj"
+	  addlibs=$convenience
 	  build_libtool_libs=no
-	else
+	  ;;
+	module)
+	  oldobjs=$libobjs_save
+	  addlibs=$old_convenience
+	  build_libtool_libs=no
+          ;;
+	*)
 	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    func_append oldobjs " $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
+	  $preload && test -f "$symfileobj" \
+	    && func_append oldobjs " $symfileobj"
+	  addlibs=$old_convenience
+	  ;;
+      esac
 
       if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
+	gentop=$output_objdir/${outputname}x
 	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
@@ -9116,13 +10613,13 @@ EOF
       fi
 
       # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
 	cmds=$old_archive_from_new_cmds
       else
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -9143,7 +10640,7 @@ EOF
 	  :
 	else
 	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
@@ -9152,7 +10649,7 @@ EOF
 	  for obj in $save_oldobjs
 	  do
 	    func_basename "$obj"
-	    objbase="$func_basename_result"
+	    objbase=$func_basename_result
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -9221,18 +10718,18 @@ EOF
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
+	      if test "$obj" = "$last_oldobj"; then
 		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
 	      objlist=
 	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
 	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
+	  if test -z "$oldobjs"; then
 	    eval cmds=\"\$concat_cmds\"
 	  else
 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -9249,7 +10746,7 @@ EOF
     case $output in
     *.la)
       old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      test yes = "$build_old_libs" && old_library=$libname.$libext
       func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
@@ -9264,31 +10761,31 @@ EOF
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
+      if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
 
       # Only create the output if not a dry run.
       $opt_dry_run || {
 	for installed in no yes; do
-	  if test "$installed" = yes; then
+	  if test yes = "$installed"; then
 	    if test -z "$install_libdir"; then
 	      break
 	    fi
-	    output="$output_objdir/$outputname"i
+	    output=$output_objdir/${outputname}i
 	    # Replace all uninstalled libtool libraries with the installed ones
 	    newdependency_libs=
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
 		func_basename "$deplib"
-		name="$func_basename_result"
+		name=$func_basename_result
 		func_resolve_sysroot "$deplib"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  func_fatal_error "'$deplib' is not a valid libtool archive"
 		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      -L*)
@@ -9304,23 +10801,23 @@ EOF
 	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
-	    dependency_libs="$newdependency_libs"
+	    dependency_libs=$newdependency_libs
 	    newdlfiles=
 
 	    for lib in $dlfiles; do
 	      case $lib in
 	      *.la)
 	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
@@ -9330,34 +10827,34 @@ EOF
 		# didn't already link the preopened objects directly into
 		# the library:
 		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  else
 	    newdlfiles=
 	    for lib in $dlfiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlfiles " $abs"
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlprefiles " $abs"
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
@@ -9373,10 +10870,9 @@ EOF
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 	      # If a -bindir argument was supplied, place the dll there.
-	      if test "x$bindir" != x ;
-	      then
+	      if test -n "$bindir"; then
 		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
+		tdlname=$func_relative_path_result/$dlname
 	      else
 		# Otherwise fall back on heuristic.
 		tdlname=../bin/$dlname
@@ -9385,7 +10881,7 @@ EOF
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -9399,7 +10895,7 @@ library_names='$library_names'
 # The name of the static archive.
 old_library='$old_library'
 
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
 inherited_linker_flags='$new_inherited_linker_flags'
 
 # Libraries that this one depends upon.
@@ -9425,7 +10921,7 @@ dlpreopen='$dlprefiles'
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
+	  if test no,yes = "$installed,$need_relink"; then
 	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
@@ -9440,27 +10936,29 @@ relink_command=\"$relink_command\""
     exit $EXIT_SUCCESS
 }
 
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
 
 
 # func_mode_uninstall arg...
 func_mode_uninstall ()
 {
-    $opt_debug
-    RM="$nonopt"
+    $debug_cmd
+
+    RM=$nonopt
     files=
-    rmforce=
+    rmforce=false
     exit_status=0
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     for arg
     do
       case $arg in
-      -f) func_append RM " $arg"; rmforce=yes ;;
+      -f) func_append RM " $arg"; rmforce=: ;;
       -*) func_append RM " $arg" ;;
       *) func_append files " $arg" ;;
       esac
@@ -9473,18 +10971,18 @@ func_mode_uninstall ()
 
     for file in $files; do
       func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
+      dir=$func_dirname_result
+      if test . = "$dir"; then
+	odir=$objdir
       else
-	odir="$dir/$objdir"
+	odir=$dir/$objdir
       fi
       func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
 
       # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
+      if test clean = "$opt_mode"; then
 	case " $rmdirs " in
 	  *" $odir "*) ;;
 	  *) func_append rmdirs " $odir" ;;
@@ -9499,11 +10997,11 @@ func_mode_uninstall ()
       elif test -d "$file"; then
 	exit_status=1
 	continue
-      elif test "$rmforce" = yes; then
+      elif $rmforce; then
 	continue
       fi
 
-      rmfiles="$file"
+      rmfiles=$file
 
       case $name in
       *.la)
@@ -9517,7 +11015,7 @@ func_mode_uninstall ()
 	  done
 	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$opt_mode" in
+	  case $opt_mode in
 	  clean)
 	    case " $library_names " in
 	    *" $dlname "*) ;;
@@ -9528,12 +11026,12 @@ func_mode_uninstall ()
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -9549,21 +11047,19 @@ func_mode_uninstall ()
 	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
+	  if test -n "$pic_object" && test none != "$pic_object"; then
 	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
+	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
 	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$opt_mode" = clean ; then
+	if test clean = "$opt_mode"; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -9590,12 +11086,12 @@ func_mode_uninstall ()
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+	    if test yes = "$fast_install" && test -n "$relink_command"; then
 	      func_append rmfiles " $odir/lt-$name"
 	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      func_append rmfiles " $odir/lt-${noexename}.c"
+	    if test "X$noexename" != "X$name"; then
+	      func_append rmfiles " $odir/lt-$noexename.c"
 	    fi
 	  fi
 	fi
@@ -9604,7 +11100,7 @@ func_mode_uninstall ()
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
 
-    # Try to remove the ${objdir}s in the directories where we deleted files
+    # Try to remove the $objdir's in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
 	func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -9614,16 +11110,17 @@ func_mode_uninstall ()
     exit $exit_status
 }
 
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
 
 test -z "$opt_mode" && {
-  help="$generic_help"
+  help=$generic_help
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
+  func_fatal_help "invalid operation mode '$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
@@ -9634,7 +11131,7 @@ exit $exit_status
 
 
 # The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
+# where we disable both kinds of libraries.  Given conflicting
 # choices, we go for a static library, that is the most portable,
 # since we can't tell whether shared libraries were disabled because
 # the user asked for that or because the platform doesn't support
@@ -9657,5 +11154,3 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 # mode:shell-script
 # sh-indentation:2
 # End:
-# vi:sw=2
-
diff --git a/m4/ax_lib_gdal.m4 b/m4/ax_lib_gdal.m4
new file mode 100755
index 0000000..0980c0f
--- /dev/null
+++ b/m4/ax_lib_gdal.m4
@@ -0,0 +1,153 @@
+# ===========================================================================
+#        http://www.gnu.org/software/autoconf-archive/ax_lib_gdal.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_LIB_GDAL([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+#   This macro provides tests of availability of GDAL/OGR library of
+#   particular version or newer.
+#
+#   AX_LIB_GDAL macro takes only one argument which is optional. If there is
+#   no required version passed, then macro does not run version test.
+#
+#   The --with-gdal option takes complete path to gdal-config utility,
+#
+#   This macro calls AC_SUBST for:
+#
+#     GDAL_VERSION
+#     GDAL_CFLAGS
+#     GDAL_LDFLAGS
+#     GDAL_DEP_LDFLAGS
+#     GDAL_OGR_ENABLED
+#
+#   and AC_DEFINE for:
+#
+#     HAVE_GDAL
+#     HAVE_GDAL_OGR
+#
+# LICENSE
+#
+#   Copyright (c) 2011 Mateusz Loskot <mateusz at loskot.net>
+#   Copyright (c) 2011 Alessandro Candini <candini at meeo.it>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_LIB_GDAL],
+[
+    dnl If gdal-config path is not given in ---with-gdal option,
+    dnl check if it is present in the system anyway
+    AC_ARG_WITH([gdal],
+        AC_HELP_STRING([--with-gdal=@<:@ARG@:>@],
+            [Specify full path to gdal-config script]),
+        [ac_gdal_config_path=$withval],
+        [gdal_config_system=check])
+
+    dnl if gdal-config is present in the system, fill the ac_gdal_config_path variable with it full path
+    AS_IF([test "x$gdal_config_system" = xcheck],
+          [AC_PATH_PROG([GDAL_CONFIG], [gdal-config])],
+          [AC_PATH_PROG([GDAL_CONFIG], [gdal-config],
+              [no], [`dirname $ac_gdal_config_path 2> /dev/null`])]
+    )
+
+    if test ! -x "$GDAL_CONFIG"; then
+        AC_MSG_ERROR([gdal-config does not exist or it is not an exectuable file])
+            GDAL_CONFIG="no"
+            found_gdal="no"
+    fi
+
+    GDAL_VERSION=""
+    GDAL_CFLAGS=""
+    GDAL_LDFLAGS=""
+    GDAL_DEP_LDFLAGS=""
+    GDAL_OGR_ENABLED=""
+
+
+    dnl
+    dnl Check GDAL library (libgdal)
+    dnl
+
+    if test "$GDAL_CONFIG" != "no"; then
+        AC_MSG_CHECKING([for GDAL library])
+
+        GDAL_VERSION="`$GDAL_CONFIG --version`"
+        GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
+        GDAL_LDFLAGS="`$GDAL_CONFIG --libs`"
+        GDAL_DEP_LDFLAGS="`$GDAL_CONFIG --dep-libs`"
+
+        AC_DEFINE([HAVE_GDAL], [1], [Define to 1 if GDAL library are available])
+
+        found_gdal="yes"
+    else
+        found_gdal="no"
+    fi
+
+    AC_MSG_RESULT([$found_gdal])
+
+    if test "$found_gdal" = "yes"; then
+        AC_MSG_CHECKING([for OGR support in GDAL library])
+
+        GDAL_OGR_ENABLED="`$GDAL_CONFIG --ogr-enabled`"
+        AC_DEFINE([HAVE_GDAL_OGR], [1], [Define to 1 if GDAL library includes OGR support])
+
+        AC_MSG_RESULT([$GDAL_OGR_ENABLED])
+    fi
+
+    dnl
+    dnl Check if required version of GDAL is available
+    dnl
+
+    gdal_version_req=ifelse([$1], [], [], [$1])
+    if test "$found_gdal" = "yes" -a -n "$gdal_version_req"; then
+
+        AC_MSG_CHECKING([if GDAL version is >= $gdal_version_req])
+
+        dnl Decompose required version string of GDAL
+        dnl and calculate its number representation
+        gdal_version_req_major=`expr $gdal_version_req : '\([[0-9]]*\)'`
+        gdal_version_req_minor=`expr $gdal_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+        gdal_version_req_micro=`expr $gdal_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+        if test "x$gdal_version_req_micro" = "x"; then
+            gdal_version_req_micro="0"
+        fi
+
+        gdal_version_req_number=`expr $gdal_version_req_major \* 1000000 \
+                                   \+ $gdal_version_req_minor \* 1000 \
+                                   \+ $gdal_version_req_micro`
+
+        dnl Decompose version string of installed GDAL
+        dnl and calculate its number representation
+        gdal_version_major=`expr $GDAL_VERSION : '\([[0-9]]*\)'`
+        gdal_version_minor=`expr $GDAL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'`
+        gdal_version_micro=`expr $GDAL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+        if test "x$gdal_version_micro" = "x"; then
+            gdal_version_micro="0"
+        fi
+
+        gdal_version_number=`expr $gdal_version_major \* 1000000 \
+                                   \+ $gdal_version_minor \* 1000 \
+                                   \+ $gdal_version_micro`
+
+        gdal_version_check=`expr $gdal_version_number \>\= $gdal_version_req_number`
+        if test "$gdal_version_check" = "1"; then
+            AC_MSG_RESULT([yes])
+        else
+            AC_MSG_RESULT([no])
+	    AC_MSG_ERROR([GDAL $GDAL_VERSION found, but required version is $gdal_version_req])
+        fi
+    fi
+
+    AC_SUBST(GDAL_VERSION)
+    AC_SUBST(GDAL_CFLAGS)
+    AC_SUBST(GDAL_LDFLAGS)
+    AC_SUBST(GDAL_DEP_LDFLAGS)
+    AC_SUBST(GDAL_OGR_ENABLED)
+])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index d7c043f..10ab284 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1,8 +1,6 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
+#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -10,36 +8,30 @@
 # modifications, as long as this notice is preserved.
 
 m4_define([_LT_COPYING], [dnl
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
 #
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
 #
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ])
 
-# serial 57 LT_INIT
+# serial 58 LT_INIT
 
 
 # LT_PREREQ(VERSION)
@@ -67,7 +59,7 @@ esac
 # LT_INIT([OPTIONS])
 # ------------------
 AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 AC_BEFORE([$0], [LT_LANG])dnl
 AC_BEFORE([$0], [LT_OUTPUT])dnl
@@ -91,7 +83,7 @@ dnl Parse OPTIONS
 _LT_SET_OPTIONS([$0], [$1])
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -111,26 +103,43 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
 
 
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in @S|@*""; do
+      case $cc_temp in
+        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
 # _LT_CC_BASENAME(CC)
 # -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
 m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
 ])
 
 
 # _LT_FILEUTILS_DEFAULTS
 # ----------------------
 # It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
 m4_defun([_LT_FILEUTILS_DEFAULTS],
 [: ${CP="cp -f"}
 : ${MV="mv -f"}
@@ -177,15 +186,16 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
 m4_require([_LT_WITH_SYSROOT])dnl
+m4_require([_LT_CMD_TRUNCATE])dnl
 
 _LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 ])
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -198,7 +208,7 @@ aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -209,14 +219,14 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -269,14 +279,14 @@ no_glob_subst='s/\*/\\\*/g'
 
 # _LT_PROG_LTMAIN
 # ---------------
-# Note that this code is called both from `configure', and `config.status'
+# Note that this code is called both from 'configure', and 'config.status'
 # now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
 # so we pass a copy along to make sure it has a sensible value anyway.
 m4_defun([_LT_PROG_LTMAIN],
 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 ])# _LT_PROG_LTMAIN
 
 
@@ -286,7 +296,7 @@ ltmain="$ac_aux_dir/ltmain.sh"
 
 # So that we can recreate a full libtool script including additional
 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
+# in macros and then make a single call at the end using the 'libtool'
 # label.
 
 
@@ -421,8 +431,8 @@ m4_define([_lt_decl_all_varnames],
 
 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
 # ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'.  VARNAME
 # must have a single quote delimited value for this to work.
 m4_define([_LT_CONFIG_STATUS_DECLARE],
 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
@@ -446,7 +456,7 @@ m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
 # Output comment and list of tags supported by the script
 m4_defun([_LT_LIBTOOL_TAGS],
 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
+available_tags='_LT_TAGS'dnl
 ])
 
 
@@ -474,7 +484,7 @@ m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
 # _LT_LIBTOOL_CONFIG_VARS
 # -----------------------
 # Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
 # script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
 # section) are produced by _LT_LIBTOOL_TAG_VARS.
 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
@@ -500,8 +510,8 @@ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
 # Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
 # variables for single and double quote escaping we saved from calls
 # to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'.  Finally, any additional code accumulated
 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
 m4_defun([_LT_CONFIG_COMMANDS],
 [AC_PROVIDE_IFELSE([LT_OUTPUT],
@@ -547,7 +557,7 @@ for var in lt_decl_all_varnames([[ \
 ]], lt_decl_quote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -560,7 +570,7 @@ for var in lt_decl_all_varnames([[ \
 ]], lt_decl_dquote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -576,7 +586,7 @@ _LT_OUTPUT_LIBTOOL_INIT
 # Generate a child script FILE with all initialization necessary to
 # reuse the environment learned by the parent script, and make the
 # file executable.  If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins.  After this
+# '#!' sequence but before initialization text begins.  After this
 # macro, additional text can be appended to FILE to form the body of
 # the child script.  The macro ends with non-zero status if the
 # file could not be fully written (such as if the disk is full).
@@ -598,7 +608,7 @@ AS_SHELL_SANITIZE
 _AS_PREPARE
 exec AS_MESSAGE_FD>&1
 _ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 
 # LT_OUTPUT
@@ -621,7 +631,7 @@ exec AS_MESSAGE_LOG_FD>>config.log
 } >&AS_MESSAGE_LOG_FD
 
 lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
+'$as_me' creates a local libtool stub from the current configuration,
 for use in further configure time tests before the real libtool is
 generated.
 
@@ -643,7 +653,7 @@ Copyright (C) 2011 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
-while test $[#] != 0
+while test 0 != $[#]
 do
   case $[1] in
     --version | --v* | -V )
@@ -656,10 +666,10 @@ do
       lt_cl_silent=: ;;
 
     -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
 
     *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
   esac
   shift
 done
@@ -685,7 +695,7 @@ chmod +x "$CONFIG_LT"
 # open by configure.  Here we exec the FD to /dev/null, effectively closing
 # config.log, so it can be properly (re)opened and appended to by config.lt.
 lt_cl_success=:
-test "$silent" = yes &&
+test yes = "$silent" &&
   lt_config_lt_args="$lt_config_lt_args --quiet"
 exec AS_MESSAGE_LOG_FD>/dev/null
 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
@@ -705,27 +715,31 @@ m4_defun([_LT_CONFIG],
 _LT_CONFIG_SAVE_COMMANDS([
   m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
   m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
 _LT_COPYING
 _LT_LIBTOOL_TAGS
 
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
 # ### BEGIN LIBTOOL CONFIG
 _LT_LIBTOOL_CONFIG_VARS
 _LT_LIBTOOL_TAG_VARS
@@ -733,13 +747,24 @@ _LT_LIBTOOL_TAG_VARS
 
 _LT_EOF
 
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
   case $host_os in
   aix3*)
     cat <<\_LT_EOF >> "$cfgfile"
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -756,8 +781,6 @@ _LT_EOF
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  _LT_PROG_REPLACE_SHELLFNS
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
@@ -775,7 +798,6 @@ _LT_EOF
 [m4_if([$1], [], [
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'], [])
 ])dnl /_LT_CONFIG_SAVE_COMMANDS
@@ -974,7 +996,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 
     AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
       [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -992,7 +1014,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1010,7 +1032,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
 	[lt_cv_ld_exported_symbols_list=yes],
 	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
     ])
 
     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
@@ -1032,7 +1054,7 @@ _LT_EOF
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1042,32 +1064,32 @@ _LT_EOF
     ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]][[,.]]*)
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -1087,29 +1109,29 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
     m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
                   [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
   else
     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
     m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+[   if test yes != "$lt_cv_apple_cc_single_mod"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
     fi
 ],[])
   else
@@ -1129,7 +1151,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
 # Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
+if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
@@ -1147,7 +1169,7 @@ else
     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
   fi],[])
   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
   fi
   ])
   aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
@@ -1167,8 +1189,8 @@ m4_define([_LT_SHELL_INIT],
 # -----------------------
 # Find how we can fake an echo command that does not interpret backslash.
 # In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
 m4_defun([_LT_PROG_ECHO_BACKSLASH],
 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
@@ -1196,10 +1218,10 @@ fi
 # Invoke $ECHO with all args, space-separated.
 func_echo_all ()
 {
-    $ECHO "$*" 
+    $ECHO "$*"
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) AC_MSG_RESULT([printf]) ;;
   print*) AC_MSG_RESULT([print -r]) ;;
   *) AC_MSG_RESULT([cat]) ;;
@@ -1225,16 +1247,17 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
 AC_DEFUN([_LT_WITH_SYSROOT],
 [AC_MSG_CHECKING([for sysroot])
 AC_ARG_WITH([sysroot],
-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+  [Search for dependent libraries within DIR (or the compiler's sysroot
+   if not specified).])],
 [], [with_sysroot=no])
 
 dnl lt_sysroot will always be passed unquoted.  We quote it here
 dnl in case the user passed a directory name.
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -1244,14 +1267,14 @@ case ${with_sysroot} in #(
  no|'')
    ;; #(
  *)
-   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_RESULT([$with_sysroot])
    AC_MSG_ERROR([The sysroot must be an absolute path.])
    ;;
 esac
 
  AC_MSG_RESULT([${lt_sysroot:-no}])
 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
+[dependent libraries, and where our libraries should be installed.])])
 
 # _LT_ENABLE_LOCK
 # ---------------
@@ -1259,31 +1282,33 @@ m4_defun([_LT_ENABLE_LOCK],
 [AC_ARG_ENABLE([libtool-lock],
   [AS_HELP_STRING([--disable-libtool-lock],
     [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -1312,9 +1337,46 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1333,10 +1395,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 		;;
 	    esac
 	    ;;
-	  powerpc64le-*)
+	  powerpc64le-*linux*)
 	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  powerpc64-*)
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -1355,10 +1417,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*)
+	  powerpcle-*linux*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*)
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -1376,19 +1438,20 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
     [AC_LANG_PUSH(C)
      AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
      AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1396,7 +1459,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -1405,7 +1468,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -1421,7 +1484,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 ])# _LT_ENABLE_LOCK
 
 
@@ -1440,11 +1503,11 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
      [echo conftest.$ac_objext > conftest.lst
       lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
       AC_TRY_EVAL([lt_ar_try])
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	AC_TRY_EVAL([lt_ar_try])
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -1452,7 +1515,7 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
      ])
   ])
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -1483,7 +1546,7 @@ old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -1519,7 +1582,7 @@ AC_CACHE_CHECK([$1], [$2],
   [$2=no
    m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
+   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -1546,7 +1609,7 @@ AC_CACHE_CHECK([$1], [$2],
    $RM conftest*
 ])
 
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
     m4_if([$5], , :, [$5])
 else
     m4_if([$6], , :, [$6])
@@ -1568,7 +1631,7 @@ AC_DEFUN([_LT_LINKER_OPTION],
 m4_require([_LT_DECL_SED])dnl
 AC_CACHE_CHECK([$1], [$2],
   [$2=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $3"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -1587,10 +1650,10 @@ AC_CACHE_CHECK([$1], [$2],
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 ])
 
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
     m4_if([$4], , :, [$4])
 else
     m4_if([$5], , :, [$5])
@@ -1611,7 +1674,7 @@ AC_DEFUN([LT_CMD_MAX_LEN],
 AC_MSG_CHECKING([the maximum length of command line arguments])
 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -1651,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1702,22 +1765,22 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-	test undefined != "$lt_cv_sys_max_cmd_len"; then
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -1733,7 +1796,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
   esac
 ])
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
 else
   AC_MSG_RESULT(none)
@@ -1761,7 +1824,7 @@ m4_defun([_LT_HEADER_DLFCN],
 # ----------------------------------------------------------------
 m4_defun([_LT_TRY_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
+if test yes = "$cross_compiling"; then :
   [$4]
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -1808,9 +1871,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -1836,7 +1899,7 @@ int main ()
   return status;
 }]
 _LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -1857,7 +1920,7 @@ rm -fr conftest*
 # ------------------
 AC_DEFUN([LT_SYS_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
+if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -1867,44 +1930,52 @@ else
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ])
     ;;
 
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
   *)
     AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
+	  [lt_cv_dlopen=shl_load],
       [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
 	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
+	      [lt_cv_dlopen=dlopen],
 	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
 	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
 	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
 	      ])
 	    ])
 	  ])
@@ -1913,21 +1984,21 @@ else
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     AC_CACHE_CHECK([whether a program can dlopen itself],
@@ -1937,7 +2008,7 @@ else
 	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
     ])
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
 	  lt_cv_dlopen_self_static, [dnl
@@ -1947,9 +2018,9 @@ else
       ])
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -2041,8 +2112,8 @@ m4_defun([_LT_COMPILER_FILE_LOCKS],
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 _LT_COMPILER_C_O([$1])
 
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   AC_MSG_CHECKING([if we can lock with hard links])
   hard_links=yes
@@ -2052,8 +2123,8 @@ if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" !=
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+  if test no = "$hard_links"; then
+    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
     need_locks=warn
   fi
 else
@@ -2080,8 +2151,8 @@ objdir=$lt_cv_objdir
 _LT_DECL([], [objdir], [0],
          [The name of the directory that contains temporary libtool files])dnl
 m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+  [Define to the sub-directory where libtool stores uninstalled libraries.])
 ])# _LT_CHECK_OBJDIR
 
 
@@ -2093,15 +2164,15 @@ m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
 _LT_TAGVAR(hardcode_action, $1)=
 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
    test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
 
   # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
     # Linking always hardcodes the temporary library directory.
     _LT_TAGVAR(hardcode_action, $1)=relink
   else
@@ -2115,12 +2186,12 @@ else
 fi
 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
 
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -2144,7 +2215,7 @@ else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       AC_MSG_RESULT([yes])
@@ -2162,6 +2233,47 @@ _LT_DECL([], [striplib], [1])
 ])# _LT_CMD_STRIPLIB
 
 
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x at S|@2 in
+    x)
+        ;;
+    *:)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+        ;;
+    x:*)
+        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+        ;;
+    *)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
 # _LT_SYS_DYNAMIC_LINKER([TAG])
 # -----------------------------
 # PORTME Fill in your ld.so characteristics
@@ -2172,17 +2284,18 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_OBJDUMP])dnl
 m4_require([_LT_DECL_SED])dnl
 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
 	[], [
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -2198,28 +2311,35 @@ if test "$GCC" = yes; then
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -2233,7 +2353,7 @@ BEGIN {RS=" "; FS="/|\n";} {
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -2242,7 +2362,7 @@ fi])
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -2259,14 +2379,17 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[[4-9]]*)
@@ -2274,41 +2397,91 @@ aix[[4-9]]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[[01]] | aix4.[[01]].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -2318,18 +2491,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -2337,8 +2510,8 @@ beos*)
 bsdi[[45]]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -2350,7 +2523,7 @@ bsdi[[45]]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -2359,8 +2532,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -2376,17 +2549,17 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
 m4_if([$1], [],[
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -2395,8 +2568,8 @@ m4_if([$1], [],[
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -2423,7 +2596,7 @@ m4_if([$1], [],[
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -2436,8 +2609,8 @@ m4_if([$1], [],[
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -2450,7 +2623,7 @@ m4_if([$1], [],[
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -2463,8 +2636,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -2477,8 +2650,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2496,12 +2669,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -2531,10 +2705,10 @@ haiku*)
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -2552,14 +2726,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -2567,8 +2742,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -2577,8 +2752,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -2591,8 +2766,8 @@ interix[[3-9]]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2603,7 +2778,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -2611,8 +2786,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -2631,8 +2806,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -2641,13 +2816,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2672,7 +2867,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -2704,12 +2904,12 @@ netbsd*)
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -2719,7 +2919,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -2728,58 +2928,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -2790,8 +3000,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -2801,11 +3011,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -2813,8 +3023,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -2835,24 +3045,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -2870,7 +3080,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -2878,8 +3088,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2888,20 +3098,30 @@ uts4*)
   ;;
 esac
 AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
 _LT_DECL([], [variables_saved_for_relink], [1],
     [Variables whose values should be saved in libtool wrapper scripts and
     restored at link time])
@@ -2934,39 +3154,41 @@ _LT_DECL([], [hardcode_into_libs], [0],
     [Whether we should hardcode library paths into libraries])
 _LT_DECL([], [sys_lib_search_path_spec], [2],
     [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+    [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
 ])# _LT_SYS_DYNAMIC_LINKER
 
 
 # _LT_PATH_TOOL_PREFIX(TOOL)
 # --------------------------
-# find a file program which can recognize shared library
+# find a file program that can recognize shared library
 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
 [m4_require([_LT_DECL_EGREP])dnl
 AC_MSG_CHECKING([for $1])
 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 [case $MAGIC_CMD in
 [[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
 dnl $ac_dummy forces splitting on constant user-supplied paths.
 dnl POSIX.2 word splitting is done only on the output of word expansions,
 dnl not every word.  This closes a longstanding sh security hole.
   ac_dummy="m4_if([$2], , $PATH, [$2])"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+    if test -f "$ac_dir/$1"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -2989,11 +3211,11 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   AC_MSG_RESULT($MAGIC_CMD)
 else
@@ -3011,7 +3233,7 @@ dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
 
 # _LT_PATH_MAGIC
 # --------------
-# find a file program which can recognize a shared library
+# find a file program that can recognize a shared library
 m4_defun([_LT_PATH_MAGIC],
 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -3038,16 +3260,16 @@ m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
 AC_ARG_WITH([gnu-ld],
     [AS_HELP_STRING([--with-gnu-ld],
 	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
+    [test no = "$withval" || with_gnu_ld=yes],
     [with_gnu_ld=no])dnl
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   AC_MSG_CHECKING([for ld used by $CC])
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -3061,7 +3283,7 @@ if test "$GCC" = yes; then
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -3072,37 +3294,37 @@ if test "$GCC" = yes; then
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
 AC_CACHE_VAL(lt_cv_path_LD,
 [if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi])
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   AC_MSG_RESULT($LD)
 else
@@ -3156,13 +3378,13 @@ esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -3173,6 +3395,43 @@ _LT_TAGDECL([], [reload_cmds], [2])dnl
 ])# _LT_CMD_RELOAD
 
 
+# _LT_PATH_DD
+# -----------
+# find a working dd
+m4_defun([_LT_PATH_DD],
+[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
+[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi])
+rm -f conftest.i conftest2.i conftest.out])
+])# _LT_PATH_DD
+
+
+# _LT_CMD_TRUNCATE
+# ----------------
+# find command to truncate a binary pipe
+m4_defun([_LT_CMD_TRUNCATE],
+[m4_require([_LT_PATH_DD])
+AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
+_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
+  [Command to truncate a binary pipe])
+])# _LT_CMD_TRUNCATE
+
+
 # _LT_CHECK_MAGIC_METHOD
 # ----------------------
 # how to check for library dependencies
@@ -3188,13 +3447,13 @@ lt_cv_deplibs_check_method='unknown'
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[[4-9]]*)
@@ -3221,8 +3480,7 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -3318,8 +3576,8 @@ newos6*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -3372,6 +3630,9 @@ sysv4 | sysv4.3*)
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 esac
 ])
 
@@ -3412,33 +3673,38 @@ AC_DEFUN([LT_PATH_NM],
 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -3449,21 +3715,21 @@ else
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
     # Let the user override the test.
   else
     AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -3471,8 +3737,8 @@ else
     esac
   fi
   AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -3518,8 +3784,8 @@ lt_cv_sharedlib_from_linklib_cmd,
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -3531,7 +3797,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 ])
@@ -3558,13 +3824,28 @@ AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool
     lt_cv_path_mainfest_tool=yes
   fi
   rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
 ])# _LT_PATH_MANIFEST_TOOL
 
 
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+  test DEF = "`$SED -n dnl
+    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
+    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
+    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
+    -e q dnl                          Only consider the first "real" line
+    $1`" dnl
+])# _LT_DLL_DEF_P
+
+
 # LT_LIB_M
 # --------
 # check for math library
@@ -3576,11 +3857,11 @@ case $host in
   # These system don't have libm, or don't need it
   ;;
 *-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
   ;;
 *)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  AC_CHECK_LIB(m, cos, LIBM=-lm)
   ;;
 esac
 AC_SUBST([LIBM])
@@ -3599,7 +3880,7 @@ m4_defun([_LT_COMPILER_NO_RTTI],
 
 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
@@ -3651,7 +3932,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   symcode='[[ABCDGISTW]]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[[ABCDEGRST]]'
   fi
   ;;
@@ -3684,14 +3965,44 @@ case `$NM -V 2>&1` in
   symcode='[[ABCDGIRSTW]]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -3709,21 +4020,24 @@ for ac_symprfx in "" "_"; do
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx]"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -3763,11 +4077,11 @@ _LT_EOF
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT@&t at _DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT@&t at _DLSYM_CONST
 #else
@@ -3793,7 +4107,7 @@ lt__PROGRAM__LTX_preloaded_symbols[[]] =
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -3813,9 +4127,9 @@ _LT_EOF
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -3836,7 +4150,7 @@ _LT_EOF
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -3863,12 +4177,16 @@ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
     [Take the output of nm and produce a listing of raw symbols and C names])
 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
     [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+    [Transform the output of nm into a list of symbols to manually relocate])
 _LT_DECL([global_symbol_to_c_name_address],
     [lt_cv_sys_global_symbol_to_c_name_address], [1],
     [Transform the output of nm in a C name address pair])
 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
     [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+    [The name lister interface])
 _LT_DECL([], [nm_file_list_spec], [1],
     [Specify filename containing input files for $NM])
 ]) # _LT_CMD_GLOBAL_SYMBOLS
@@ -3884,17 +4202,18 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)=
 
 m4_if([$1], [CXX], [
   # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
+  if test yes = "$GXX"; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
     aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -3905,8 +4224,8 @@ m4_if([$1], [CXX], [
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -3922,6 +4241,11 @@ m4_if([$1], [CXX], [
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
     darwin* | rhapsody*)
       # PIC is the default on this platform
@@ -3971,7 +4295,7 @@ m4_if([$1], [CXX], [
     case $host_os in
       aix[[4-9]]*)
 	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	  # AIX 5 now supports IA64 processor
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	else
@@ -4012,14 +4336,14 @@ m4_if([$1], [CXX], [
 	case $cc_basename in
 	  CC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
 	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	    fi
 	    ;;
 	  aCC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
 	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
@@ -4056,7 +4380,7 @@ m4_if([$1], [CXX], [
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	    ;;
 	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    # old Intel C++ for x86_64, which still supported -KPIC.
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -4201,17 +4525,18 @@ m4_if([$1], [CXX], [
   fi
 ],
 [
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -4222,8 +4547,8 @@ m4_if([$1], [CXX], [
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -4240,6 +4565,11 @@ m4_if([$1], [CXX], [
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -4310,7 +4640,7 @@ m4_if([$1], [CXX], [
     case $host_os in
     aix*)
       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       else
@@ -4318,11 +4648,30 @@ m4_if([$1], [CXX], [
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -4338,7 +4687,7 @@ m4_if([$1], [CXX], [
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -4349,7 +4698,7 @@ m4_if([$1], [CXX], [
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4374,6 +4723,12 @@ m4_if([$1], [CXX], [
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -4471,7 +4826,7 @@ m4_if([$1], [CXX], [
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
@@ -4500,7 +4855,7 @@ m4_if([$1], [CXX], [
   fi
 ])
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
@@ -4566,17 +4921,21 @@ m4_if([$1], [CXX], [
   case $host_os in
   aix[[4-9]]*)
     # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
+    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+    # Without the "-l" option, or with the "-B" option, AIX nm treats
+    # weak defined symbols like other global defined symbols, whereas
+    # GNU nm marks them as "W".
+    # While the 'weak' keyword is ignored in the Export File, we need
+    # it in the Import File for the 'aix-soname' feature, so we have
+    # to replace the "-B" option with "-P" for AIX nm.
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
     else
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
@@ -4625,9 +4984,9 @@ m4_if([$1], [CXX], [
   # included in the symbol list
   _LT_TAGVAR(include_expsyms, $1)=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -4643,7 +5002,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -4651,7 +5010,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
   linux* | k*bsd*-gnu | gnu*)
@@ -4664,7 +5023,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -4686,24 +5045,24 @@ dnl Note also adjust exclude_expsyms for C++ above.
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       _LT_TAGVAR(whole_archive_flag_spec, $1)=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -4716,7 +5075,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     case $host_os in
     aix[[3-9]]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
@@ -4735,7 +5094,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -4751,7 +5110,7 @@ _LT_EOF
 	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4761,7 +5120,7 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_TAGVAR(always_export_symbols, $1)=no
       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -4769,61 +5128,89 @@ _LT_EOF
       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
     interix[[3-9]]*)
       _LT_TAGVAR(hardcode_direct, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -4834,42 +5221,47 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
+	tcc*)
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -4883,8 +5275,8 @@ _LT_EOF
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -4902,8 +5294,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4915,7 +5307,7 @@ _LT_EOF
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -4930,9 +5322,9 @@ _LT_EOF
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -4949,15 +5341,15 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
     esac
 
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
       runpath_var=
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
       _LT_TAGVAR(export_dynamic_flag_spec, $1)=
@@ -4973,7 +5365,7 @@ _LT_EOF
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	_LT_TAGVAR(hardcode_direct, $1)=unsupported
@@ -4981,34 +5373,57 @@ _LT_EOF
       ;;
 
     aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
 	else
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
 	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
 	  ;;
 	esac
 
@@ -5027,13 +5442,21 @@ _LT_EOF
       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+	;;
+      esac
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[[012]]|aix4.[[012]].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -5052,62 +5475,80 @@ _LT_EOF
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
-	_LT_TAGVAR(link_all_deplibs, $1)=no
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
         _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
 	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
 	 _LT_SYS_MODULE_PATH_AIX([$1])
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	  fi
 	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 3 [...]
+	  else
+	    # used by -dlpreopen to get the symbols
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
 	fi
       fi
       ;;
@@ -5116,7 +5557,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -5146,16 +5587,17 @@ _LT_EOF
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -5164,18 +5606,18 @@ _LT_EOF
 	# Don't use ranlib
 	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -5184,7 +5626,7 @@ _LT_EOF
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -5234,33 +5676,33 @@ _LT_EOF
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_direct, $1)=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	_LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5268,25 +5710,25 @@ _LT_EOF
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 	m4_if($1, [], [
@@ -5294,14 +5736,14 @@ _LT_EOF
 	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
 	  _LT_LINKER_OPTION([if $CC understands -b],
 	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
 	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	case $host_cpu in
@@ -5312,7 +5754,7 @@ _LT_EOF
 	*)
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -5323,16 +5765,16 @@ _LT_EOF
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
 	# This should be the same for all languages, so no per-tag cache variable.
 	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
 	  [lt_cv_irix_exported_symbol],
-	  [save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	  [save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   AC_LINK_IFELSE(
 	     [AC_LANG_SOURCE(
 	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
@@ -5345,21 +5787,32 @@ _LT_EOF
       end]])])],
 	      [lt_cv_irix_exported_symbol=yes],
 	      [lt_cv_irix_exported_symbol=no])
-           LDFLAGS="$save_LDFLAGS"])
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+           LDFLAGS=$save_LDFLAGS])
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
+	_LT_TAGVAR(link_all_deplibs, $1)=no
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(inherit_rpath, $1)=yes
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
     netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
@@ -5374,7 +5827,7 @@ _LT_EOF
     newsos6)
       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
@@ -5382,27 +5835,19 @@ _LT_EOF
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	     ;;
-	   *)
-	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
 	fi
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5413,33 +5858,53 @@ _LT_EOF
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5450,24 +5915,24 @@ _LT_EOF
 
     solaris*)
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -5477,11 +5942,11 @@ _LT_EOF
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	fi
@@ -5491,10 +5956,10 @@ _LT_EOF
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -5543,43 +6008,43 @@ _LT_EOF
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -5594,17 +6059,17 @@ _LT_EOF
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
 	;;
       esac
     fi
   fi
 ])
 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
 
 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
 
@@ -5621,7 +6086,7 @@ x|xyes)
   # Assume -lc should be added
   _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $_LT_TAGVAR(archive_cmds, $1) in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -5701,12 +6166,12 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
     DIR into the resulting binary])
 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
     DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    "absolute", i.e impossible to change by setting $shlibpath_var if the
     library is relocated])
 _LT_TAGDECL([], [hardcode_minus_L], [0],
     [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -5747,10 +6212,10 @@ dnl    [Compiler flag to generate thread safe objects])
 # ------------------------
 # Ensure that the configuration variables for a C compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_C_CONFIG],
 [m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
+lt_save_CC=$CC
 AC_LANG_PUSH(C)
 
 # Source file extension for C test sources.
@@ -5790,18 +6255,18 @@ if test -n "$compiler"; then
   LT_SYS_DLOPEN_SELF
   _LT_CMD_STRIPLIB
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   AC_MSG_CHECKING([if libtool supports shared libraries])
   AC_MSG_RESULT([$can_build_shared])
 
   AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -5809,8 +6274,12 @@ if test -n "$compiler"; then
     ;;
 
   aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
     fi
     ;;
   esac
@@ -5818,13 +6287,13 @@ if test -n "$compiler"; then
 
   AC_MSG_CHECKING([whether to build static libraries])
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   AC_MSG_RESULT([$enable_static])
 
   _LT_CONFIG($1)
 fi
 AC_LANG_POP
-CC="$lt_save_CC"
+CC=$lt_save_CC
 ])# _LT_LANG_C_CONFIG
 
 
@@ -5832,14 +6301,14 @@ CC="$lt_save_CC"
 # --------------------------
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
+if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
   AC_PROG_CXXCPP
 else
   _lt_caught_CXX_error=yes
@@ -5881,7 +6350,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the CXX compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
+if test yes != "$_lt_caught_CXX_error"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="int some_variable = 0;"
 
@@ -5923,35 +6392,35 @@ if test "$_lt_caught_CXX_error" != yes; then
   if test -n "$compiler"; then
     # We don't want -fno-exception when compiling C++ code, so set the
     # no_builtin_flag separately
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
     else
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
     fi
 
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       # Set up default GNU C++ configuration
 
       LT_PATH_LD
 
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      if test yes = "$with_gnu_ld"; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 
         # If archive_cmds runs LD, not CC, wlarc should be empty
         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
+        wlarc='$wl'
 
         # ancient GNU ld didn't support --whole-archive et. al.
         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
 	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
         else
           _LT_TAGVAR(whole_archive_flag_spec, $1)=
         fi
@@ -5987,18 +6456,30 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=no
         ;;
       aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
+        if test ia64 = "$host_cpu"; then
           # On IA64, the linker does run time linking by default, so we don't
           # have to do anything special.
           aix_use_runtimelinking=no
           exp_sym_flag='-Bexport'
-          no_entry_flag=""
+          no_entry_flag=
         else
           aix_use_runtimelinking=no
 
           # Test if we are trying to use run time linking or normal
           # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
+          # have runtime linking enabled, and use it for executables.
+          # For shared libraries, we enable/disable runtime linking
+          # depending on the kind of the shared library created -
+          # when "with_aix_soname,aix_use_runtimelinking" is:
+          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "aix,yes"  lib.so          shared, rtl:yes, for executables
+          #            lib.a           static archive
+          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+          #            lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a(lib.so.V) shared, rtl:no
+          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a           static archive
           case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	    for ld_flag in $LDFLAGS; do
 	      case $ld_flag in
@@ -6008,6 +6489,13 @@ if test "$_lt_caught_CXX_error" != yes; then
 	        ;;
 	      esac
 	    done
+	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	      # so we don't have lib.a shared libs to link our executables.
+	      # We have to force runtime linking in this case.
+	      aix_use_runtimelinking=yes
+	      LDFLAGS="$LDFLAGS -Wl,-brtl"
+	    fi
 	    ;;
           esac
 
@@ -6026,13 +6514,21 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+        case $with_aix_soname,$aix_use_runtimelinking in
+        aix,*) ;;	# no import file
+        svr4,* | *,yes) # use import file
+          # The Import File defines what to hardcode.
+          _LT_TAGVAR(hardcode_direct, $1)=no
+          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+          ;;
+        esac
 
-        if test "$GXX" = yes; then
+        if test yes = "$GXX"; then
           case $host_os in aix4.[[012]]|aix4.[[012]].*)
           # We only want to do this on AIX 4.2 and lower, the check
           # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -6050,64 +6546,84 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  fi
           esac
           shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
 	  fi
+	  # Need to ensure runtime linking is disabled for the traditional
+	  # shared library, or the linker may eventually find shared libraries
+	  # /with/ Import File - we do not want to mix them.
+	  shared_flag_aix='-shared'
+	  shared_flag_svr4='-shared $wl-G'
         else
           # not using gcc
-          if test "$host_cpu" = ia64; then
+          if test ia64 = "$host_cpu"; then
 	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	  # chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
           else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
 	    else
-	      shared_flag='${wl}-bM:SRE'
+	      shared_flag='$wl-bM:SRE'
 	    fi
+	    shared_flag_aix='$wl-bM:SRE'
+	    shared_flag_svr4='$wl-G'
           fi
         fi
 
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
         # It seems that -bexpall does not export symbols beginning with
         # underscore (_), so it is better to generate a list of symbols to
 	# export.
         _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
+	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
           # Warning - without using the other runtime loading flags (-brtl),
           # -berok will link without error, but may produce a broken library.
-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # The "-G" linker flag allows undefined symbols.
+          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
           _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
         else
-          if test "$host_cpu" = ia64; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+          if test ia64 = "$host_cpu"; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
 	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
 	    _LT_SYS_MODULE_PATH_AIX([$1])
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    if test "$with_gnu_ld" = yes; then
+	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
 	      # We only use this code for GNU lds that support --whole-archive.
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    else
 	      # Exported symbols can be pulled into shared objects from archives
 	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	    fi
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	    # -brtl affects multiple linker settings, -berok does not and is overridden later
+	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+	    if test svr4 != "$with_aix_soname"; then
+	      # This is similar to how AIX traditionally builds its shared
+	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	    fi
+	    if test aix != "$with_aix_soname"; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# [...]
+	    else
+	      # used by -dlpreopen to get the symbols
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	    fi
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
           fi
         fi
         ;;
@@ -6117,7 +6633,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	  # support --undefined.  This deserves some investigation.  FIXME
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 	else
 	  _LT_TAGVAR(ld_shlibs, $1)=no
 	fi
@@ -6145,57 +6661,58 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  # Tell ltmain to make .lib files, not .a files.
 	  libext=lib
 	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=".dll"
+	  shrext_cmds=.dll
 	  # FIXME: Setting linknames here is a bad hack.
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	    else
-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	    fi~
-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	    linknames='
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
 	  # The linker will not automatically build a static lib if we build a DLL.
 	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 	  # Don't use ranlib
 	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-	    case $lt_outputfile in
-	      *.exe|*.EXE) ;;
-	      *)
-		lt_outputfile="$lt_outputfile.exe"
-		lt_tool_outputfile="$lt_tool_outputfile.exe"
-		;;
-	    esac~
-	    func_to_tool_file "$lt_outputfile"~
-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	      $RM "$lt_outputfile.manifest";
-	    fi'
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
 	  ;;
 	*)
 	  # g++
 	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 	  # as there is no search path for DLLs.
 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  _LT_TAGVAR(always_export_symbols, $1)=no
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
 	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file (1st line
-	    # is EXPORTS), use it as is; otherwise, prepend...
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      cp $export_symbols $output_objdir/$soname.def;
-	    else
-	      echo EXPORTS > $output_objdir/$soname.def;
-	      cat $export_symbols >> $output_objdir/$soname.def;
-	    fi~
-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -6206,6 +6723,34 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_DARWIN_LINKER_FEATURES($1)
 	;;
 
+      os2*)
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	shrext_cmds=.dll
+	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  prefix_cmds="$SED"~
+	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	    prefix_cmds="$prefix_cmds -e 1d";
+	  fi~
+	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+
       dgux*)
         case $cc_basename in
           ec++*)
@@ -6241,14 +6786,14 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
         ;;
 
       hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
         _LT_TAGVAR(hardcode_direct, $1)=yes
         _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 				             # but as the default
@@ -6260,7 +6805,7 @@ if test "$_lt_caught_CXX_error" != yes; then
             _LT_TAGVAR(ld_shlibs, $1)=no
             ;;
           aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             # Commands to make compiler produce verbose output that lists
             # what "hidden" libraries, object files and flags are used when
             # linking a shared library.
@@ -6269,11 +6814,11 @@ if test "$_lt_caught_CXX_error" != yes; then
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            if test yes = "$GXX"; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               _LT_TAGVAR(ld_shlibs, $1)=no
@@ -6283,15 +6828,15 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        if test no = "$with_gnu_ld"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
           case $host_cpu in
             hppa*64*|ia64*)
               ;;
             *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
               ;;
           esac
         fi
@@ -6317,13 +6862,13 @@ if test "$_lt_caught_CXX_error" != yes; then
           aCC*)
 	    case $host_cpu in
 	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	    esac
 	    # Commands to make compiler produce verbose output that lists
@@ -6334,20 +6879,20 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
 	        case $host_cpu in
 	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -6362,22 +6907,22 @@ if test "$_lt_caught_CXX_error" != yes; then
       interix[[3-9]]*)
 	_LT_TAGVAR(hardcode_direct, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
 	# Instead, shared libraries are loaded at an image base (0x10000000 by
 	# default) and relocated if they conflict, which is a slow very memory
 	# consuming and fragmenting process.  To avoid this, we pick a random,
 	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
 	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
 	;;
       irix5* | irix6*)
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -6386,17 +6931,17 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
 	      fi
 	    fi
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
 	    ;;
         esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
@@ -6409,8 +6954,8 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
 	    # Commands to make compiler produce verbose output that lists
 	    # what "hidden" libraries, object files and flags are used when
 	    # linking a shared library.
@@ -6419,10 +6964,10 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
@@ -6436,59 +6981,59 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # earlier do not add the objects themselves.
 	    case `$CC -V 2>&1` in
 	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	      *)  # Version 8.0 or newer
 	        tmp_idyn=
 	        case $host_cpu in
 		  ia64*) tmp_idyn=' -i_dynamic';;
 		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	    esac
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    ;;
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
 	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-		$RANLIB $oldlib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    esac
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
 
 	    runpath_var=LD_RUN_PATH
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -6502,18 +7047,18 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
 	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
 	    fi
 	    ;;
 	  *)
@@ -6521,10 +7066,10 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    *Sun\ C*)
 	      # Sun C++ 5.9
 	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	      _LT_TAGVAR(compiler_needs_object, $1)=yes
 
 	      # Not sure whether something based on
@@ -6582,22 +7127,17 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=yes
 	;;
 
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      openbsd*)
+      openbsd* | bitrig*)
 	if test -f /usr/libexec/ld.so; then
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
 	  fi
 	  output_verbose_link_cmd=func_echo_all
 	else
@@ -6613,9 +7153,9 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
 	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	    # Archives containing C++ object files must be created using
@@ -6633,17 +7173,17 @@ if test "$_lt_caught_CXX_error" != yes; then
           cxx*)
 	    case $host in
 	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 		;;
 	      *)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 		;;
 	    esac
@@ -6658,21 +7198,21 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
 	      case $host in
 	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	      esac
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	      # Commands to make compiler produce verbose output that lists
@@ -6718,9 +7258,9 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # Sun C++ 4.2, 5.x and Centerline C++
             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6728,7 +7268,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 	      *)
 		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
+		# but understands '-z linker_flag'.
 	        # Supported since Solaris 2.6 (maybe 2.5.1?)
 		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	        ;;
@@ -6745,30 +7285,30 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    ;;
           gcx*)
 	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 
 	    # The C++ compiler must be used to create the archive.
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 	    ;;
           *)
 	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
 	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
 	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
@@ -6776,11 +7316,11 @@ if test "$_lt_caught_CXX_error" != yes; then
 	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
 	      case $host_os in
 		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 		  ;;
 	      esac
 	    fi
@@ -6789,52 +7329,52 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
       case $cc_basename in
         CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
       esac
       ;;
 
       sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
+	# Note: We CANNOT use -z defs as we might desire, because we do not
 	# link with -lc, and that would cause any symbols used from libc to
 	# always be unresolved, which means just about no library would
 	# ever link correctly.  If we're not using GNU ld we use -z text
 	# though, which does catch some bad symbols but isn't as heavy-handed
 	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
 	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
 	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
 	runpath_var='LD_RUN_PATH'
 
 	case $cc_basename in
           CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+              '"$_LT_TAGVAR(old_archive_cmds, $1)"
 	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-	      '"$_LT_TAGVAR(reload_cmds, $1)"
+              '"$_LT_TAGVAR(reload_cmds, $1)"
 	    ;;
 	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    ;;
 	esac
       ;;
@@ -6865,10 +7405,10 @@ if test "$_lt_caught_CXX_error" != yes; then
     esac
 
     AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
 
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$GXX
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -6895,7 +7435,7 @@ if test "$_lt_caught_CXX_error" != yes; then
   lt_cv_path_LD=$lt_save_path_LD
   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
+fi # test yes != "$_lt_caught_CXX_error"
 
 AC_LANG_POP
 ])# _LT_LANG_CXX_CONFIG
@@ -6917,13 +7457,14 @@ AC_REQUIRE([_LT_DECL_SED])
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
 func_stripname_cnf ()
 {
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  case @S|@2 in
+  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
   esac
 } # func_stripname_cnf
 ])# _LT_FUNC_STRIPNAME_CNF
 
+
 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
 # ---------------------------------
 # Figure out "hidden" library dependencies from verbose
@@ -7007,13 +7548,13 @@ if AC_TRY_EVAL(ac_compile); then
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
+    case $prev$p in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
        # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
 	 prev=$p
 	 continue
        fi
@@ -7029,16 +7570,16 @@ if AC_TRY_EVAL(ac_compile); then
        case $p in
        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
        esac
-       if test "$pre_test_object_deps_done" = no; then
-	 case ${prev} in
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
 	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
 	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
 	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
 	   fi
 	   ;;
 	 # The "-l" case would never come before the object being
@@ -7046,9 +7587,9 @@ if AC_TRY_EVAL(ac_compile); then
 	 esac
        else
 	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	   _LT_TAGVAR(postdeps, $1)=$prev$p
 	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
 	 fi
        fi
        prev=
@@ -7063,15 +7604,15 @@ if AC_TRY_EVAL(ac_compile); then
 	 continue
        fi
 
-       if test "$pre_test_object_deps_done" = no; then
+       if test no = "$pre_test_object_deps_done"; then
 	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)="$p"
+	   _LT_TAGVAR(predep_objects, $1)=$p
 	 else
 	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
 	 fi
        else
 	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	   _LT_TAGVAR(postdep_objects, $1)=$p
 	 else
 	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
 	 fi
@@ -7102,51 +7643,6 @@ interix[[3-9]]*)
   _LT_TAGVAR(postdep_objects,$1)=
   _LT_TAGVAR(postdeps,$1)=
   ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
 esac
 ])
 
@@ -7155,7 +7651,7 @@ case " $_LT_TAGVAR(postdeps, $1) " in
 esac
  _LT_TAGVAR(compiler_lib_search_dirs, $1)=
 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
 fi
 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
     [The directories searched by this compiler when creating a shared library])
@@ -7175,10 +7671,10 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1],
 # --------------------------
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
 [AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
+if test -z "$F77" || test no = "$F77"; then
   _lt_disable_F77=yes
 fi
 
@@ -7215,7 +7711,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the F77 compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
+if test yes != "$_lt_disable_F77"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7237,7 +7733,7 @@ if test "$_lt_disable_F77" != yes; then
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
+  lt_save_CC=$CC
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${F77-"f77"}
@@ -7251,21 +7747,25 @@ if test "$_lt_disable_F77" != yes; then
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
+    test no = "$can_build_shared" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test "$enable_shared" = yes && enable_static=no
+        test yes = "$enable_shared" && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
 	fi
         ;;
     esac
@@ -7273,11 +7773,11 @@ if test "$_lt_disable_F77" != yes; then
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
+    test yes = "$enable_shared" || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$G77
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7294,9 +7794,9 @@ if test "$_lt_disable_F77" != yes; then
   fi # test -n "$compiler"
 
   GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-  CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
 
 AC_LANG_POP
 ])# _LT_LANG_F77_CONFIG
@@ -7306,11 +7806,11 @@ AC_LANG_POP
 # -------------------------
 # Ensure that the configuration variables for a Fortran compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_FC_CONFIG],
 [AC_LANG_PUSH(Fortran)
 
-if test -z "$FC" || test "X$FC" = "Xno"; then
+if test -z "$FC" || test no = "$FC"; then
   _lt_disable_FC=yes
 fi
 
@@ -7347,7 +7847,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the FC compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
+if test yes != "$_lt_disable_FC"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7369,7 +7869,7 @@ if test "$_lt_disable_FC" != yes; then
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
+  lt_save_CC=$CC
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${FC-"f95"}
@@ -7385,21 +7885,25 @@ if test "$_lt_disable_FC" != yes; then
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
+    test no = "$can_build_shared" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test "$enable_shared" = yes && enable_static=no
+        test yes = "$enable_shared" && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
 	fi
         ;;
     esac
@@ -7407,11 +7911,11 @@ if test "$_lt_disable_FC" != yes; then
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
+    test yes = "$enable_shared" || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7431,7 +7935,7 @@ if test "$_lt_disable_FC" != yes; then
   GCC=$lt_save_GCC
   CC=$lt_save_CC
   CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
+fi # test yes != "$_lt_disable_FC"
 
 AC_LANG_POP
 ])# _LT_LANG_FC_CONFIG
@@ -7441,7 +7945,7 @@ AC_LANG_POP
 # --------------------------
 # Ensure that the configuration variables for the GNU Java Compiler compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_GCJ_CONFIG],
 [AC_REQUIRE([LT_PROG_GCJ])dnl
 AC_LANG_SAVE
@@ -7475,7 +7979,7 @@ CC=${GCJ-"gcj"}
 CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
 _LT_CC_BASENAME([$compiler])
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
@@ -7512,7 +8016,7 @@ CFLAGS=$lt_save_CFLAGS
 # --------------------------
 # Ensure that the configuration variables for the GNU Go compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_GO_CONFIG],
 [AC_REQUIRE([LT_PROG_GO])dnl
 AC_LANG_SAVE
@@ -7546,7 +8050,7 @@ CC=${GOC-"gccgo"}
 CFLAGS=$GOFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
 _LT_CC_BASENAME([$compiler])
 
 # Go did not exist at the time GCC didn't implicitly link libc in.
@@ -7583,7 +8087,7 @@ CFLAGS=$lt_save_CFLAGS
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_RC_CONFIG],
 [AC_REQUIRE([LT_PROG_RC])dnl
 AC_LANG_SAVE
@@ -7599,7 +8103,7 @@ _LT_TAGVAR(objext, $1)=$objext
 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
 
 # Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
+lt_simple_link_test_code=$lt_simple_compile_test_code
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_TAG_COMPILER
@@ -7609,7 +8113,7 @@ _LT_COMPILER_BOILERPLATE
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
 lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
@@ -7638,7 +8142,7 @@ AC_DEFUN([LT_PROG_GCJ],
 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
   [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
     [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
       AC_SUBST(GCJFLAGS)])])[]dnl
 ])
 
@@ -7749,7 +8253,7 @@ lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
+  test ! -f "$lt_ac_sed" && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -7766,9 +8270,9 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
     cmp -s conftest.out conftest.nl || break
     # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
+    test 10 -lt "$lt_ac_count" && break
     lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
+    if test "$lt_ac_count" -gt "$lt_ac_max"; then
       lt_ac_max=$lt_ac_count
       lt_cv_path_SED=$lt_ac_sed
     fi
@@ -7792,27 +8296,7 @@ dnl AC_DEFUN([LT_AC_PROG_SED], [])
 # Find out whether the shell is Bourne or XSI compatible,
 # or has some other useful features.
 m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
   lt_unset=false
@@ -7836,102 +8320,9 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
 ])# _LT_CHECK_SHELL_FEATURES
 
 
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
-
-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
-
-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-    func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
 # _LT_PATH_CONVERSION_FUNCTIONS
 # -----------------------------
-# Determine which file name conversion functions should be used by
+# Determine what file name conversion functions should be used by
 # func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
 # for certain cross-compile configurations and native mingw.
 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
index 5d9acd8..94b0829 100644
--- a/m4/ltoptions.m4
+++ b/m4/ltoptions.m4
@@ -1,14 +1,14 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
+#   Foundation, Inc.
 #   Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 7 ltoptions.m4
+# serial 8 ltoptions.m4
 
 # This is to help aclocal find these macros, as it can't see m4_define.
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION],
 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
         _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
+    [m4_warning([Unknown $1 option '$2'])])[]dnl
 ])
 
 
@@ -75,13 +75,15 @@ m4_if([$1],[LT_INIT],[
   dnl
   dnl If no reference was made to various pairs of opposing options, then
   dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
   dnl archives by default:
   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
+		   [_LT_ENABLE_FAST_INSTALL])
+  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+		   [_LT_WITH_AIX_SONAME([aix])])
   ])
 ])# _LT_SET_OPTIONS
 
@@ -112,7 +114,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN],
 [_LT_SET_OPTION([LT_INIT], [dlopen])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
+put the 'dlopen' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -148,7 +150,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
 _LT_SET_OPTION([LT_INIT], [win32-dll])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
+put the 'win32-dll' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -157,9 +159,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
 
 # _LT_ENABLE_SHARED([DEFAULT])
 # ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_SHARED],
 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([shared],
@@ -172,14 +174,14 @@ AC_ARG_ENABLE([shared],
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@@ -211,9 +213,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], [])
 
 # _LT_ENABLE_STATIC([DEFAULT])
 # ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_STATIC],
 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([static],
@@ -226,14 +228,14 @@ AC_ARG_ENABLE([static],
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@@ -265,9 +267,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], [])
 
 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
 # ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_FAST_INSTALL],
 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([fast-install],
@@ -280,14 +282,14 @@ AC_ARG_ENABLE([fast-install],
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@@ -304,14 +306,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
+the 'fast-install' option into LT_INIT's first parameter.])
 ])
 
 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
+the 'disable-fast-install' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -319,11 +321,64 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 
 
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+  AC_MSG_CHECKING([which variant of shared library versioning to provide])
+  AC_ARG_WITH([aix-soname],
+    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+    [case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname],
+    [AC_CACHE_VAL([lt_cv_with_aix_soname],
+      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+    with_aix_soname=$lt_cv_with_aix_soname])
+  AC_MSG_RESULT([$with_aix_soname])
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
 # _LT_WITH_PIC([MODE])
 # --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
 # LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
     [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@@ -334,19 +389,17 @@ m4_define([_LT_WITH_PIC],
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+    [pic_mode=m4_default([$1], [default])])
 
 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
 ])# _LT_WITH_PIC
@@ -359,7 +412,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE],
 [_LT_SET_OPTION([LT_INIT], [pic-only])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
+put the 'pic-only' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
index 9000a05..48bc934 100644
--- a/m4/ltsugar.m4
+++ b/m4/ltsugar.m4
@@ -1,6 +1,7 @@
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 #
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Foundation, Inc.
 # Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -33,7 +34,7 @@ m4_define([_lt_join],
 # ------------
 # Manipulate m4 lists.
 # These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
+# Autoconf-2.59, which quotes differently.
 m4_define([lt_car], [[$1]])
 m4_define([lt_cdr],
 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
@@ -44,7 +45,7 @@ m4_define([lt_unquote], $1)
 
 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
 # ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
 # Note that neither SEPARATOR nor STRING are expanded; they are appended
 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
index 07a8602..fa04b52 100644
--- a/m4/ltversion.m4
+++ b/m4/ltversion.m4
@@ -1,6 +1,6 @@
 # ltversion.m4 -- version numbers			-*- Autoconf -*-
 #
-#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 3337 ltversion.m4
+# serial 4179 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
+[macro_version='2.4.6'
+macro_revision='2.4.6'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
index c573da9..c6b26f8 100644
--- a/m4/lt~obsolete.m4
+++ b/m4/lt~obsolete.m4
@@ -1,6 +1,7 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
+#   Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
 # This file is free software; the Free Software Foundation gives
@@ -11,7 +12,7 @@
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
 # which have later been changed to m4_define as they aren't part of the
 # exported API, or moved to Autoconf or Automake where they belong.
 #
@@ -25,7 +26,7 @@
 # included after everything else.  This provides aclocal with the
 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
 # because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
 #
 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
 # Yes, that means every name once taken will need to remain here until
diff --git a/missing b/missing
index db98974..f62bbae 100755
--- a/missing
+++ b/missing
@@ -3,7 +3,7 @@
 
 scriptversion=2013-10-28.13; # UTC
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
diff --git a/py-compile b/py-compile
index 46ea866..bc20391 100755
--- a/py-compile
+++ b/py-compile
@@ -3,7 +3,7 @@
 
 scriptversion=2011-06-08.12; # UTC
 
-# Copyright (C) 2000-2013 Free Software Foundation, Inc.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/src/Makefile.in b/src/Makefile.in
index 700d62c..c5411c3 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in
index 3315b50..8c7bd54 100644
--- a/src/modules/Makefile.in
+++ b/src/modules/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/climate/Makefile.in b/src/modules/climate/Makefile.in
index 1a592d9..5043e90 100644
--- a/src/modules/climate/Makefile.in
+++ b/src/modules/climate/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/climate
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/climate/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/climate/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/climate/climate_tools/MLB_Interface.cpp b/src/modules/climate/climate_tools/MLB_Interface.cpp
index d0b699e..e96c649 100755
--- a/src/modules/climate/climate_tools/MLB_Interface.cpp
+++ b/src/modules/climate/climate_tools/MLB_Interface.cpp
@@ -99,6 +99,7 @@ CSG_String Get_Info(int i)
 #include "milankovic.h"
 #include "etp_hargreave.h"
 #include "daily_sun.h"
+#include "bioclimatic_vars.h"
 
 
 //---------------------------------------------------------
@@ -122,8 +123,10 @@ CSG_Module *		Create_Module(int i)
 
 	case  9:	return( new CDaily_Sun );
 
+	case 10:	return( new CBioclimatic_Vars );
+
 	//-----------------------------------------------------
-	case 10:	return( NULL );
+	case 11:	return( NULL );
 	default:	return( MLB_INTERFACE_SKIP_MODULE );
 	}
 }
diff --git a/src/modules/climate/climate_tools/Makefile.am b/src/modules/climate/climate_tools/Makefile.am
index e908d9f..7b1aaaf 100755
--- a/src/modules/climate/climate_tools/Makefile.am
+++ b/src/modules/climate/climate_tools/Makefile.am
@@ -11,11 +11,13 @@ AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
 AM_LDFLAGS         = -fPIC -shared -avoid-version 
 pkglib_LTLIBRARIES = libclimate_tools.la
 libclimate_tools_la_SOURCES =\
+bioclimatic_vars.cpp\
 daily_sun.cpp\
 etp_hargreave.cpp\
 grid_levels_interpolation.cpp\
 milankovic.cpp\
 MLB_Interface.cpp\
+bioclimatic_vars.h\
 daily_sun.h\
 etp_hargreave.h\
 grid_levels_interpolation.h\
diff --git a/src/modules/climate/climate_tools/Makefile.in b/src/modules/climate/climate_tools/Makefile.in
index 6350e07..39982ea 100644
--- a/src/modules/climate/climate_tools/Makefile.in
+++ b/src/modules/climate/climate_tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/climate/climate_tools
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -127,8 +137,9 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libclimate_tools_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libclimate_tools_la_OBJECTS = daily_sun.lo etp_hargreave.lo \
-	grid_levels_interpolation.lo milankovic.lo MLB_Interface.lo
+am_libclimate_tools_la_OBJECTS = bioclimatic_vars.lo daily_sun.lo \
+	etp_hargreave.lo grid_levels_interpolation.lo milankovic.lo \
+	MLB_Interface.lo
 libclimate_tools_la_OBJECTS = $(am_libclimate_tools_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -212,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -371,11 +392,13 @@ AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
 AM_LDFLAGS = -fPIC -shared -avoid-version 
 pkglib_LTLIBRARIES = libclimate_tools.la
 libclimate_tools_la_SOURCES = \
+bioclimatic_vars.cpp\
 daily_sun.cpp\
 etp_hargreave.cpp\
 grid_levels_interpolation.cpp\
 milankovic.cpp\
 MLB_Interface.cpp\
+bioclimatic_vars.h\
 daily_sun.h\
 etp_hargreave.h\
 grid_levels_interpolation.h\
@@ -399,7 +422,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/climate/climate_tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/climate/climate_tools/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +485,7 @@ distclean-compile:
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bioclimatic_vars.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/daily_sun.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/etp_hargreave.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_levels_interpolation.Plo at am__quote@
@@ -705,6 +728,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/climate/climate_tools/bioclimatic_vars.cpp b/src/modules/climate/climate_tools/bioclimatic_vars.cpp
new file mode 100755
index 0000000..2c3d472
--- /dev/null
+++ b/src/modules/climate/climate_tools/bioclimatic_vars.cpp
@@ -0,0 +1,441 @@
+/**********************************************************
+ * Version $Id: bioclimatic_vars.cpp 1380 2012-04-26 12:02:19Z reklov_w $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                     climate_tools                     //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                  bioclimatic_vars.cpp                 //
+//                                                       //
+//                 Copyright (C) 2016 by                 //
+//                      Olaf Conrad                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "bioclimatic_vars.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+const CSG_String	Vars[NVARS][2]	=
+{
+	{	_TL("Annual Mean Temperature"             ), _TL("")	},
+	{	_TL("Mean Diurnal Range"                  ), _TL("")	},
+	{	_TL("Isothermality"                       ), _TL("")	},
+	{	_TL("Temperature Seasonality"             ), _TL("")	},
+	{	_TL("Maximum Temperature of Warmest Month"), _TL("")	},
+	{	_TL("Minimum Temperature of Coldest Month"), _TL("")	},
+	{	_TL("Temperature Annual Range"            ), _TL("")	},
+	{	_TL("Mean Temperature of Wettest Quarter" ), _TL("")	},
+	{	_TL("Mean Temperature of Driest Quarter"  ), _TL("")	},
+	{	_TL("Mean Temperature of Warmest Quarter" ), _TL("")	},
+	{	_TL("Mean Temperature of Coldest Quarter" ), _TL("")	},
+	{	_TL("Annual Precipitation"                ), _TL("")	},
+	{	_TL("Precipitation of Wettest Month"      ), _TL("")	},
+	{	_TL("Precipitation of Driest Month"       ), _TL("")	},
+	{	_TL("Precipitation Seasonality"           ), _TL("")	},
+	{	_TL("Precipitation of Wettest Quarter"    ), _TL("")	},
+	{	_TL("Precipitation of Driest Quarter"     ), _TL("")	},
+	{	_TL("Precipitation of Warmest Quarter"    ), _TL("")	},
+	{	_TL("Precipitation of Coldest Quarter"    ), _TL("")	}
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CBioclimatic_Vars::CBioclimatic_Vars(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Bioclimatic Variables"));
+
+	Set_Author		("O.Conrad (c) 2016");
+
+	Set_Description	(_TW(
+		"This tool calculates biogically meaningful variables from "
+		"monthly climate data (mean, minimum and maximum temperature "
+		"and precipitation), as provided e.g. by the <a href=\"http://worldclim.org\">"
+		"WorldClim - Global Climate Data</a> project.\n"
+		"<p>"
+		"The implementation follows the definitions given by Jeremy van der Wal at "
+		"<a href=\"https://rforge.net/doc/packages/climates/bioclim.html\">BioClim - Bioclimatic Variables</a>:<ol>"
+		"<li><b>Annual Mean Temperature:</b>"
+		" The mean of all the monthly mean temperatures."
+		" Each monthly mean temperature is the mean of that month's maximum and minimum temperature.</li>"
+		"<li><b>Mean Diurnal Range:</b>"
+		" The annual mean of all the monthly diurnal temperature ranges."
+		" Each monthly diurnal range is the difference between that month's maximum and minimum temperature.</li>"
+		"<li><b>Isothermality:</b>"
+		" The mean diurnal range (parameter 2) divided by the annual temperature range (parameter 7).</li>"
+		"<li><b>Temperature Seasonality:</b>"
+		" returns either<ul><li>"
+		" the temperature coefficient of variation as the standard deviation of the monthly mean temperatures"
+		" expressed as a percentage of the mean of those temperatures (i.e. the annual mean). For this calculation,"
+		" the mean in degrees Kelvin is used. This avoids the possibility of having to divide by zero,"
+		" but does mean that the values are usually quite small.</li><li>"
+		" the standard deviation of the monthly mean temperatures.</li></ul>"
+		"<li><b>Maximum Temperature of Warmest Period:</b>"
+		" The highest temperature of any monthly maximum temperature.</li>"
+		"<li><b>Minimum Temperature of Coldest Period:</b>"
+		" The lowest temperature of any monthly minimum temperature.</li>"
+		"<li><b>Temperature Annual Range:</b>"
+		" The difference between the Maximum Temperature of Warmest Period"
+		" and the Minimum Temperature of Coldest Period.</li>"
+		"<li><b>Mean Temperature of Wettest Quarter:</b>"
+		" The wettest quarter of the year is determined (to the nearest month),"
+		" and the mean temperature of this period is calculated.</li>"
+		"<li><b>Mean Temperature of Driest Quarter:</b>"
+		" The driest quarter of the year is determined (to the nearest month),"
+		" and the mean temperature of this period is calculated.</li>"
+		"<li><b>Mean Temperature of Warmest Quarter:</b>"
+		" The warmest quarter of the year is determined (to the nearest month),"
+		" and the mean temperature of this period is calculated.</li>"
+		"<li><b>Mean Temperature of Coldest Quarter:</b>"
+		" The coldest quarter of the year is determined (to the nearest month),"
+		" and the mean temperature of this period is calculated.</li>"
+		"<li><b>Annual Precipitation:</b>"
+		" The sum of all the monthly precipitation estimates.</li>"
+		"<li><b>Precipitation of Wettest Period:</b>"
+		" The precipitation of the wettest month.</li>"
+		"<li><b>Precipitation of Driest Period:</b>"
+		" The precipitation of the driest month.</li>"
+		"<li><b>Precipitation Seasonality:</b>"
+		" The Coefficient of Variation is the standard deviation of"
+		" the monthly precipitation estimates expressed as a percentage of the"
+		" mean of those estimates (i.e. the annual mean).</li>"
+		"<li><b>Precipitation of Wettest Quarter:</b>"
+		" The wettest quarter of the year is determined (to the nearest month),"
+		" and the total precipitation over this period is calculated.</li>"
+		"<li><b>Precipitation of Driest Quarter:</b>"
+		" The driest quarter of the year is determined (to the nearest month),"
+		" and the total precipitation over this period is calculated.</li>"
+		"<li><b>Precipitation of Warmest Quarter:</b>"
+		" The warmest quarter of the year is determined (to the nearest month),"
+		" and the total precipitation over this period is calculated.</li>"
+		"<li><b>Precipitation of Coldest Quarter:</b>"
+		" The coldest quarter of the year is determined (to the nearest month),"
+		" and the total precipitation over this period is calculated.</li>"
+		"</ol></p><p>"
+		"The quarterly parameters are not aligned to any calendar quarters. "
+		"BioClim's definition of a quarter is any consecutive 3 months. "
+		"For example, the driest quarter will be the 3 consecutive months that "
+		"are drier than any other set of 3 consecutive months."
+		"</p>"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid_List(
+		NULL	, "TMEAN"		, _TL("Mean Temperature"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "TMIN"		, _TL("Minimum Temperature"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "TMAX"		, _TL("Maximum Temperature"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "P"			, _TL("Precipitation"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	//-----------------------------------------------------
+	for(int i=0; i<NVARS; i++)
+	{
+		Parameters.Add_Grid(NULL, CSG_String::Format("BIO_%02d", i + 1), Vars[i][0], Vars[i][1], PARAMETER_OUTPUT);
+	}
+
+	Parameters.Add_Choice(
+		NULL	, "SEASONALITY"	, _TL("Temperature Seasonality"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("Coefficient of Variation"),
+			_TL("Standard Deviation")
+		), 1
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CBioclimatic_Vars::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CBioclimatic_Vars::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_pT		= Parameters("TMEAN")->asGridList();
+	m_pTmin		= Parameters("TMIN" )->asGridList();
+	m_pTmax		= Parameters("TMAX" )->asGridList();
+	m_pP		= Parameters("P"    )->asGridList();
+
+	if( m_pT   ->Get_Count() != 12
+	||  m_pTmin->Get_Count() != 12
+	||  m_pTmax->Get_Count() != 12
+	||  m_pP   ->Get_Count() != 12 )
+	{
+		Error_Set(_TL("there has to be one input grid for each month"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Colors	Colors(10);
+
+	Colors.Set_Color(0, 254, 135, 000);
+	Colors.Set_Color(1, 254, 194, 063);
+	Colors.Set_Color(2, 254, 254, 126);
+	Colors.Set_Color(3, 231, 231, 227);
+	Colors.Set_Color(4, 132, 222, 254);
+	Colors.Set_Color(5, 042, 163, 239);
+	Colors.Set_Color(6, 000, 105, 224);
+	Colors.Set_Color(7, 000, 047, 210);
+	Colors.Set_Color(8, 000, 001, 156);
+	Colors.Set_Color(9, 000, 000, 103);
+
+	for(int i=0; i<NVARS; i++)
+	{
+		m_pVars[i]	= Parameters(CSG_String::Format("BIO_%02d", i + 1))->asGrid();
+
+		if( i > 10 )	// Precipitation
+		{
+			DataObject_Set_Colors(m_pVars[i], Colors);
+		}
+	}
+
+	m_Seasonality	= Parameters("SEASONALITY")->asInt();
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !Set_Variables(x, y) )
+			{
+				Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CBioclimatic_Vars::Set_NoData(int x, int y)
+{
+	for(int i=0; i<NVARS; i++)
+	{
+		SG_GRID_PTR_SAFE_SET_NODATA(m_pVars[i], x, y);
+	}
+}
+
+//---------------------------------------------------------
+bool CBioclimatic_Vars::Set_Variables(int x, int y)
+{
+	int		i;
+
+	CSG_Vector	T(12), Tmin(12), Tmax(12), P(12), dTD(12), T4(12), P4(12);
+	
+	//-----------------------------------------------------
+	for(i=0; i<12; i++)
+	{
+		if( m_pT   ->asGrid(i)->is_NoData(x, y)
+		||  m_pTmin->asGrid(i)->is_NoData(x, y)
+		||  m_pTmax->asGrid(i)->is_NoData(x, y)
+		||  m_pP   ->asGrid(i)->is_NoData(x, y) )
+		{
+			return( false );
+		}
+
+		T   [i]	= m_pT   ->asGrid(i)->asDouble(x, y);
+		Tmin[i]	= m_pTmin->asGrid(i)->asDouble(x, y);
+		Tmax[i]	= m_pTmax->asGrid(i)->asDouble(x, y);
+		P   [i]	= m_pP   ->asGrid(i)->asDouble(x, y);
+		dTD [i]	= Tmax[i] - Tmin[i];
+	}
+
+	//-----------------------------------------------------
+	int		T4min = 0, T4max = 0, P4min = 0, P4max = 0;
+
+	for(i=0; i<12; i++)
+	{
+		T4[i]	= (T[i] + T[(i + 1) % 12] + T[(i + 13) % 12]) / 3;
+
+		if( T4[i] < T4[T4min] )	{	T4min	= i;	}
+		if( T4[i] > T4[T4max] )	{	T4max	= i;	}
+
+		P4[i]	= (P[i] + P[(i + 1) % 12] + P[(i + 13) % 12]);
+
+		if( P4[i] < P4[P4min] )	{	P4min	= i;	}
+		if( P4[i] > P4[P4max] )	{	P4max	= i;	}
+	}
+
+	//-----------------------------------------------------
+	CSG_Simple_Statistics sT(T), sTmin(Tmin), sTmax(Tmax), sP(P), sdTD(dTD);
+
+	// Annual Mean Temperature
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 0], x, y, sT.Get_Mean());
+
+	// Mean Diurnal Range (Mean of monthly (max temp - min temp))
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 1], x, y, sdTD.Get_Mean());
+
+	// Isothermality (BIO2/BIO7) (* 100)
+	if( sTmax.Get_Maximum() - sTmin.Get_Minimum() > 0.0 )
+	{
+		SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 2], x, y, 100.0 * sdTD.Get_Mean() / (sTmax.Get_Maximum() - sTmin.Get_Minimum()));
+	}
+	else
+	{
+		SG_GRID_PTR_SAFE_SET_NODATA(m_pVars[ 2], x, y);
+	}
+
+	// Temperature Seasonality
+	if( m_Seasonality == 0 )
+	{	// standard deviation of the mean temperatures expressed as a percentage of the mean of those temperatures (i.e. the annual mean)
+		SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 3], x, y, 100.0 * sT.Get_StdDev() / (sT.Get_Mean() + 273.15));
+	}
+	else
+	{	// standard deviation * 100
+		SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 3], x, y, 100.0 * sT.Get_StdDev());
+	}
+
+	// Max Temperature of Warmest Month
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 4], x, y, sTmax.Get_Maximum());
+
+	// Min Temperature of Coldest Month
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 5], x, y, sTmin.Get_Minimum());
+
+	// Temperature Annual Range (BIO5-BIO6)
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 6], x, y, sTmax.Get_Maximum() - sTmin.Get_Minimum());
+
+	// Mean Temperature of Wettest Quarter
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 7], x, y, T4[P4max]);
+
+	// Mean Temperature of Driest Quarter
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 8], x, y, T4[P4min]);
+
+	// Mean Temperature of Warmest Quarter
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[ 9], x, y, T4[T4max]);
+
+	// Mean Temperature of Coldest Quarter
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[10], x, y, T4[T4min]);
+
+	// Annual Precipitation
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[11], x, y, sP.Get_Mean());
+
+	// Precipitation of Wettest Month
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[12], x, y, sP.Get_Maximum());
+
+	// Precipitation of Driest Month
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[13], x, y, sP.Get_Minimum());
+
+	// Precipitation Seasonality (Coefficient of Variation)
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[14], x, y, sP.Get_StdDev() * 100.0 /sP.Get_Mean());
+
+	// Precipitation of Wettest Quarter
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[15], x, y, P4[P4max]);
+
+	// Precipitation of Driest Quarter
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[16], x, y, P4[P4min]);
+
+	// Precipitation of Warmest Quarter
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[17], x, y, P4[T4max]);
+
+	// Precipitation of Coldest Quarter
+	SG_GRID_PTR_SAFE_SET_VALUE(m_pVars[18], x, y, P4[T4min]);
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_gridding/kernel_density.h b/src/modules/climate/climate_tools/bioclimatic_vars.h
similarity index 79%
copy from src/modules/grid/grid_gridding/kernel_density.h
copy to src/modules/climate/climate_tools/bioclimatic_vars.h
index 3392319..b8be719 100755
--- a/src/modules/grid/grid_gridding/kernel_density.h
+++ b/src/modules/climate/climate_tools/bioclimatic_vars.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: kernel_density.h 2212 2014-09-01 13:29:48Z oconrad $
+ * Version $Id: bioclimatic_vars.h 1380 2012-04-26 12:02:19Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,13 +9,13 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                     Grid_Gridding                     //
+//                     climate_tools                     //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                    kernel_density.h                   //
+//                   bioclimatic_vars.h                  //
 //                                                       //
-//                 Copyright (C) 2010 by                 //
+//                 Copyright (C) 2016 by                 //
 //                      Olaf Conrad                      //
 //                                                       //
 //-------------------------------------------------------//
@@ -54,13 +54,13 @@
 
 ///////////////////////////////////////////////////////////
 //														 //
-//                                                       //
+//														 //
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifndef HEADER_INCLUDED__kernel_density_H
-#define HEADER_INCLUDED__kernel_density_H
+#ifndef HEADER_INCLUDED__bioclimatic_vars_H
+#define HEADER_INCLUDED__bioclimatic_vars_H
 
 
 ///////////////////////////////////////////////////////////
@@ -70,7 +70,7 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include "MLB_Interface.h"
+#include <saga_api/saga_api.h>
 
 
 ///////////////////////////////////////////////////////////
@@ -80,15 +80,24 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class grid_gridding_EXPORT CKernel_Density : public CSG_Module  
+#define NVARS	19
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CBioclimatic_Vars : public CSG_Module_Grid
 {
 public:
-	CKernel_Density(void);
+	CBioclimatic_Vars(void);
+
+//	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("Tools") );	}
 
 
 protected:
 
-	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 
 	virtual bool				On_Execute				(void);
@@ -96,18 +105,15 @@ protected:
 
 private:
 
-	int							m_iRadius, m_Kernel;
-
-	double						m_dRadius;
-
-	CSG_Parameters_Grid_Target	m_Grid_Target;
-
-	CSG_Grid					*m_pGrid;
+	int							m_Seasonality;
 
+	CSG_Parameter_Grid_List		*m_pT, *m_pTmin, *m_pTmax, *m_pP;
 
-	void						Set_Kernel				(const TSG_Point &Point, double Population);
+	CSG_Grid					*m_pVars[NVARS];
 
-	double						Get_Kernel				(double dx, double dy);
+
+	void						Set_NoData				(int x, int y);
+	bool						Set_Variables			(int x, int y);
 
 };
 
@@ -119,4 +125,4 @@ private:
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__kernel_density_H
+#endif // #ifndef HEADER_INCLUDED__bioclimatic_vars_H
diff --git a/src/modules/contrib/Makefile.in b/src/modules/contrib/Makefile.in
index c098e6e..4cbd384 100644
--- a/src/modules/contrib/Makefile.in
+++ b/src/modules/contrib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/contrib
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/contrib/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/contrib/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/contrib/contrib_peregro/Makefile.in b/src/modules/contrib/contrib_peregro/Makefile.in
index 9569255..1ffade6 100644
--- a/src/modules/contrib/contrib_peregro/Makefile.in
+++ b/src/modules/contrib/contrib_peregro/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/contrib/contrib_peregro
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -408,7 +428,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/contrib/contrib_peregro/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/contrib/contrib_peregro/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -718,6 +737,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/db/Makefile.in b/src/modules/db/Makefile.in
index 306f14f..d3a428a 100644
--- a/src/modules/db/Makefile.in
+++ b/src/modules/db/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/db
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = db_odbc db_pgsql
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -341,7 +362,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/db/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/db/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -636,6 +656,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/db/db_odbc/Makefile.in b/src/modules/db/db_odbc/Makefile.in
index 13adb2d..e0bb205 100644
--- a/src/modules/db/db_odbc/Makefile.in
+++ b/src/modules/db/db_odbc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/db/db_odbc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -212,6 +222,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +256,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +281,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +371,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -398,7 +418,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/db/db_odbc/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/db/db_odbc/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -703,6 +722,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/db/db_pgsql/Makefile.in b/src/modules/db/db_pgsql/Makefile.in
index cf311e1..a4ebf99 100644
--- a/src/modules/db/db_pgsql/Makefile.in
+++ b/src/modules/db/db_pgsql/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/db/db_pgsql
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -212,6 +222,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +256,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +281,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +371,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -401,7 +421,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/db/db_pgsql/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/db/db_pgsql/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -708,6 +727,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/db/db_pgsql/db_pgsql.cpp b/src/modules/db/db_pgsql/db_pgsql.cpp
index 869edfd..732f235 100755
--- a/src/modules/db/db_pgsql/db_pgsql.cpp
+++ b/src/modules/db/db_pgsql/db_pgsql.cpp
@@ -85,7 +85,7 @@ CSG_PG_Connections &	SG_PG_Get_Connection_Manager(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void _Error_Message(const CSG_String &Message, const CSG_String &Additional = SG_T(""))
+void _Error_Message(const CSG_String &Message, const CSG_String &Additional = "")
 {
 	SG_UI_Msg_Add_Execution(Message, true, SG_UI_MSG_STYLE_FAILURE);
 
@@ -93,9 +93,9 @@ void _Error_Message(const CSG_String &Message, const CSG_String &Additional = SG
 
 	if( Additional.Length() > 0 )
 	{
-		s	+= SG_T(":\n");
+		s	+= ":\n";
 		s	+= Additional;
-		s	+= SG_T("\n");
+		s	+= "\n";
 	}
 
 	SG_UI_Msg_Add_Error(s);
@@ -198,6 +198,7 @@ bool CSG_PG_Connection::Destroy(void)
 #define	SG_PG_INT4		23
 #define	SG_PG_TEXT		25
 #define	SG_PG_OID		26
+#define SG_PG_DATE		1082
 #define	SG_PG_FLOAT4	700
 #define	SG_PG_FLOAT8	701
 #define SG_PG_VARCHAR	1043
@@ -207,8 +208,8 @@ CSG_String CSG_PG_Connection::Get_Type_To_SQL(TSG_Data_Type Type, int Size)
 {
 	switch( Type )
 	{
-	case SG_DATATYPE_String:	return( CSG_String::Format(SG_T("varchar(%d)"), Size > 0 ? Size : 1) );
-	case SG_DATATYPE_Date:		return( "varchar(16)"      );
+	case SG_DATATYPE_String:	return( CSG_String::Format("varchar(%d)", Size > 0 ? Size : 1) );
+	case SG_DATATYPE_Date:		return( "date"             );
 	case SG_DATATYPE_Char:		return( "char(1)"          );
 	case SG_DATATYPE_Byte:		return( "smallint"         );
 	case SG_DATATYPE_Short:		return( "smallint"         );
@@ -234,6 +235,7 @@ TSG_Data_Type CSG_PG_Connection::Get_Type_From_SQL(int Type)
 	case SG_PG_INT2   :	return( SG_DATATYPE_Short  );	// 2 bytes integer
 	case SG_PG_INT4   :	return( SG_DATATYPE_Int    );	// 4 bytes integer
 	case SG_PG_INT8   :	return( SG_DATATYPE_Long   );	// 8 bytes integer
+	case SG_PG_DATE   :	return( SG_DATATYPE_Date   );
 	case SG_PG_FLOAT4 :	return( SG_DATATYPE_Float  );	// 4 bytes floating point, inexact
 	case SG_PG_FLOAT8 :	return( SG_DATATYPE_Double );	// 8 bytes floating point, inexact
 	case SG_PG_BYTEA  :	return( SG_DATATYPE_Binary );
@@ -318,7 +320,7 @@ CSG_String CSG_PG_Connection::Get_Version(void) const
 {
 	int	Version	= PQserverVersion(m_pgConnection);
 
-	return( CSG_String::Format(SG_T("%d.%d.%d"),
+	return( CSG_String::Format("%d.%d.%d",
 		(Version / 100) / 100,
 		(Version / 100) % 100,
 		(Version % 100)
@@ -467,7 +469,7 @@ CSG_Table CSG_PG_Connection::Get_Field_Desc(const CSG_String &Table_Name) const
 {
 	CSG_Table	Fields;
 
-	Fields.Set_Name(CSG_String::Format(SG_T("%s [%s]"), Table_Name.c_str(), _TL("Field Description")));
+	Fields.Set_Name(CSG_String::Format("%s [%s]", Table_Name.c_str(), _TL("Field Description")));
 
 	Fields.Add_Field(_TL("NAME"     ), SG_DATATYPE_String);
 	Fields.Add_Field(_TL("TYPE"     ), SG_DATATYPE_String);
@@ -518,7 +520,7 @@ CSG_String CSG_PG_Connection::Get_Field_Names(const CSG_String &Table_Name) cons
 	for(int i=0; i<Fields.Get_Count(); i++)
 	{
 		Names	+= Fields[i].asString(3);
-		Names	+= SG_T("|");
+		Names	+= "|";
 	}
 
 	return( Names );
@@ -541,29 +543,30 @@ bool CSG_PG_Connection::Execute(const CSG_String &SQL, CSG_Table *pTable)
 	switch( PQresultStatus(pResult) )
 	{
 	default:
-		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
-
 		bResult	= false;
+		PQclear(pResult);
+		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
 		break;
 
 	case PGRES_COMMAND_OK:
 		bResult	= true;
+		PQclear(pResult);
 		break;
 
 	case PGRES_TUPLES_OK:
 		if( pTable )
 		{
-			_Table_Load(*pTable, pResult);
-
+			bResult	= _Table_Load(*pTable, pResult);
 			pTable->Set_Name(_TL("Query Result"));
 		}
-
-		bResult	= true;
+		else
+		{
+			bResult	= true;
+			PQclear(pResult);
+		}
 		break;
 	}
 
-	PQclear(pResult);
-
 	return( bResult );
 }
 
@@ -698,7 +701,7 @@ bool CSG_PG_Connection::Table_Create(const CSG_String &Table_Name, const CSG_Tab
 	int			iField;
 	CSG_String	SQL;
 
-	SQL.Printf(SG_T("CREATE TABLE \"%s\"("), Table_Name.c_str());
+	SQL.Printf("CREATE TABLE \"%s\"(", Table_Name.c_str());
 
 	//-----------------------------------------------------
 	for(iField=0; iField<Table.Get_Field_Count(); iField++)
@@ -711,21 +714,21 @@ bool CSG_PG_Connection::Table_Create(const CSG_String &Table_Name, const CSG_Tab
 		{
 			if( (Flag & SG_PG_UNIQUE) != 0 )
 			{
-				s	+= SG_T(" UNIQUE");
+				s	+= " UNIQUE";
 			}
 
 			if( (Flag & SG_PG_NOT_NULL) != 0 )
 			{
-				s	+= SG_T(" NOT NULL");
+				s	+= " NOT NULL";
 			}
 		}
 
 		if( iField > 0 )
 		{
-			SQL	+= SG_T(", ");
+			SQL	+= ", ";
 		}
 
-		SQL	+= CSG_String::Format(SG_T("%s %s"), Table.Get_Field_Name(iField), s.c_str());
+		SQL	+= CSG_String::Format("%s %s", Table.Get_Field_Name(iField), s.c_str());
 	}
 
 	//-----------------------------------------------------
@@ -737,19 +740,19 @@ bool CSG_PG_Connection::Table_Create(const CSG_String &Table_Name, const CSG_Tab
 		{
 			if( (Flags[iField] & SG_PG_PRIMARY_KEY) != 0 )
 			{
-				s	+= s.Length() == 0 ? SG_T(", PRIMARY KEY(") : SG_T(", ");
+				s	+= s.Length() == 0 ? ", PRIMARY KEY(" : ", ";
 				s	+= Table.Get_Field_Name(iField);
 			}
 		}
 
 		if( s.Length() > 0 )
 		{
-			SQL	+= s + SG_T(")");
+			SQL	+= s + ")";
 		}
 	}
 
 	//-----------------------------------------------------
-	SQL	+= SG_T(")");
+	SQL	+= ")";
 
 	return( Execute(SQL) );
 }
@@ -764,7 +767,7 @@ bool CSG_PG_Connection::Table_Drop(const CSG_String &Table_Name, bool bCommit)
 		return( false );
 	}
 
-	return( Execute(CSG_String::Format(SG_T("DROP TABLE \"%s\""), Table_Name.c_str())) );
+	return( Execute(CSG_String::Format("DROP TABLE \"%s\"", Table_Name.c_str())) );
 }
 
 
@@ -801,16 +804,18 @@ bool CSG_PG_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Tab
 
 	for(iField=0; iField<nFields; iField++)
 	{
-		Insert	+= CSG_String::Format(SG_T("$%d%c"), 1 + iField, iField < nFields - 1 ? SG_T(',') : SG_T(')'));
+		Insert	+= CSG_String::Format("$%d%c", 1 + iField, iField < nFields - 1 ? SG_T(',') : SG_T(')'));
 
 		paramFormats[iField]	= Table.Get_Field_Type(iField) == SG_DATATYPE_Binary ? 1 : 0;
 
 		switch( Table.Get_Field_Type(iField) )
 		{
-		default:
+		case SG_DATATYPE_String: default:
+			Values[iField]	= (char *)SG_Malloc((1 + Table.Get_Field_Length(iField)) * sizeof(char));
+			break;
+
 		case SG_DATATYPE_Date:
-		case SG_DATATYPE_String:
-			Values [iField]	= (char *)SG_Malloc((1 + Table.Get_Field_Length(iField)) * sizeof(char));
+			Values[iField]	= (char *)SG_Malloc(16);
 			break;
 
 		case SG_DATATYPE_Short:
@@ -819,7 +824,7 @@ bool CSG_PG_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Tab
 		case SG_DATATYPE_Long:
 		case SG_DATATYPE_Float:
 		case SG_DATATYPE_Double:
-			Values [iField]	= (char *)SG_Malloc(256);
+			Values[iField]	= (char *)SG_Malloc(256);
 			break;
 
 		case SG_DATATYPE_Binary:
@@ -828,7 +833,9 @@ bool CSG_PG_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Tab
 	}
 
 	//-----------------------------------------------------
-	for(int iRecord=0; iRecord<Table.Get_Count() && SG_UI_Process_Set_Progress(iRecord, Table.Get_Count()); iRecord++)
+	bool	bResult	= true;
+
+	for(int iRecord=0; iRecord<Table.Get_Count() && bResult && SG_UI_Process_Set_Progress(iRecord, Table.Get_Count()); iRecord++)
 	{
 		CSG_Table_Record	*pRecord	= Table.Get_Record(iRecord);
 
@@ -871,7 +878,16 @@ bool CSG_PG_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Tab
 			}
 		}
 
-		PQexecParams(m_pgConnection, Insert, nFields, NULL, paramValues, paramLengths, paramFormats, 0);
+		PGresult *pResult = PQexecParams(m_pgConnection, Insert, nFields, NULL, paramValues, paramLengths, paramFormats, 0);
+
+		if( PQresultStatus(pResult) != PGRES_COMMAND_OK )
+		{
+			_Error_Message(_TL("SQL execution failed"), m_pgConnection);
+
+			bResult	= false;
+		}
+
+		PQclear(pResult);
 	}
 
 	//-----------------------------------------------------
@@ -889,7 +905,7 @@ bool CSG_PG_Connection::Table_Insert(const CSG_String &Table_Name, const CSG_Tab
 	SG_Free(paramFormats);
 //	SG_Free(paramTypes);
 
-	return( true );
+	return( bResult );
 }
 
 
@@ -940,14 +956,10 @@ bool CSG_PG_Connection::_Table_Load(CSG_Table &Table, const CSG_String &Select,
 	if( !is_Connected() )	{	_Error_Message(_TL("no database connection"));	return( false );	}
 
 	//-----------------------------------------------------
-	PGresult	*pResult	= PQexec(m_pgConnection, Select);
-
-	bool	bResult	= _Table_Load(Table, pResult);
+	bool	bResult	= _Table_Load(Table, PQexec(m_pgConnection, Select));
 
 	Table.Set_Name(Name);
 
-	PQclear(pResult);
-
 	return( bResult );
 }
 
@@ -961,6 +973,8 @@ bool CSG_PG_Connection::_Table_Load(CSG_Table &Table, void *_pResult) const
 	{
 		_Error_Message(_TL("SQL execution failed"), m_pgConnection);
 
+		PQclear(pResult);
+
 		return( false );
 	}
 
@@ -1015,13 +1029,15 @@ bool CSG_PG_Connection::_Table_Load(CSG_Table &Table, void *_pResult) const
 	}
 
 	//-----------------------------------------------------
+	PQclear(pResult);
+
 	return( true );
 }
 
 //---------------------------------------------------------
 bool CSG_PG_Connection::Table_Load(CSG_Table &Table, const CSG_String &Table_Name)
 {
-	if( _Table_Load(Table, CSG_String::Format(SG_T("SELECT * FROM \"%s\""), Table_Name.c_str()), Table_Name) )
+	if( _Table_Load(Table, CSG_String::Format("SELECT * FROM \"%s\"", Table_Name.c_str()), Table_Name) )
 	{
 		Add_MetaData(Table, Table_Name);
 
@@ -1036,26 +1052,26 @@ bool CSG_PG_Connection::Table_Load(CSG_Table &Table, const CSG_String &Tables, c
 {
 	CSG_String	Select;
 
-	Select.Printf(SG_T("SELECT %s %s FROM %s"), bDistinct ? SG_T("DISTINCT") : SG_T("ALL"), Fields.c_str(), Tables.c_str());
+	Select.Printf("SELECT %s %s FROM %s", bDistinct ? SG_T("DISTINCT") : SG_T("ALL"), Fields.c_str(), Tables.c_str());
 
 	if( Where.Length() )
 	{
-		Select	+= SG_T(" WHERE ") + Where;
+		Select	+= " WHERE " + Where;
 	}
 
 	if( Group.Length() )
 	{
-		Select	+= SG_T(" GROUP BY ") + Group;
+		Select	+= " GROUP BY " + Group;
 
 		if( Having.Length() )
 		{
-			Select	+= SG_T(" HAVING ") + Having;
+			Select	+= " HAVING " + Having;
 		}
 	}
 
 	if( Order.Length() )
 	{
-		Select	+= SG_T(" ORDER BY ") + Order;
+		Select	+= " ORDER BY " + Order;
 	}
 
 	if( _Table_Load(Table, Select, Table.Get_Name()) )
@@ -1100,7 +1116,7 @@ bool CSG_PG_Connection::Shapes_Load(CSG_Shapes *pShapes, const CSG_String &Name)
 	{
 		if( Geometry.Cmp(Info[i].asString(0)) )
 		{
-			Fields	+= CSG_String::Format(SG_T("\"%s\","), Info[i].asString(0));
+			Fields	+= CSG_String::Format("\"%s\",", Info[i].asString(0));
 		}
 	}
 
@@ -1652,7 +1668,7 @@ int CSG_PG_Connections::Get_Servers(CSG_String &Servers)
 
 	for(int i=0; i<s.Get_Count(); i++)
 	{
-		Servers	+= s[i] + SG_T("|");
+		Servers	+= s[i] + "|";
 	}
 
 	return( s.Get_Count() );
diff --git a/src/modules/docs/Makefile.in b/src/modules/docs/Makefile.in
index 2919da8..da1d11d 100644
--- a/src/modules/docs/Makefile.in
+++ b/src/modules/docs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/docs
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/docs/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/docs/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/docs/docs_html/Makefile.in b/src/modules/docs/docs_html/Makefile.in
index b5ecfcc..ec86340 100644
--- a/src/modules/docs/docs_html/Makefile.in
+++ b/src/modules/docs/docs_html/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/docs/docs_html
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -212,6 +222,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +256,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +281,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +371,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -399,7 +419,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/docs/docs_html/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/docs/docs_html/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -705,6 +724,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/docs/docs_pdf/Makefile.in b/src/modules/docs/docs_pdf/Makefile.in
index 06d7051..d05c63a 100644
--- a/src/modules/docs/docs_pdf/Makefile.in
+++ b/src/modules/docs/docs_pdf/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/docs/docs_pdf
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -217,6 +227,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -250,6 +261,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -268,6 +286,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -357,6 +376,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -404,7 +424,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/docs/docs_pdf/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/docs/docs_pdf/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -710,6 +729,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/garden/Makefile.in b/src/modules/garden/Makefile.in
index 84cdd36..1a99f65 100644
--- a/src/modules/garden/Makefile.in
+++ b/src/modules/garden/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/garden
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -150,6 +161,7 @@ ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = garden_fractals garden_games garden_learn_to_program \
 	garden_3d_viewer garden_webservices
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -208,6 +220,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -226,6 +245,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -315,6 +335,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -340,7 +361,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/garden/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -635,6 +655,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/garden/garden_3d_viewer/Makefile.in b/src/modules/garden/garden_3d_viewer/Makefile.in
index d3cb708..371f96b 100644
--- a/src/modules/garden/garden_3d_viewer/Makefile.in
+++ b/src/modules/garden/garden_3d_viewer/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/garden/garden_3d_viewer
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -401,7 +421,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_3d_viewer/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/garden/garden_3d_viewer/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -708,6 +727,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/garden/garden_fractals/Makefile.in b/src/modules/garden/garden_fractals/Makefile.in
index 4e39e3f..6b93758 100644
--- a/src/modules/garden/garden_fractals/Makefile.in
+++ b/src/modules/garden/garden_fractals/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/garden/garden_fractals
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -404,7 +424,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_fractals/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/garden/garden_fractals/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -712,6 +731,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/garden/garden_games/Makefile.in b/src/modules/garden/garden_games/Makefile.in
index 7e76345..de7bc66 100644
--- a/src/modules/garden/garden_games/Makefile.in
+++ b/src/modules/garden/garden_games/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/garden/garden_games
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -212,6 +222,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +256,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +281,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +371,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -396,7 +416,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_games/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/garden/garden_games/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -701,6 +720,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/garden/garden_learn_to_program/Makefile.in b/src/modules/garden/garden_learn_to_program/Makefile.in
index dd68d41..9f82f86 100644
--- a/src/modules/garden/garden_learn_to_program/Makefile.in
+++ b/src/modules/garden/garden_learn_to_program/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/garden/garden_learn_to_program
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -216,6 +226,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +260,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +285,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +375,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -423,7 +443,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_learn_to_program/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/garden/garden_learn_to_program/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -739,6 +758,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/garden/garden_webservices/Makefile.in b/src/modules/garden/garden_webservices/Makefile.in
index 3c5e219..8afb24a 100644
--- a/src/modules/garden/garden_webservices/Makefile.in
+++ b/src/modules/garden/garden_webservices/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/garden/garden_webservices
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -394,7 +414,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/garden/garden_webservices/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/garden/garden_webservices/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -698,6 +717,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/Makefile.in b/src/modules/grid/Makefile.in
index 2e06286..ef312ed 100644
--- a/src/modules/grid/Makefile.in
+++ b/src/modules/grid/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_analysis/Cost_Isotropic.cpp b/src/modules/grid/grid_analysis/Cost_Isotropic.cpp
index f91e93c..9310235 100755
--- a/src/modules/grid/grid_analysis/Cost_Isotropic.cpp
+++ b/src/modules/grid/grid_analysis/Cost_Isotropic.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Cost_Isotropic.cpp 2768 2016-02-01 16:48:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Cost_Isotropic.cpp
diff --git a/src/modules/grid/grid_analysis/Cost_Isotropic.h b/src/modules/grid/grid_analysis/Cost_Isotropic.h
index 9a94fae..cfcf428 100755
--- a/src/modules/grid/grid_analysis/Cost_Isotropic.h
+++ b/src/modules/grid/grid_analysis/Cost_Isotropic.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Cost_Isotropic.h 2768 2016-02-01 16:48:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Cost_Isotropic.h
diff --git a/src/modules/grid/grid_analysis/CoveredDistance.cpp b/src/modules/grid/grid_analysis/CoveredDistance.cpp
index c055e13..22c232a 100755
--- a/src/modules/grid/grid_analysis/CoveredDistance.cpp
+++ b/src/modules/grid/grid_analysis/CoveredDistance.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CoveredDistance.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CoveredDistance.cpp
diff --git a/src/modules/grid/grid_analysis/CoveredDistance.h b/src/modules/grid/grid_analysis/CoveredDistance.h
index 2f7a865..48516da 100755
--- a/src/modules/grid/grid_analysis/CoveredDistance.h
+++ b/src/modules/grid/grid_analysis/CoveredDistance.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CoveredDistance.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CoveredDistance.h
diff --git a/src/modules/grid/grid_analysis/CrossClassification.cpp b/src/modules/grid/grid_analysis/CrossClassification.cpp
index 890b4d2..09ff7bd 100755
--- a/src/modules/grid/grid_analysis/CrossClassification.cpp
+++ b/src/modules/grid/grid_analysis/CrossClassification.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CrossClassification.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CrossClassification.cpp
diff --git a/src/modules/grid/grid_analysis/CrossClassification.h b/src/modules/grid/grid_analysis/CrossClassification.h
index 0ef2e23..47ad728 100755
--- a/src/modules/grid/grid_analysis/CrossClassification.h
+++ b/src/modules/grid/grid_analysis/CrossClassification.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CrossClassification.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CrossClassification.h
diff --git a/src/modules/grid/grid_analysis/Grid_AHP.cpp b/src/modules/grid/grid_analysis/Grid_AHP.cpp
index 70ba1f8..e180ce1 100755
--- a/src/modules/grid/grid_analysis/Grid_AHP.cpp
+++ b/src/modules/grid/grid_analysis/Grid_AHP.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_AHP.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     AHP.cpp
diff --git a/src/modules/grid/grid_analysis/Grid_AHP.h b/src/modules/grid/grid_analysis/Grid_AHP.h
index c31cd61..291f3c6 100755
--- a/src/modules/grid/grid_analysis/Grid_AHP.h
+++ b/src/modules/grid/grid_analysis/Grid_AHP.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_AHP.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     AHP.h
diff --git a/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp b/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp
index 51817f7..fb3e22f 100755
--- a/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp
+++ b/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Accumulation_Functions.cpp 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.h b/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.h
index eacb129..8d59b2f 100755
--- a/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.h
+++ b/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Accumulation_Functions.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp b/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp
index b85c8b3..1b510fb 100755
--- a/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp
+++ b/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_AggregationIndex.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     AggregationIndex.cpp
diff --git a/src/modules/grid/grid_analysis/Grid_AggregationIndex.h b/src/modules/grid/grid_analysis/Grid_AggregationIndex.h
index f2a44ec..d545d3a 100755
--- a/src/modules/grid/grid_analysis/Grid_AggregationIndex.h
+++ b/src/modules/grid/grid_analysis/Grid_AggregationIndex.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_AggregationIndex.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     AggregationIndex.h
diff --git a/src/modules/grid/grid_analysis/Grid_CVA.cpp b/src/modules/grid/grid_analysis/Grid_CVA.cpp
index cad5bf3..0eb8df5 100755
--- a/src/modules/grid/grid_analysis/Grid_CVA.cpp
+++ b/src/modules/grid/grid_analysis/Grid_CVA.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CVA.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_CVA.cpp
diff --git a/src/modules/grid/grid_analysis/Grid_CVA.h b/src/modules/grid/grid_analysis/Grid_CVA.h
index 70ba8b0..455ff15 100755
--- a/src/modules/grid/grid_analysis/Grid_CVA.h
+++ b/src/modules/grid/grid_analysis/Grid_CVA.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CVA.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_CVA.h
diff --git a/src/modules/grid/grid_analysis/Grid_IMCORR.cpp b/src/modules/grid/grid_analysis/Grid_IMCORR.cpp
index 212368d..2580ea5 100755
--- a/src/modules/grid/grid_analysis/Grid_IMCORR.cpp
+++ b/src/modules/grid/grid_analysis/Grid_IMCORR.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_IMCORR.cpp 2881 2016-04-01 20:24:07Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/Grid_IMCORR.h b/src/modules/grid/grid_analysis/Grid_IMCORR.h
index a6d3441..c3605a6 100755
--- a/src/modules/grid/grid_analysis/Grid_IMCORR.h
+++ b/src/modules/grid/grid_analysis/Grid_IMCORR.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_IMCORR.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp b/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp
index 35560ca..89d5743 100755
--- a/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp
+++ b/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_LayerOfMaximumValue.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CLayerOfMaximumValue.cpp
diff --git a/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h b/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h
index 508aa82..88d1c69 100755
--- a/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h
+++ b/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_LayerOfMaximumValue.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     LayerOfMaximumValue.cpp
diff --git a/src/modules/grid/grid_analysis/Grid_Pattern.cpp b/src/modules/grid/grid_analysis/Grid_Pattern.cpp
index b683751..5e9971f 100755
--- a/src/modules/grid/grid_analysis/Grid_Pattern.cpp
+++ b/src/modules/grid/grid_analysis/Grid_Pattern.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Pattern.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_Pattern.cpp
diff --git a/src/modules/grid/grid_analysis/Grid_Pattern.h b/src/modules/grid/grid_analysis/Grid_Pattern.h
index d3b5af0..4bbb674 100755
--- a/src/modules/grid/grid_analysis/Grid_Pattern.h
+++ b/src/modules/grid/grid_analysis/Grid_Pattern.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Pattern.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_Pattern.h
diff --git a/src/modules/grid/grid_analysis/LeastCostPathProfile.cpp b/src/modules/grid/grid_analysis/LeastCostPathProfile.cpp
index efc225f..0cb2826 100755
--- a/src/modules/grid/grid_analysis/LeastCostPathProfile.cpp
+++ b/src/modules/grid/grid_analysis/LeastCostPathProfile.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: LeastCostPathProfile.cpp 2768 2016-02-01 16:48:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 ///////////////////////////////////////////////////////////
 //                                                       //
diff --git a/src/modules/grid/grid_analysis/LeastCostPathProfile.h b/src/modules/grid/grid_analysis/LeastCostPathProfile.h
index 15bf346..5c20c73 100755
--- a/src/modules/grid/grid_analysis/LeastCostPathProfile.h
+++ b/src/modules/grid/grid_analysis/LeastCostPathProfile.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: LeastCostPathProfile.h 2768 2016-02-01 16:48:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.cpp b/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.cpp
index c4028b0..46c795d 100755
--- a/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.cpp
+++ b/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: LeastCostPathProfile_Points.cpp 2841 2016-03-05 11:25:04Z reklov_w $
+ * Version $Id$
  *********************************************************/
 ///////////////////////////////////////////////////////////
 //                                                       //
diff --git a/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.h b/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.h
index bf17ebe..2e137e4 100755
--- a/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.h
+++ b/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: LeastCostPathProfile_Points.h 2768 2016-02-01 16:48:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/MLB_Interface.cpp b/src/modules/grid/grid_analysis/MLB_Interface.cpp
index 2772154..5cb1c9e 100755
--- a/src/modules/grid/grid_analysis/MLB_Interface.cpp
+++ b/src/modules/grid/grid_analysis/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2761 2016-01-22 14:02:05Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/MLB_Interface.h b/src/modules/grid/grid_analysis/MLB_Interface.h
index 1665e21..e6ea878 100755
--- a/src/modules/grid/grid_analysis/MLB_Interface.h
+++ b/src/modules/grid/grid_analysis/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/Makefile.am b/src/modules/grid/grid_analysis/Makefile.am
index 38a7ab5..e1a064c 100755
--- a/src/modules/grid/grid_analysis/Makefile.am
+++ b/src/modules/grid/grid_analysis/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/grid/grid_analysis/Makefile.in b/src/modules/grid/grid_analysis/Makefile.in
index f19d489..77e4722 100644
--- a/src/modules/grid/grid_analysis/Makefile.in
+++ b/src/modules/grid/grid_analysis/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_analysis
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -219,6 +229,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -252,6 +263,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -270,6 +288,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -359,6 +378,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -369,7 +389,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -436,7 +456,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/grid_analysis/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/grid_analysis/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -757,6 +776,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_analysis/Soil_Texture.cpp b/src/modules/grid/grid_analysis/Soil_Texture.cpp
index 55e07b0..1619b14 100755
--- a/src/modules/grid/grid_analysis/Soil_Texture.cpp
+++ b/src/modules/grid/grid_analysis/Soil_Texture.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Soil_Texture.cpp 2465 2015-04-02 15:49:29Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/Soil_Texture.h b/src/modules/grid/grid_analysis/Soil_Texture.h
index 5c2f5be..9e38f0b 100755
--- a/src/modules/grid/grid_analysis/Soil_Texture.h
+++ b/src/modules/grid/grid_analysis/Soil_Texture.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Soil_Texture.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/diversity_analysis.cpp b/src/modules/grid/grid_analysis/diversity_analysis.cpp
index 03313d1..c9ce9ba 100755
--- a/src/modules/grid/grid_analysis/diversity_analysis.cpp
+++ b/src/modules/grid/grid_analysis/diversity_analysis.cpp
@@ -252,7 +252,7 @@ bool CDiversity_Analysis::Get_Diversity(int x, int y)
 
 	for(int iCell=0; iCell<m_Search.Get_Count(); iCell++)
 	{
-		if( iRadius < m_Search.Get_Distance(iCell) )
+		if( iRadius < m_Search.Get_Distance(iCell) && iRadius < m_Radius )
 		{
 			Counters[iRadius++].m_nClasses	= Classes.Get_Count();
 		}
@@ -286,6 +286,8 @@ bool CDiversity_Analysis::Get_Diversity(int x, int y)
 		}
 	}
 
+	Counters[iRadius].m_nClasses	= Classes.Get_Count();
+
 	//-----------------------------------------------------
 	int		nCells = 0, nNeighbours = 0, nConnections = 0;
 
diff --git a/src/modules/grid/grid_analysis/fragmentation_base.cpp b/src/modules/grid/grid_analysis/fragmentation_base.cpp
index 8e2de0b..66aa5dd 100755
--- a/src/modules/grid/grid_analysis/fragmentation_base.cpp
+++ b/src/modules/grid/grid_analysis/fragmentation_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: fragmentation_base.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/fragmentation_base.h b/src/modules/grid/grid_analysis/fragmentation_base.h
index 169900a..6b3dd2b 100755
--- a/src/modules/grid/grid_analysis/fragmentation_base.h
+++ b/src/modules/grid/grid_analysis/fragmentation_base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: fragmentation_base.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/fragmentation_classify.cpp b/src/modules/grid/grid_analysis/fragmentation_classify.cpp
index 3dba36d..0acae34 100755
--- a/src/modules/grid/grid_analysis/fragmentation_classify.cpp
+++ b/src/modules/grid/grid_analysis/fragmentation_classify.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: fragmentation_classify.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/fragmentation_classify.h b/src/modules/grid/grid_analysis/fragmentation_classify.h
index 8d9d0c7..16eaff1 100755
--- a/src/modules/grid/grid_analysis/fragmentation_classify.h
+++ b/src/modules/grid/grid_analysis/fragmentation_classify.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: fragmentation_classify.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/fragmentation_resampling.cpp b/src/modules/grid/grid_analysis/fragmentation_resampling.cpp
index b705529..705f457 100755
--- a/src/modules/grid/grid_analysis/fragmentation_resampling.cpp
+++ b/src/modules/grid/grid_analysis/fragmentation_resampling.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: fragmentation_resampling.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/fragmentation_resampling.h b/src/modules/grid/grid_analysis/fragmentation_resampling.h
index 079b665..e151aed 100755
--- a/src/modules/grid/grid_analysis/fragmentation_resampling.h
+++ b/src/modules/grid/grid_analysis/fragmentation_resampling.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: fragmentation_resampling.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/fragmentation_standard.cpp b/src/modules/grid/grid_analysis/fragmentation_standard.cpp
index 0d76a53..6524348 100755
--- a/src/modules/grid/grid_analysis/fragmentation_standard.cpp
+++ b/src/modules/grid/grid_analysis/fragmentation_standard.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: fragmentation_standard.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/fragmentation_standard.h b/src/modules/grid/grid_analysis/fragmentation_standard.h
index 7830a59..5d97820 100755
--- a/src/modules/grid/grid_analysis/fragmentation_standard.h
+++ b/src/modules/grid/grid_analysis/fragmentation_standard.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: fragmentation_standard.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_analysis/owa.cpp b/src/modules/grid/grid_analysis/owa.cpp
index d1b14b8..8ffc7d8 100755
--- a/src/modules/grid/grid_analysis/owa.cpp
+++ b/src/modules/grid/grid_analysis/owa.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: owa.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     OWA.cpp
diff --git a/src/modules/grid/grid_analysis/owa.h b/src/modules/grid/grid_analysis/owa.h
index 8224c38..03d72ff 100755
--- a/src/modules/grid/grid_analysis/owa.h
+++ b/src/modules/grid/grid_analysis/owa.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: owa.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     owa.h
diff --git a/src/modules/grid/grid_calculus/Fuzzify.cpp b/src/modules/grid/grid_calculus/Fuzzify.cpp
index fb8c37b..2787b16 100755
--- a/src/modules/grid/grid_calculus/Fuzzify.cpp
+++ b/src/modules/grid/grid_calculus/Fuzzify.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Fuzzify.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Fuzzify.cpp
diff --git a/src/modules/grid/grid_calculus/Fuzzify.h b/src/modules/grid/grid_calculus/Fuzzify.h
index 6eba1e1..70604a8 100755
--- a/src/modules/grid/grid_calculus/Fuzzify.h
+++ b/src/modules/grid/grid_calculus/Fuzzify.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Fuzzify.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Fuzzify.h
diff --git a/src/modules/grid/grid_calculus/FuzzyAND.cpp b/src/modules/grid/grid_calculus/FuzzyAND.cpp
index f0c6a6a..3728e74 100755
--- a/src/modules/grid/grid_calculus/FuzzyAND.cpp
+++ b/src/modules/grid/grid_calculus/FuzzyAND.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FuzzyAND.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/FuzzyAND.h b/src/modules/grid/grid_calculus/FuzzyAND.h
index 5b194b1..267cc46 100755
--- a/src/modules/grid/grid_calculus/FuzzyAND.h
+++ b/src/modules/grid/grid_calculus/FuzzyAND.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FuzzyAND.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/FuzzyOR.cpp b/src/modules/grid/grid_calculus/FuzzyOR.cpp
index 4465fdc..cfd7f18 100755
--- a/src/modules/grid/grid_calculus/FuzzyOR.cpp
+++ b/src/modules/grid/grid_calculus/FuzzyOR.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FuzzyOR.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/FuzzyOR.h b/src/modules/grid/grid_calculus/FuzzyOR.h
index b83b129..f8bb853 100755
--- a/src/modules/grid/grid_calculus/FuzzyOR.h
+++ b/src/modules/grid/grid_calculus/FuzzyOR.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FuzzyOR.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Calculator.cpp b/src/modules/grid/grid_calculus/Grid_Calculator.cpp
index 6492e74..2f2e92f 100755
--- a/src/modules/grid/grid_calculus/Grid_Calculator.cpp
+++ b/src/modules/grid/grid_calculus/Grid_Calculator.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Calculator.cpp 2777 2016-02-10 15:04:57Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -108,10 +108,11 @@ CGrid_Calculator::CGrid_Calculator(void)
 		"The following operators are available for the formula definition:\n"
 	));
 
-	const CSG_String	Operators[3][2]	=
+	const CSG_String	Operators[4][2]	=
 	{
 		{	"xpos(), ypos()", _TL("Get the x/y coordinates for the current cell")	},
 		{	"row(), col()"  , _TL("Get the current cell's column/row index"     )	},
+		{	"nodata()"      , _TL("Returns resulting grid's no-data value"      )	},
 		{	"", ""	}
 	};
 
@@ -227,6 +228,14 @@ int CGrid_Calculator::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Para
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+double	g_NoData_Value	= -99999.;
+
+double	Get_NoData_Value(void)
+{
+	return( g_NoData_Value );
+}
+
+//---------------------------------------------------------
 bool CGrid_Calculator::On_Execute(void)
 {
 	bool					bUseNoData, bPosition[4];
@@ -241,6 +250,8 @@ bool CGrid_Calculator::On_Execute(void)
 	bUseNoData	= Parameters("USE_NODATA")->asBool();
 
 	//-----------------------------------------------------
+	Formula.Add_Function(SG_T("nodata"), (TSG_PFNC_Formula_1)Get_NoData_Value, 0, 0);
+
 	if( !Get_Formula(Formula, Parameters("FORMULA")->asString(), pGrids->Get_Count(), pXGrids->Get_Count(), bPosition) )
 	{
 		return( false );
@@ -281,6 +292,8 @@ bool CGrid_Calculator::On_Execute(void)
 
 	pResult->Set_Name(Parameters("NAME")->asString());
 
+	g_NoData_Value	= pResult->Get_NoData_Value();
+
 	int	nValues	= pGrids->Get_Count() + pXGrids->Get_Count()
 		+ (bPosition[0] ? 1 : 0)
 		+ (bPosition[1] ? 1 : 0)
diff --git a/src/modules/grid/grid_calculus/Grid_Calculator.h b/src/modules/grid/grid_calculus/Grid_Calculator.h
index 0151845..180045b 100755
--- a/src/modules/grid/grid_calculus/Grid_Calculator.h
+++ b/src/modules/grid/grid_calculus/Grid_Calculator.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Calculator.h 2467 2015-04-15 16:55:37Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Geometric_Figures.cpp b/src/modules/grid/grid_calculus/Grid_Geometric_Figures.cpp
index 45ee5e0..d4f77b8 100755
--- a/src/modules/grid/grid_calculus/Grid_Geometric_Figures.cpp
+++ b/src/modules/grid/grid_calculus/Grid_Geometric_Figures.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Geometric_Figures.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Geometric_Figures.h b/src/modules/grid/grid_calculus/Grid_Geometric_Figures.h
index d831c46..83547be 100755
--- a/src/modules/grid/grid_calculus/Grid_Geometric_Figures.h
+++ b/src/modules/grid/grid_calculus/Grid_Geometric_Figures.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Geometric_Figures.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Normalise.cpp b/src/modules/grid/grid_calculus/Grid_Normalise.cpp
index 2d0607c..f44aa84 100755
--- a/src/modules/grid/grid_calculus/Grid_Normalise.cpp
+++ b/src/modules/grid/grid_calculus/Grid_Normalise.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Normalise.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Normalise.h b/src/modules/grid/grid_calculus/Grid_Normalise.h
index b18e248..5976c57 100755
--- a/src/modules/grid/grid_calculus/Grid_Normalise.h
+++ b/src/modules/grid/grid_calculus/Grid_Normalise.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Normalise.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Plotter.cpp b/src/modules/grid/grid_calculus/Grid_Plotter.cpp
index 1895069..a5eda9a 100755
--- a/src/modules/grid/grid_calculus/Grid_Plotter.cpp
+++ b/src/modules/grid/grid_calculus/Grid_Plotter.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Plotter.cpp 2827 2016-02-25 11:33:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Plotter.h b/src/modules/grid/grid_calculus/Grid_Plotter.h
index b922a17..270fcd0 100755
--- a/src/modules/grid/grid_calculus/Grid_Plotter.h
+++ b/src/modules/grid/grid_calculus/Grid_Plotter.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Plotter.h 2827 2016-02-25 11:33:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Random_Field.cpp b/src/modules/grid/grid_calculus/Grid_Random_Field.cpp
index 955d2cd..40d288b 100755
--- a/src/modules/grid/grid_calculus/Grid_Random_Field.cpp
+++ b/src/modules/grid/grid_calculus/Grid_Random_Field.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Random_Field.cpp 2212 2014-09-01 13:29:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Random_Field.h b/src/modules/grid/grid_calculus/Grid_Random_Field.h
index 5c93898..094333b 100755
--- a/src/modules/grid/grid_calculus/Grid_Random_Field.h
+++ b/src/modules/grid/grid_calculus/Grid_Random_Field.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Random_Field.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp b/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp
index cb238c3..cdf6437 100755
--- a/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp
+++ b/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Random_Terrain.cpp 2569 2015-09-02 10:42:56Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_Random_Terrain.cpp
diff --git a/src/modules/grid/grid_calculus/Grid_Random_Terrain.h b/src/modules/grid/grid_calculus/Grid_Random_Terrain.h
index a659fc8..5fb5d54 100755
--- a/src/modules/grid/grid_calculus/Grid_Random_Terrain.h
+++ b/src/modules/grid/grid_calculus/Grid_Random_Terrain.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Random_Terrain.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_Random_Terrain.h
diff --git a/src/modules/grid/grid_calculus/Grid_Volume.cpp b/src/modules/grid/grid_calculus/Grid_Volume.cpp
index 9550697..ecf7d73 100755
--- a/src/modules/grid/grid_calculus/Grid_Volume.cpp
+++ b/src/modules/grid/grid_calculus/Grid_Volume.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Volume.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Grid_Volume.h b/src/modules/grid/grid_calculus/Grid_Volume.h
index 870131f..d8d0654 100755
--- a/src/modules/grid/grid_calculus/Grid_Volume.h
+++ b/src/modules/grid/grid_calculus/Grid_Volume.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Volume.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/MLB_Interface.cpp b/src/modules/grid/grid_calculus/MLB_Interface.cpp
index 81f89ed..2959c94 100755
--- a/src/modules/grid/grid_calculus/MLB_Interface.cpp
+++ b/src/modules/grid/grid_calculus/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/MLB_Interface.h b/src/modules/grid/grid_calculus/MLB_Interface.h
index add9ec1..4968b43 100755
--- a/src/modules/grid/grid_calculus/MLB_Interface.h
+++ b/src/modules/grid/grid_calculus/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/Makefile.am b/src/modules/grid/grid_calculus/Makefile.am
index 89f393d..5b97439 100755
--- a/src/modules/grid/grid_calculus/Makefile.am
+++ b/src/modules/grid/grid_calculus/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/grid/grid_calculus/Makefile.in b/src/modules/grid/grid_calculus/Makefile.in
index 9d0699b..9ddf45d 100644
--- a/src/modules/grid/grid_calculus/Makefile.in
+++ b/src/modules/grid/grid_calculus/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_calculus
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -220,6 +230,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -253,6 +264,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -271,6 +289,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -360,6 +379,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -370,7 +390,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -434,7 +454,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/grid_calculus/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/grid_calculus/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -797,6 +816,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_calculus/grid_difference.cpp b/src/modules/grid/grid_calculus/grid_difference.cpp
index 1c5f29d..fc06c48 100755
--- a/src/modules/grid/grid_calculus/grid_difference.cpp
+++ b/src/modules/grid/grid_calculus/grid_difference.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_difference.cpp 2785 2016-02-12 12:21:50Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/grid_difference.h b/src/modules/grid/grid_calculus/grid_difference.h
index acda16b..6d021fb 100755
--- a/src/modules/grid/grid_calculus/grid_difference.h
+++ b/src/modules/grid/grid_calculus/grid_difference.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_difference.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/kff_synth.cpp b/src/modules/grid/grid_calculus/kff_synth.cpp
index 21428bf..69152ff 100755
--- a/src/modules/grid/grid_calculus/kff_synth.cpp
+++ b/src/modules/grid/grid_calculus/kff_synth.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: kff_synth.cpp 2132 2014-05-29 10:10:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus/kff_synth.h b/src/modules/grid/grid_calculus/kff_synth.h
index b8eb46e..4dccc9a 100755
--- a/src/modules/grid/grid_calculus/kff_synth.h
+++ b/src/modules/grid/grid_calculus/kff_synth.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: kff_synth.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus_bsl/MLB_Interface.cpp b/src/modules/grid/grid_calculus_bsl/MLB_Interface.cpp
index 014aba2..869acc6 100755
--- a/src/modules/grid/grid_calculus_bsl/MLB_Interface.cpp
+++ b/src/modules/grid/grid_calculus_bsl/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus_bsl/MLB_Interface.h b/src/modules/grid/grid_calculus_bsl/MLB_Interface.h
index d522681..011a314 100755
--- a/src/modules/grid/grid_calculus_bsl/MLB_Interface.h
+++ b/src/modules/grid/grid_calculus_bsl/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus_bsl/Makefile.am b/src/modules/grid/grid_calculus_bsl/Makefile.am
index de25096..477c6c2 100755
--- a/src/modules/grid/grid_calculus_bsl/Makefile.am
+++ b/src/modules/grid/grid_calculus_bsl/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/grid/grid_calculus_bsl/Makefile.in b/src/modules/grid/grid_calculus_bsl/Makefile.in
index 0df47b1..8535189 100644
--- a/src/modules/grid/grid_calculus_bsl/Makefile.in
+++ b/src/modules/grid/grid_calculus_bsl/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_calculus_bsl
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -216,6 +226,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +260,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +285,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +375,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -366,7 +386,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -431,7 +451,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/grid_calculus_bsl/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/grid_calculus_bsl/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -749,6 +768,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_calculus_bsl/ausdruck.cpp b/src/modules/grid/grid_calculus_bsl/ausdruck.cpp
index 08f566f..854eca9 100755
--- a/src/modules/grid/grid_calculus_bsl/ausdruck.cpp
+++ b/src/modules/grid/grid_calculus_bsl/ausdruck.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ausdruck.cpp 2387 2015-02-01 22:26:22Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 //#include "..\stdafx.h"
diff --git a/src/modules/grid/grid_calculus_bsl/ausdruck.h b/src/modules/grid/grid_calculus_bsl/ausdruck.h
index 7a7f5e1..13c3c6e 100755
--- a/src/modules/grid/grid_calculus_bsl/ausdruck.h
+++ b/src/modules/grid/grid_calculus_bsl/ausdruck.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ausdruck.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __AUSDRUCK_H
 #define __AUSDRUCK_H
diff --git a/src/modules/grid/grid_calculus_bsl/auswert_anweisung.cpp b/src/modules/grid/grid_calculus_bsl/auswert_anweisung.cpp
index e403b04..a55172d 100755
--- a/src/modules/grid/grid_calculus_bsl/auswert_anweisung.cpp
+++ b/src/modules/grid/grid_calculus_bsl/auswert_anweisung.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: auswert_anweisung.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 //#include "..\stdafx.h"
diff --git a/src/modules/grid/grid_calculus_bsl/auswert_anweisung.h b/src/modules/grid/grid_calculus_bsl/auswert_anweisung.h
index 49a3ebb..91fa3dd 100755
--- a/src/modules/grid/grid_calculus_bsl/auswert_anweisung.h
+++ b/src/modules/grid/grid_calculus_bsl/auswert_anweisung.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: auswert_anweisung.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __AUSWERT_ANWEISUNG_H 
 #define __AUSWERT_ANWEISUNG_H 
diff --git a/src/modules/grid/grid_calculus_bsl/auswert_foreach.cpp b/src/modules/grid/grid_calculus_bsl/auswert_foreach.cpp
index 91b9194..9082e54 100755
--- a/src/modules/grid/grid_calculus_bsl/auswert_foreach.cpp
+++ b/src/modules/grid/grid_calculus_bsl/auswert_foreach.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: auswert_foreach.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 #include "auswert_foreach.h"
diff --git a/src/modules/grid/grid_calculus_bsl/auswert_foreach.h b/src/modules/grid/grid_calculus_bsl/auswert_foreach.h
index f2c4361..0640d45 100755
--- a/src/modules/grid/grid_calculus_bsl/auswert_foreach.h
+++ b/src/modules/grid/grid_calculus_bsl/auswert_foreach.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: auswert_foreach.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __AUSWERT_FOREACH_H 
 #define __AUSWERT_FOREACH_H 
diff --git a/src/modules/grid/grid_calculus_bsl/auswert_if.cpp b/src/modules/grid/grid_calculus_bsl/auswert_if.cpp
index 9b6c45d..97500d7 100755
--- a/src/modules/grid/grid_calculus_bsl/auswert_if.cpp
+++ b/src/modules/grid/grid_calculus_bsl/auswert_if.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: auswert_if.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 //#include <..\stdafx.h>
diff --git a/src/modules/grid/grid_calculus_bsl/auswert_if.h b/src/modules/grid/grid_calculus_bsl/auswert_if.h
index e619501..f5c70ce 100755
--- a/src/modules/grid/grid_calculus_bsl/auswert_if.h
+++ b/src/modules/grid/grid_calculus_bsl/auswert_if.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: auswert_if.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __AUSWERT_IF_H 
 #define __AUSWERT_IF_H 
diff --git a/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.cpp b/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.cpp
index 8ae0682..0e2442e 100755
--- a/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.cpp
+++ b/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: auswert_zuweisung.cpp 2210 2014-08-28 14:00:19Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 #include "pars_all.h"
diff --git a/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.h b/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.h
index 4088fb5..e35f109 100755
--- a/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.h
+++ b/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: auswert_zuweisung.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __AUSWERT_ZUWEISUNG_H 
 #define __AUSWERT_ZUWEISUNG_H 
diff --git a/src/modules/grid/grid_calculus_bsl/basistypen.cpp b/src/modules/grid/grid_calculus_bsl/basistypen.cpp
index 1929f76..200342c 100755
--- a/src/modules/grid/grid_calculus_bsl/basistypen.cpp
+++ b/src/modules/grid/grid_calculus_bsl/basistypen.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: basistypen.cpp 2807 2016-02-21 19:32:40Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 #include <iostream>
diff --git a/src/modules/grid/grid_calculus_bsl/basistypen.h b/src/modules/grid/grid_calculus_bsl/basistypen.h
index e988971..55014cd 100755
--- a/src/modules/grid/grid_calculus_bsl/basistypen.h
+++ b/src/modules/grid/grid_calculus_bsl/basistypen.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: basistypen.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __BASISTYPEN_H 
 #define __BASISTYPEN_H 
diff --git a/src/modules/grid/grid_calculus_bsl/bedingung.cpp b/src/modules/grid/grid_calculus_bsl/bedingung.cpp
index fb4e5a9..0df0401 100755
--- a/src/modules/grid/grid_calculus_bsl/bedingung.cpp
+++ b/src/modules/grid/grid_calculus_bsl/bedingung.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: bedingung.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 //#include <..\stdafx.h>
diff --git a/src/modules/grid/grid_calculus_bsl/bedingung.h b/src/modules/grid/grid_calculus_bsl/bedingung.h
index 60bb3ad..8bd2e04 100755
--- a/src/modules/grid/grid_calculus_bsl/bedingung.h
+++ b/src/modules/grid/grid_calculus_bsl/bedingung.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: bedingung.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __BEDINGUNG_H 
 #define __BEDINGUNG_H 
diff --git a/src/modules/grid/grid_calculus_bsl/bsl_interpreter.cpp b/src/modules/grid/grid_calculus_bsl/bsl_interpreter.cpp
index 5d00047..16ec2e1 100755
--- a/src/modules/grid/grid_calculus_bsl/bsl_interpreter.cpp
+++ b/src/modules/grid/grid_calculus_bsl/bsl_interpreter.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: bsl_interpreter.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus_bsl/bsl_interpreter.h b/src/modules/grid/grid_calculus_bsl/bsl_interpreter.h
index a9636fd..2cf0a23 100755
--- a/src/modules/grid/grid_calculus_bsl/bsl_interpreter.h
+++ b/src/modules/grid/grid_calculus_bsl/bsl_interpreter.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: bsl_interpreter.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_calculus_bsl/diverses.cpp b/src/modules/grid/grid_calculus_bsl/diverses.cpp
index a6c35ec..c823fe8 100755
--- a/src/modules/grid/grid_calculus_bsl/diverses.cpp
+++ b/src/modules/grid/grid_calculus_bsl/diverses.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: diverses.cpp 2211 2014-08-28 14:09:29Z reklov_w $
+ * Version $Id$
  *********************************************************/
 // diverses.cc
 
diff --git a/src/modules/grid/grid_calculus_bsl/diverses.h b/src/modules/grid/grid_calculus_bsl/diverses.h
index 88aa433..d9342e4 100755
--- a/src/modules/grid/grid_calculus_bsl/diverses.h
+++ b/src/modules/grid/grid_calculus_bsl/diverses.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: diverses.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /* diverses.h */
 
diff --git a/src/modules/grid/grid_calculus_bsl/foreach.cpp b/src/modules/grid/grid_calculus_bsl/foreach.cpp
index 641b19b..785a2e9 100755
--- a/src/modules/grid/grid_calculus_bsl/foreach.cpp
+++ b/src/modules/grid/grid_calculus_bsl/foreach.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: foreach.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 //#include <..\stdafx.h>
 
diff --git a/src/modules/grid/grid_calculus_bsl/foreach.h b/src/modules/grid/grid_calculus_bsl/foreach.h
index cad3443..1e67f2a 100755
--- a/src/modules/grid/grid_calculus_bsl/foreach.h
+++ b/src/modules/grid/grid_calculus_bsl/foreach.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: foreach.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __FOREACH_H 
 #define __FOREACH_H 
diff --git a/src/modules/grid/grid_calculus_bsl/funktion.cpp b/src/modules/grid/grid_calculus_bsl/funktion.cpp
index 2b625d7..32e17a6 100755
--- a/src/modules/grid/grid_calculus_bsl/funktion.cpp
+++ b/src/modules/grid/grid_calculus_bsl/funktion.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: funktion.cpp 2210 2014-08-28 14:00:19Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 //#include <..\stdafx.h>
diff --git a/src/modules/grid/grid_calculus_bsl/funktion.h b/src/modules/grid/grid_calculus_bsl/funktion.h
index 6d76bcd..03af728 100755
--- a/src/modules/grid/grid_calculus_bsl/funktion.h
+++ b/src/modules/grid/grid_calculus_bsl/funktion.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: funktion.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __FUNKTION_BB_H 
 #define __FUNKTION_BB_H 
diff --git a/src/modules/grid/grid_calculus_bsl/funktion_numerisch.h b/src/modules/grid/grid_calculus_bsl/funktion_numerisch.h
index 7d28837..8325a60 100755
--- a/src/modules/grid/grid_calculus_bsl/funktion_numerisch.h
+++ b/src/modules/grid/grid_calculus_bsl/funktion_numerisch.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: funktion_numerisch.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __FUNKTION_NUMERISCH_H 
 #define __FUNKTION_NUMERISCH_H 
diff --git a/src/modules/grid/grid_calculus_bsl/funktion_statistisch.h b/src/modules/grid/grid_calculus_bsl/funktion_statistisch.h
index 9080a25..f68d4e3 100755
--- a/src/modules/grid/grid_calculus_bsl/funktion_statistisch.h
+++ b/src/modules/grid/grid_calculus_bsl/funktion_statistisch.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: funktion_statistisch.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __FUNKTION_STATISTISCH_H 
 #define __FUNKTION_STATISTISCH_H 
diff --git a/src/modules/grid/grid_calculus_bsl/gr_def.h b/src/modules/grid/grid_calculus_bsl/gr_def.h
index 42a0f12..746d281 100755
--- a/src/modules/grid/grid_calculus_bsl/gr_def.h
+++ b/src/modules/grid/grid_calculus_bsl/gr_def.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: gr_def.h 1822 2013-09-03 20:33:02Z manfred-e $
+ * Version $Id$
  *********************************************************/
 ////////////////////////////////////////////////////////////////////////////
 // Programm    :                                                            
diff --git a/src/modules/grid/grid_calculus_bsl/gr_syst.h b/src/modules/grid/grid_calculus_bsl/gr_syst.h
index e72a0de..91ee543 100755
--- a/src/modules/grid/grid_calculus_bsl/gr_syst.h
+++ b/src/modules/grid/grid_calculus_bsl/gr_syst.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: gr_syst.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __gr_syst_h__
 #define __gr_syst_h__
diff --git a/src/modules/grid/grid_calculus_bsl/grid_bsl.cpp b/src/modules/grid/grid_calculus_bsl/grid_bsl.cpp
index 5cd7968..f47c17b 100755
--- a/src/modules/grid/grid_calculus_bsl/grid_bsl.cpp
+++ b/src/modules/grid/grid_calculus_bsl/grid_bsl.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_bsl.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 #include <string>
diff --git a/src/modules/grid/grid_calculus_bsl/grid_bsl.h b/src/modules/grid/grid_calculus_bsl/grid_bsl.h
index 1f24e39..fb25420 100755
--- a/src/modules/grid/grid_calculus_bsl/grid_bsl.h
+++ b/src/modules/grid/grid_calculus_bsl/grid_bsl.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_bsl.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __GRID_H 
 #define __GRID_H 
diff --git a/src/modules/grid/grid_calculus_bsl/interpolation.cpp b/src/modules/grid/grid_calculus_bsl/interpolation.cpp
index 9d0b136..95f849c 100755
--- a/src/modules/grid/grid_calculus_bsl/interpolation.cpp
+++ b/src/modules/grid/grid_calculus_bsl/interpolation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: interpolation.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 // interplation.cc
 //#include "../stdafx.h"
diff --git a/src/modules/grid/grid_calculus_bsl/interpolation.h b/src/modules/grid/grid_calculus_bsl/interpolation.h
index bb579a5..57ecedb 100755
--- a/src/modules/grid/grid_calculus_bsl/interpolation.h
+++ b/src/modules/grid/grid_calculus_bsl/interpolation.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: interpolation.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __INTERPOL_H 
 #define __INTERPOL_H 
diff --git a/src/modules/grid/grid_calculus_bsl/pars_all.cpp b/src/modules/grid/grid_calculus_bsl/pars_all.cpp
index eae0b8e..1cd22f7 100755
--- a/src/modules/grid/grid_calculus_bsl/pars_all.cpp
+++ b/src/modules/grid/grid_calculus_bsl/pars_all.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pars_all.cpp 962 2011-03-24 23:59:32Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 //#include "..\stdafx.h"
diff --git a/src/modules/grid/grid_calculus_bsl/pars_all.h b/src/modules/grid/grid_calculus_bsl/pars_all.h
index 05326eb..c78407b 100755
--- a/src/modules/grid/grid_calculus_bsl/pars_all.h
+++ b/src/modules/grid/grid_calculus_bsl/pars_all.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pars_all.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __PARS_ALL_H 
 #define __PARS_ALL_H 
diff --git a/src/modules/grid/grid_calculus_bsl/vector.cpp b/src/modules/grid/grid_calculus_bsl/vector.cpp
index c3aaa73..199fe0b 100755
--- a/src/modules/grid/grid_calculus_bsl/vector.cpp
+++ b/src/modules/grid/grid_calculus_bsl/vector.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: vector.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 ////////////////////////////////////////////////////////////////////////////
 // Programm    :                                                            
diff --git a/src/modules/grid/grid_calculus_bsl/vector.h b/src/modules/grid/grid_calculus_bsl/vector.h
index a0e83fd..4d6141b 100755
--- a/src/modules/grid/grid_calculus_bsl/vector.h
+++ b/src/modules/grid/grid_calculus_bsl/vector.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: vector.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 ////////////////////////////////////////////////////////////////////////////
 // Programm    :                                                            
diff --git a/src/modules/grid/grid_calculus_bsl/zuweisung.cpp b/src/modules/grid/grid_calculus_bsl/zuweisung.cpp
index 5e538ce..3dceb27 100755
--- a/src/modules/grid/grid_calculus_bsl/zuweisung.cpp
+++ b/src/modules/grid/grid_calculus_bsl/zuweisung.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: zuweisung.cpp 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 //#include <..\stdafx.h>
 
diff --git a/src/modules/grid/grid_calculus_bsl/zuweisung.h b/src/modules/grid/grid_calculus_bsl/zuweisung.h
index d453ee5..71c758e 100755
--- a/src/modules/grid/grid_calculus_bsl/zuweisung.h
+++ b/src/modules/grid/grid_calculus_bsl/zuweisung.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: zuweisung.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 #ifndef __ZUWEISUNG_H 
 #define __ZUWEISUNG_H 
diff --git a/src/modules/grid/grid_filter/Filter.cpp b/src/modules/grid/grid_filter/Filter.cpp
index 1a99154..190397e 100755
--- a/src/modules/grid/grid_filter/Filter.cpp
+++ b/src/modules/grid/grid_filter/Filter.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter.cpp 2629 2015-10-01 09:40:40Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter.h b/src/modules/grid/grid_filter/Filter.h
index bc0f582..59648b9 100755
--- a/src/modules/grid/grid_filter/Filter.h
+++ b/src/modules/grid/grid_filter/Filter.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter.h 2629 2015-10-01 09:40:40Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/FilterClumps.cpp b/src/modules/grid/grid_filter/FilterClumps.cpp
index a8ad4bd..45665ac 100755
--- a/src/modules/grid/grid_filter/FilterClumps.cpp
+++ b/src/modules/grid/grid_filter/FilterClumps.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FilterClumps.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     FilterClumps.cpp
diff --git a/src/modules/grid/grid_filter/FilterClumps.h b/src/modules/grid/grid_filter/FilterClumps.h
index 8851f5d..58a058d 100755
--- a/src/modules/grid/grid_filter/FilterClumps.h
+++ b/src/modules/grid/grid_filter/FilterClumps.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FilterClumps.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     FilterClumps.h
diff --git a/src/modules/grid/grid_filter/Filter_3x3.cpp b/src/modules/grid/grid_filter/Filter_3x3.cpp
index 3c31438..3db4fb6 100755
--- a/src/modules/grid/grid_filter/Filter_3x3.cpp
+++ b/src/modules/grid/grid_filter/Filter_3x3.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_3x3.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_3x3.h b/src/modules/grid/grid_filter/Filter_3x3.h
index 346d60a..4ed424d 100755
--- a/src/modules/grid/grid_filter/Filter_3x3.h
+++ b/src/modules/grid/grid_filter/Filter_3x3.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_3x3.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Gauss.cpp b/src/modules/grid/grid_filter/Filter_Gauss.cpp
index 8fc5a8f..51a2871 100755
--- a/src/modules/grid/grid_filter/Filter_Gauss.cpp
+++ b/src/modules/grid/grid_filter/Filter_Gauss.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Gauss.cpp 1960 2014-02-03 12:43:13Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Gauss.h b/src/modules/grid/grid_filter/Filter_Gauss.h
index efd8dc0..03b9e87 100755
--- a/src/modules/grid/grid_filter/Filter_Gauss.h
+++ b/src/modules/grid/grid_filter/Filter_Gauss.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Gauss.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_LoG.cpp b/src/modules/grid/grid_filter/Filter_LoG.cpp
index 2754f0e..e5d2d35 100755
--- a/src/modules/grid/grid_filter/Filter_LoG.cpp
+++ b/src/modules/grid/grid_filter/Filter_LoG.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_LoG.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_LoG.h b/src/modules/grid/grid_filter/Filter_LoG.h
index 6223354..3b36b84 100755
--- a/src/modules/grid/grid_filter/Filter_LoG.h
+++ b/src/modules/grid/grid_filter/Filter_LoG.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_LoG.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Majority.cpp b/src/modules/grid/grid_filter/Filter_Majority.cpp
index f52a77f..2a2d635 100755
--- a/src/modules/grid/grid_filter/Filter_Majority.cpp
+++ b/src/modules/grid/grid_filter/Filter_Majority.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Majority.cpp 2476 2015-04-22 18:41:38Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Majority.h b/src/modules/grid/grid_filter/Filter_Majority.h
index df38dda..00fd0d5 100755
--- a/src/modules/grid/grid_filter/Filter_Majority.h
+++ b/src/modules/grid/grid_filter/Filter_Majority.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Majority.h 2476 2015-04-22 18:41:38Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Morphology.cpp b/src/modules/grid/grid_filter/Filter_Morphology.cpp
index e9431a4..2d4cf65 100755
--- a/src/modules/grid/grid_filter/Filter_Morphology.cpp
+++ b/src/modules/grid/grid_filter/Filter_Morphology.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Morphology.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Morphology.h b/src/modules/grid/grid_filter/Filter_Morphology.h
index d34dfea..5b48708 100755
--- a/src/modules/grid/grid_filter/Filter_Morphology.h
+++ b/src/modules/grid/grid_filter/Filter_Morphology.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Morphology.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.cpp b/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.cpp
index 373946e..ea41d4f 100755
--- a/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.cpp
+++ b/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Multi_Dir_Lee.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.h b/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.h
index 7cee407..5cd9e14 100755
--- a/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.h
+++ b/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Multi_Dir_Lee.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Rank.cpp b/src/modules/grid/grid_filter/Filter_Rank.cpp
index eb6732f..2109e63 100755
--- a/src/modules/grid/grid_filter/Filter_Rank.cpp
+++ b/src/modules/grid/grid_filter/Filter_Rank.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Rank.cpp 2476 2015-04-22 18:41:38Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Rank.h b/src/modules/grid/grid_filter/Filter_Rank.h
index 5044bc6..961e0b1 100755
--- a/src/modules/grid/grid_filter/Filter_Rank.h
+++ b/src/modules/grid/grid_filter/Filter_Rank.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Rank.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.cpp b/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.cpp
index 2da1a71..6d14630 100755
--- a/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.cpp
+++ b/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Terrain_SlopeBased.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.h b/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.h
index 189edfd..175d657 100755
--- a/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.h
+++ b/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Terrain_SlopeBased.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/MLB_Interface.cpp b/src/modules/grid/grid_filter/MLB_Interface.cpp
index 1cb1d19..78e2015 100755
--- a/src/modules/grid/grid_filter/MLB_Interface.cpp
+++ b/src/modules/grid/grid_filter/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2815 2016-02-22 22:47:52Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/MLB_Interface.h b/src/modules/grid/grid_filter/MLB_Interface.h
index 9fcb926..dd4896e 100755
--- a/src/modules/grid/grid_filter/MLB_Interface.h
+++ b/src/modules/grid/grid_filter/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Makefile.am b/src/modules/grid/grid_filter/Makefile.am
index f08c3fa..874f117 100755
--- a/src/modules/grid/grid_filter/Makefile.am
+++ b/src/modules/grid/grid_filter/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/grid/grid_filter/Makefile.in b/src/modules/grid/grid_filter/Makefile.in
index d860a2f..f9baa76 100644
--- a/src/modules/grid/grid_filter/Makefile.in
+++ b/src/modules/grid/grid_filter/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_filter
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -221,6 +231,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -254,6 +265,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -272,6 +290,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -361,6 +380,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -371,7 +391,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -445,7 +465,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/grid_filter/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/grid_filter/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -814,6 +833,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_filter/bin_erosion_reconst.cpp b/src/modules/grid/grid_filter/bin_erosion_reconst.cpp
index ccac801..01a3251 100755
--- a/src/modules/grid/grid_filter/bin_erosion_reconst.cpp
+++ b/src/modules/grid/grid_filter/bin_erosion_reconst.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: bin_erosion_reconst.cpp 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/bin_erosion_reconst.h b/src/modules/grid/grid_filter/bin_erosion_reconst.h
index 53dc592..ffe896f 100755
--- a/src/modules/grid/grid_filter/bin_erosion_reconst.h
+++ b/src/modules/grid/grid_filter/bin_erosion_reconst.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: bin_erosion_reconst.h 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/connect_analysis.cpp b/src/modules/grid/grid_filter/connect_analysis.cpp
index 33308f2..847ebf8 100755
--- a/src/modules/grid/grid_filter/connect_analysis.cpp
+++ b/src/modules/grid/grid_filter/connect_analysis.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: connect_analysis.cpp 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/connect_analysis.h b/src/modules/grid/grid_filter/connect_analysis.h
index 43c771e..20519ef 100755
--- a/src/modules/grid/grid_filter/connect_analysis.h
+++ b/src/modules/grid/grid_filter/connect_analysis.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: connect_analysis.h 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.c b/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.c
index f60ad83..b1e59a1 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.c
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.c
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: bin_geovinc.c 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.h b/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.h
index 1a14747..80093fa 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.h
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/bin_geovinc.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: bin_geovinc.h 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.c b/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.c
index b888663..5ef42df 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.c
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.c
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: combcontour.c 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.h b/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.h
index fb5e138..3089060 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.h
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/combcontour.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: combcontour.h 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.c b/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.c
index 4a4af62..28624f2 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.c
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.c
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: errfunc.c 2133 2014-05-29 10:13:13Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.h b/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.h
index 63a2f9d..3dcd08b 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.h
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/errfunc.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: errfunc.h 1937 2014-01-11 18:22:42Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.c b/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.c
index 154e872..e61a04b 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.c
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/geovinc.c
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: geovinc.c 2348 2014-12-10 10:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/listfuncs.inc b/src/modules/grid/grid_filter/geodesic_morph_rec/listfuncs.inc
index cfe787e..a01f972 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/listfuncs.inc
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/listfuncs.inc
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: listfuncs.inc 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/rho.h b/src/modules/grid/grid_filter/geodesic_morph_rec/rho.h
index 697c136..5034668 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/rho.h
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/rho.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: rho.h 1937 2014-01-11 18:22:42Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.c b/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.c
index 29b8916..dd3f8cc 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.c
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.c
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: spezfunc.c 1937 2014-01-11 18:22:42Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.h b/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.h
index 8d8a91f..037fe71 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.h
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/spezfunc.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: spezfunc.h 1937 2014-01-11 18:22:42Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.c b/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.c
index 3f1cd2c..54d7883 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.c
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.c
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: storeorg.c 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.h b/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.h
index 64501ac..9a1e314 100755
--- a/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.h
+++ b/src/modules/grid/grid_filter/geodesic_morph_rec/storeorg.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: storeorg.h 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geomrec.cpp b/src/modules/grid/grid_filter/geomrec.cpp
index 51998ec..cdcd96f 100755
--- a/src/modules/grid/grid_filter/geomrec.cpp
+++ b/src/modules/grid/grid_filter/geomrec.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: geomrec.cpp 2348 2014-12-10 10:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/geomrec.h b/src/modules/grid/grid_filter/geomrec.h
index bcc664a..dab3a41 100755
--- a/src/modules/grid/grid_filter/geomrec.h
+++ b/src/modules/grid/grid_filter/geomrec.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: geomrec.h 1936 2014-01-11 14:07:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation.cpp b/src/modules/grid/grid_gridding/Interpolation.cpp
index 524ef92..60ad1e4 100755
--- a/src/modules/grid/grid_gridding/Interpolation.cpp
+++ b/src/modules/grid/grid_gridding/Interpolation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation.cpp 2871 2016-03-30 11:32:35Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation.h b/src/modules/grid/grid_gridding/Interpolation.h
index c262ed1..c4f4c0b 100755
--- a/src/modules/grid/grid_gridding/Interpolation.h
+++ b/src/modules/grid/grid_gridding/Interpolation.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_InverseDistance.cpp b/src/modules/grid/grid_gridding/Interpolation_InverseDistance.cpp
index da500c5..156a7e9 100755
--- a/src/modules/grid/grid_gridding/Interpolation_InverseDistance.cpp
+++ b/src/modules/grid/grid_gridding/Interpolation_InverseDistance.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_InverseDistance.cpp 2381 2015-01-30 16:37:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_InverseDistance.h b/src/modules/grid/grid_gridding/Interpolation_InverseDistance.h
index c10beb9..3abdbc2 100755
--- a/src/modules/grid/grid_gridding/Interpolation_InverseDistance.h
+++ b/src/modules/grid/grid_gridding/Interpolation_InverseDistance.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_InverseDistance.h 2381 2015-01-30 16:37:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp b/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp
index 3a8c5c9..f3ff36a 100755
--- a/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp
+++ b/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_NaturalNeighbour.cpp 2854 2016-03-23 09:09:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.h b/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.h
index 8fc9010..d3370ab 100755
--- a/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.h
+++ b/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_NaturalNeighbour.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.cpp b/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.cpp
index 50d0c4a..6bbf661 100755
--- a/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.cpp
+++ b/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_NearestNeighbour.cpp 2381 2015-01-30 16:37:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.h b/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.h
index a9fa16f..2d15452 100755
--- a/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.h
+++ b/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_NearestNeighbour.h 2381 2015-01-30 16:37:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_Shepard.cpp b/src/modules/grid/grid_gridding/Interpolation_Shepard.cpp
index e89c409..30a29b7 100755
--- a/src/modules/grid/grid_gridding/Interpolation_Shepard.cpp
+++ b/src/modules/grid/grid_gridding/Interpolation_Shepard.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_Shepard.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_Shepard.h b/src/modules/grid/grid_gridding/Interpolation_Shepard.h
index dc026cf..137ba43 100755
--- a/src/modules/grid/grid_gridding/Interpolation_Shepard.h
+++ b/src/modules/grid/grid_gridding/Interpolation_Shepard.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_Shepard.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_Triangulation.cpp b/src/modules/grid/grid_gridding/Interpolation_Triangulation.cpp
index fdc42eb..113bd1f 100755
--- a/src/modules/grid/grid_gridding/Interpolation_Triangulation.cpp
+++ b/src/modules/grid/grid_gridding/Interpolation_Triangulation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_Triangulation.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Interpolation_Triangulation.h b/src/modules/grid/grid_gridding/Interpolation_Triangulation.h
index d98f848..cfe9439 100755
--- a/src/modules/grid/grid_gridding/Interpolation_Triangulation.h
+++ b/src/modules/grid/grid_gridding/Interpolation_Triangulation.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation_Triangulation.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/MLB_Interface.cpp b/src/modules/grid/grid_gridding/MLB_Interface.cpp
index 6f15b05..a06571b 100755
--- a/src/modules/grid/grid_gridding/MLB_Interface.cpp
+++ b/src/modules/grid/grid_gridding/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/MLB_Interface.h b/src/modules/grid/grid_gridding/MLB_Interface.h
index 39a4f52..5093f9b 100755
--- a/src/modules/grid/grid_gridding/MLB_Interface.h
+++ b/src/modules/grid/grid_gridding/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Makefile.am b/src/modules/grid/grid_gridding/Makefile.am
index c085f81..4247448 100755
--- a/src/modules/grid/grid_gridding/Makefile.am
+++ b/src/modules/grid/grid_gridding/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/grid/grid_gridding/Makefile.in b/src/modules/grid/grid_gridding/Makefile.in
index 74c0119..e72a4ff 100644
--- a/src/modules/grid/grid_gridding/Makefile.in
+++ b/src/modules/grid/grid_gridding/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -83,10 +93,9 @@ host_triplet = @host@
 @TRIANGLE_TRUE at ./nn/triangle.h
 
 subdir = src/modules/grid/grid_gridding
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -96,6 +105,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -244,6 +254,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -277,6 +288,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -295,6 +313,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -384,6 +403,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -394,7 +414,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -437,7 +457,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/grid_gridding/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/grid_gridding/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -803,6 +822,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_gridding/Shapes2Grid.cpp b/src/modules/grid/grid_gridding/Shapes2Grid.cpp
index ae0c0ae..0b6fda2 100755
--- a/src/modules/grid/grid_gridding/Shapes2Grid.cpp
+++ b/src/modules/grid/grid_gridding/Shapes2Grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes2Grid.cpp 2871 2016-03-30 11:32:35Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Shapes2Grid.h b/src/modules/grid/grid_gridding/Shapes2Grid.h
index 2065119..e3a0ecc 100755
--- a/src/modules/grid/grid_gridding/Shapes2Grid.h
+++ b/src/modules/grid/grid_gridding/Shapes2Grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes2Grid.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Shepard.cpp b/src/modules/grid/grid_gridding/Shepard.cpp
index 0eba813..68182c4 100755
--- a/src/modules/grid/grid_gridding/Shepard.cpp
+++ b/src/modules/grid/grid_gridding/Shepard.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shepard.cpp 2807 2016-02-21 19:32:40Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/Shepard.h b/src/modules/grid/grid_gridding/Shepard.h
index 9bc7694..7815ce8 100755
--- a/src/modules/grid/grid_gridding/Shepard.h
+++ b/src/modules/grid/grid_gridding/Shepard.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shepard.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 //---------------------------------------------------------
 #ifndef HEADER_INCLUDED__Shepard_H
diff --git a/src/modules/grid/grid_gridding/kernel_density.cpp b/src/modules/grid/grid_gridding/kernel_density.cpp
index 501aa2b..d7a9b63 100755
--- a/src/modules/grid/grid_gridding/kernel_density.cpp
+++ b/src/modules/grid/grid_gridding/kernel_density.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: kernel_density.cpp 2871 2016-03-30 11:32:35Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_gridding/kernel_density.h b/src/modules/grid/grid_gridding/kernel_density.h
index 3392319..1999091 100755
--- a/src/modules/grid/grid_gridding/kernel_density.h
+++ b/src/modules/grid/grid_gridding/kernel_density.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: kernel_density.h 2212 2014-09-01 13:29:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_BA.cpp b/src/modules/grid/grid_spline/Gridding_Spline_BA.cpp
index 7210970..b4420ef 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_BA.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_BA.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_BA.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_BA.h b/src/modules/grid/grid_spline/Gridding_Spline_BA.h
index 5aef8cd..26baf41 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_BA.h
+++ b/src/modules/grid/grid_spline/Gridding_Spline_BA.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_BA.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_Base.cpp b/src/modules/grid/grid_spline/Gridding_Spline_Base.cpp
index 84aa620..5c0d066 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_Base.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_Base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_Base.cpp 2871 2016-03-30 11:32:35Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_Base.h b/src/modules/grid/grid_spline/Gridding_Spline_Base.h
index 9c9ceba..4fc6068 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_Base.h
+++ b/src/modules/grid/grid_spline/Gridding_Spline_Base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_Base.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp b/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp
index 5aef93f..05de64d 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_CSA.cpp 2376 2015-01-28 19:20:52Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_CSA.h b/src/modules/grid/grid_spline/Gridding_Spline_CSA.h
index ca453d2..731f813 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_CSA.h
+++ b/src/modules/grid/grid_spline/Gridding_Spline_CSA.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_CSA.h 2376 2015-01-28 19:20:52Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_MBA.cpp b/src/modules/grid/grid_spline/Gridding_Spline_MBA.cpp
index 939db16..896372a 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_MBA.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_MBA.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_MBA.cpp 2624 2015-09-30 15:33:53Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_MBA.h b/src/modules/grid/grid_spline/Gridding_Spline_MBA.h
index 098adbe..474cc98 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_MBA.h
+++ b/src/modules/grid/grid_spline/Gridding_Spline_MBA.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_MBA.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.cpp b/src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.cpp
index 35e824a..d6d0b3d 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_MBA_Grid.cpp 2221 2014-09-04 16:02:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.h b/src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.h
index edf5fa8..f779330 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.h
+++ b/src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_MBA_Grid.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.cpp b/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.cpp
index ee97874..9d9f6a8 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_TPS_Local.cpp 2388 2015-02-01 22:28:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.h b/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.h
index 976b593..c1cd5c5 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.h
+++ b/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_TPS_Local.h 2388 2015-02-01 22:28:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.cpp b/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.cpp
index 68ee808..e2ecbb1 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_TPS_TIN.cpp 2388 2015-02-01 22:28:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.h b/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.h
index ea1f528..b4ba3fa 100755
--- a/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.h
+++ b/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_TPS_TIN.h 2388 2015-02-01 22:28:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/MLB_Interface.cpp b/src/modules/grid/grid_spline/MLB_Interface.cpp
index 0d26c82..8333431 100755
--- a/src/modules/grid/grid_spline/MLB_Interface.cpp
+++ b/src/modules/grid/grid_spline/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2388 2015-02-01 22:28:39Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/MLB_Interface.h b/src/modules/grid/grid_spline/MLB_Interface.h
index 3e96656..ce7e88d 100755
--- a/src/modules/grid/grid_spline/MLB_Interface.h
+++ b/src/modules/grid/grid_spline/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_spline/Makefile.am b/src/modules/grid/grid_spline/Makefile.am
index 73a2a75..2aee52e 100755
--- a/src/modules/grid/grid_spline/Makefile.am
+++ b/src/modules/grid/grid_spline/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/grid/grid_spline/Makefile.in b/src/modules/grid/grid_spline/Makefile.in
index 1ffd003..006607c 100644
--- a/src/modules/grid/grid_spline/Makefile.in
+++ b/src/modules/grid/grid_spline/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_spline
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -215,6 +225,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -248,6 +259,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -266,6 +284,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -355,6 +374,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -365,7 +385,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -412,7 +432,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/grid_spline/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/grid_spline/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -747,6 +766,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_spline/csa.c b/src/modules/grid/grid_spline/csa.c
index 3c6e375..4cf1d08 100755
--- a/src/modules/grid/grid_spline/csa.c
+++ b/src/modules/grid/grid_spline/csa.c
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: csa.c 1082 2011-06-08 08:07:00Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /******************************************************************************
  *
diff --git a/src/modules/grid/grid_spline/csa.h b/src/modules/grid/grid_spline/csa.h
index 9310876..63985b5 100755
--- a/src/modules/grid/grid_spline/csa.h
+++ b/src/modules/grid/grid_spline/csa.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: csa.h 1082 2011-06-08 08:07:00Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /******************************************************************************
  *
diff --git a/src/modules/grid/grid_tools/CreateGridSystem.cpp b/src/modules/grid/grid_tools/CreateGridSystem.cpp
index 19fdc96..932657d 100755
--- a/src/modules/grid/grid_tools/CreateGridSystem.cpp
+++ b/src/modules/grid/grid_tools/CreateGridSystem.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreateGridSystem.cpp 2885 2016-04-08 15:19:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/CreateGridSystem.h b/src/modules/grid/grid_tools/CreateGridSystem.h
index 0eedb8f..aa270aa 100755
--- a/src/modules/grid/grid_tools/CreateGridSystem.h
+++ b/src/modules/grid/grid_tools/CreateGridSystem.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreateGridSystem.h 2885 2016-04-08 15:19:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Aggregate.cpp b/src/modules/grid/grid_tools/Grid_Aggregate.cpp
index 1179e51..c243584 100755
--- a/src/modules/grid/grid_tools/Grid_Aggregate.cpp
+++ b/src/modules/grid/grid_tools/Grid_Aggregate.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Aggregate.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 ///////////////////////////////////////////////////////////
 //                                                       //
diff --git a/src/modules/grid/grid_tools/Grid_Aggregate.h b/src/modules/grid/grid_tools/Grid_Aggregate.h
index bdc6237..ae24ef9 100755
--- a/src/modules/grid/grid_tools/Grid_Aggregate.h
+++ b/src/modules/grid/grid_tools/Grid_Aggregate.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Aggregate.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Buffer.cpp b/src/modules/grid/grid_tools/Grid_Buffer.cpp
index b74337c..b772296 100755
--- a/src/modules/grid/grid_tools/Grid_Buffer.cpp
+++ b/src/modules/grid/grid_tools/Grid_Buffer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Buffer.cpp 2321 2014-11-03 21:10:22Z johanvdw $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_Buffer.cpp
@@ -20,107 +20,146 @@
     Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/
 
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #include "Grid_Buffer.h"
 
-#ifndef max
-#define max(a,b)            (((a) > (b)) ? (a) : (b))
-#endif
+//---------------------------------------------------------
+enum
+{
+	EMPTY	= 0,
+	BUFFER	= 1,
+	FEATURE	= 2
+};
 
-#ifndef min
-#define min(a,b)            (((a) < (b)) ? (a) : (b))
-#endif
 
-int BUFFER = 1;
-int FEATURE = 2;
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
 
-CGrid_Buffer::CGrid_Buffer(void){
+//---------------------------------------------------------
+CGrid_Buffer::CGrid_Buffer(void)
+{
+	CSG_Parameter	*pNode;
 
-	Set_Name(_TL("Grid Buffer"));
-	Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya"));
-	Set_Description	(_TW(
-		"The module allows one to buffer features. The features must be encoded by values greater zero. "
-		"With the buffer distance method 'cell value', the buffer distance must be encoded in the "
-		"features grid. The output buffer grid is encoded as follows: one inside the buffer, two "
-		"at feature locations.\n\n"));
-
-	Parameters.Add_Grid(NULL,
-						"FEATURES",
-						_TL("Features Grid"),
-						_TL("Grid with features to be buffered."),
-						PARAMETER_INPUT);
-
-	Parameters.Add_Grid(NULL,
-						"BUFFER",
-						_TL("Buffer Grid"),
-						_TL(""),
-						PARAMETER_OUTPUT,
-						true,
-						SG_DATATYPE_Byte);
-
-	Parameters.Add_Value(NULL,
-						"DIST",
-						_TL("Distance"),
-						_TL("Buffer distance [map units]."),
-						PARAMETER_TYPE_Double,
-						1000);
-
-	Parameters.Add_Choice(NULL,
-						"BUFFERTYPE",
-						_TL("Buffer Distance"),
-						_TL(""),
-						_TL("Fixed|Cell value|"),
-						0);
-}//constructor
-
-
-CGrid_Buffer::~CGrid_Buffer(void)
-{}
-
-bool CGrid_Buffer::On_Execute(void){
-
-	CSG_Grid* pFeatures = Parameters("FEATURES")->asGrid();
-	CSG_Grid* pGrid_Buffer = Parameters("BUFFER")->asGrid();
-	int iBufferType = Parameters("BUFFERTYPE")->asInt();
-	double dBufDist = Parameters("DIST")->asDouble() / pFeatures->Get_Cellsize();
-	int iBufFixedDist = (int) (dBufDist + 2.0);
-	double dDist = 0;
-	int iBufDist;
-	double dValue = 0;
-	int x2=0, y2=0;
-
-	pGrid_Buffer->Assign(0.0);
-
-    for(int y=0; y<Get_NY() && Set_Progress(y); y++){
-		for(int x=0; x<Get_NX(); x++){
-            dValue = pFeatures->asDouble(x,y);
-			if (dValue != 0 && !pFeatures->is_NoData(x,y)){
-				if (iBufferType==1){
-					dBufDist = dValue / pFeatures->Get_Cellsize();
-					iBufDist = (int) (dBufDist + 2.0);
-				}//if
-				else{
-					iBufDist = iBufFixedDist;
-				}//else
-				for	(int i=-iBufDist ; i<iBufDist ; i++){
-					for (int j=-iBufDist ; j<iBufDist ; j++){
-						x2 = max(min(Get_NX()-1,x+i),0);
-						y2 = max(min(Get_NY()-1,y+j),0);
-						dDist= M_GET_LENGTH(x-x2, y-y2);
-						if (dDist<=dBufDist){
-							dValue = pFeatures->asDouble(x2,y2);
-							if (dValue != 0 && dValue!= pFeatures->Get_NoData_Value()){
-								pGrid_Buffer->Set_Value(x2,y2,FEATURE);
-							}//if
-							else{
-								pGrid_Buffer->Set_Value(x2,y2,BUFFER);
-							}//else
-						}//if
-					}//for
-				}//for
-			}//if
-		}//for
-	}//for
+	Set_Name		(_TL("Grid Buffer"));
+
+	Set_Author		("Victor Olaya (c) 2004");
 
+	Set_Description	(_TW(
+		"This tool creates buffers around features in a grid. Features are defined by any value greater than zero. "
+		"With the buffer distance method 'cell's value', the feature grid's cell values are used as buffer distance. "
+		"In any case the buffer distance has to be specified using map units. "
+		"The output buffer grid cell values refer to 1 := inside the buffer, 2 := feature location. "
+	));
+
+	Parameters.Add_Grid(
+		NULL	, "FEATURES"	, _TL("Features"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "BUFFER"		, _TL("Buffer"),
+		_TL(""),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Byte
+	);
+
+	pNode	= Parameters.Add_Choice(
+		NULL	, "TYPE"		, _TL("Type"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("fixed"),
+			_TL("cell's value")
+		), 0
+	);
+
+	Parameters.Add_Double(
+		pNode	, "DISTANCE"	, _TL("Distance"),
+		_TL("Fixed buffer distance given in map units."),
+		1000.0, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGrid_Buffer::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "TYPE") )
+	{
+		pParameters->Set_Enabled("DISTANCE", pParameter->asInt() == 0);
+	}
+
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_Buffer::On_Execute(void)
+{
+	CSG_Grid	*pFeatures	= Parameters("FEATURES")->asGrid();
+	CSG_Grid	*pBuffer	= Parameters("BUFFER"  )->asGrid();
+
+	pBuffer->Set_NoData_Value(EMPTY);
+	pBuffer->Assign_NoData();
+	pBuffer->Set_Name(CSG_String::Format("%s [%s]", pFeatures->Get_Name(), _TL("Buffer")));
+
+	bool	bFixed	= Parameters("TYPE")->asInt() == 0;
+
+	int	Distance	= (int)(0.5 + Parameters("DISTANCE")->asDouble() / Get_Cellsize());
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !pFeatures->is_NoData(x, y) && pFeatures->asDouble(x, y) > 0.0 )
+			{
+				if( !bFixed )
+				{
+					Distance	= (int)(0.5 + pFeatures->asDouble(x, y) / Get_Cellsize());
+				}
+
+				for(int iy=y-Distance; iy<=y+Distance; iy++)
+				{
+					for(int ix=x-Distance; ix<=x+Distance; ix++)
+					{
+						if( is_InGrid(ix, iy) && pBuffer->is_NoData(ix, iy) && SG_Get_Distance(x, y, ix, iy) <= Distance )
+						{
+							pBuffer->Set_Value(ix, iy, pFeatures->is_NoData(ix, iy) || pFeatures->asDouble(ix, iy) <= 0.0
+								? BUFFER : FEATURE
+							);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
 	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
 
-}//method
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_tools/Grid_Buffer.h b/src/modules/grid/grid_tools/Grid_Buffer.h
index 0246d8f..b2ca7bb 100755
--- a/src/modules/grid/grid_tools/Grid_Buffer.h
+++ b/src/modules/grid/grid_tools/Grid_Buffer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Buffer.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_Buffer.h
@@ -19,27 +19,58 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #ifndef HEADER_INCLUDED__Grid_Buffer_H
 #define HEADER_INCLUDED__Grid_Buffer_H
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #include "MLB_Interface.h"
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 class CGrid_Buffer : public CSG_Module_Grid
 {
 public:
 	CGrid_Buffer(void);
-	virtual ~CGrid_Buffer(void);
 
 	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Grid|Distances") );	}
 
 
 protected:
 
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
 	virtual bool				On_Execute				(void);
 
 };
 
 #endif // #ifndef HEADER_INCLUDED__Grid_Buffer_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_tools/Grid_Buffer_Proximity.cpp b/src/modules/grid/grid_tools/Grid_Buffer_Proximity.cpp
index cf35ef2..864dffd 100755
--- a/src/modules/grid/grid_tools/Grid_Buffer_Proximity.cpp
+++ b/src/modules/grid/grid_tools/Grid_Buffer_Proximity.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Buffer_Proximity.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 ///////////////////////////////////////////////////////////
 //                                                       //
diff --git a/src/modules/grid/grid_tools/Grid_Buffer_Proximity.h b/src/modules/grid/grid_tools/Grid_Buffer_Proximity.h
index 0e5804c..25abbe6 100755
--- a/src/modules/grid/grid_tools/Grid_Buffer_Proximity.h
+++ b/src/modules/grid/grid_tools/Grid_Buffer_Proximity.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Buffer_Proximity.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 ///////////////////////////////////////////////////////////
 //                                                       //
diff --git a/src/modules/grid/grid_tools/Grid_CombineGrids.cpp b/src/modules/grid/grid_tools/Grid_CombineGrids.cpp
index c6f8b9d..3e1a434 100755
--- a/src/modules/grid/grid_tools/Grid_CombineGrids.cpp
+++ b/src/modules/grid/grid_tools/Grid_CombineGrids.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CombineGrids.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CombineGrids.cpp
diff --git a/src/modules/grid/grid_tools/Grid_CombineGrids.h b/src/modules/grid/grid_tools/Grid_CombineGrids.h
index 24c5c01..54bddc0 100755
--- a/src/modules/grid/grid_tools/Grid_CombineGrids.h
+++ b/src/modules/grid/grid_tools/Grid_CombineGrids.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CombineGrids.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CombineGrids.h
diff --git a/src/modules/grid/grid_tools/Grid_Completion.cpp b/src/modules/grid/grid_tools/Grid_Completion.cpp
index 438c115..6fe8ce4 100755
--- a/src/modules/grid/grid_tools/Grid_Completion.cpp
+++ b/src/modules/grid/grid_tools/Grid_Completion.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Completion.cpp 2881 2016-04-01 20:24:07Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Completion.h b/src/modules/grid/grid_tools/Grid_Completion.h
index 7c59934..3d462a2 100755
--- a/src/modules/grid/grid_tools/Grid_Completion.h
+++ b/src/modules/grid/grid_tools/Grid_Completion.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Completion.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp b/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp
index 5c6df94..9c734e4 100755
--- a/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp
+++ b/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_ConstantGrid.cpp 2212 2014-09-01 13:29:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     ConstantGrid.cpp
diff --git a/src/modules/grid/grid_tools/Grid_ConstantGrid.h b/src/modules/grid/grid_tools/Grid_ConstantGrid.h
index fa5d701..b7c8c61 100755
--- a/src/modules/grid/grid_tools/Grid_ConstantGrid.h
+++ b/src/modules/grid/grid_tools/Grid_ConstantGrid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_ConstantGrid.h 2212 2014-09-01 13:29:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_ConstantGrid.h
diff --git a/src/modules/grid/grid_tools/Grid_CropToData.cpp b/src/modules/grid/grid_tools/Grid_CropToData.cpp
index 8c4504b..8ed3175 100755
--- a/src/modules/grid/grid_tools/Grid_CropToData.cpp
+++ b/src/modules/grid/grid_tools/Grid_CropToData.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CropToData.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CropToData.cpp
diff --git a/src/modules/grid/grid_tools/Grid_CropToData.h b/src/modules/grid/grid_tools/Grid_CropToData.h
index b2d2a9c..bc19c6d 100755
--- a/src/modules/grid/grid_tools/Grid_CropToData.h
+++ b/src/modules/grid/grid_tools/Grid_CropToData.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_CropToData.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CropToData.h
diff --git a/src/modules/grid/grid_tools/Grid_Cut.cpp b/src/modules/grid/grid_tools/Grid_Cut.cpp
index 0f2df4e..699bab6 100755
--- a/src/modules/grid/grid_tools/Grid_Cut.cpp
+++ b/src/modules/grid/grid_tools/Grid_Cut.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Cut.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Cut.h b/src/modules/grid/grid_tools/Grid_Cut.h
index 994ba84..645593a 100755
--- a/src/modules/grid/grid_tools/Grid_Cut.h
+++ b/src/modules/grid/grid_tools/Grid_Cut.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Cut.h 2672 2015-11-02 15:39:37Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Fill.cpp b/src/modules/grid/grid_tools/Grid_Fill.cpp
index b87a5ba..8bf10e7 100755
--- a/src/modules/grid/grid_tools/Grid_Fill.cpp
+++ b/src/modules/grid/grid_tools/Grid_Fill.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Fill.cpp 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Fill.h b/src/modules/grid/grid_tools/Grid_Fill.h
index b5296c0..9c77d45 100755
--- a/src/modules/grid/grid_tools/Grid_Fill.h
+++ b/src/modules/grid/grid_tools/Grid_Fill.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Fill.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Gaps.cpp b/src/modules/grid/grid_tools/Grid_Gaps.cpp
index 8219cb7..682cb31 100755
--- a/src/modules/grid/grid_tools/Grid_Gaps.cpp
+++ b/src/modules/grid/grid_tools/Grid_Gaps.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Gaps.cpp 2623 2015-09-30 13:32:06Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Gaps.h b/src/modules/grid/grid_tools/Grid_Gaps.h
index 7b05bff..7580f37 100755
--- a/src/modules/grid/grid_tools/Grid_Gaps.h
+++ b/src/modules/grid/grid_tools/Grid_Gaps.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Gaps.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Gaps_OneCell.cpp b/src/modules/grid/grid_tools/Grid_Gaps_OneCell.cpp
index d134344..feaa49b 100755
--- a/src/modules/grid/grid_tools/Grid_Gaps_OneCell.cpp
+++ b/src/modules/grid/grid_tools/Grid_Gaps_OneCell.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Gaps_OneCell.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Gaps_OneCell.h b/src/modules/grid/grid_tools/Grid_Gaps_OneCell.h
index 2dd9c0f..a3c50cb 100755
--- a/src/modules/grid/grid_tools/Grid_Gaps_OneCell.h
+++ b/src/modules/grid/grid_tools/Grid_Gaps_OneCell.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Gaps_OneCell.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.cpp b/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.cpp
index 7b6ca92..39a8714 100755
--- a/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.cpp
+++ b/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Gaps_Spline_Fill.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.h b/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.h
index 08dae99..e5965ab 100755
--- a/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.h
+++ b/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Gaps_Spline_Fill.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_InvertNoData.cpp b/src/modules/grid/grid_tools/Grid_InvertNoData.cpp
index 1c3554f..c89f2ce 100755
--- a/src/modules/grid/grid_tools/Grid_InvertNoData.cpp
+++ b/src/modules/grid/grid_tools/Grid_InvertNoData.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_InvertNoData.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     InvertNoData.cpp
diff --git a/src/modules/grid/grid_tools/Grid_InvertNoData.h b/src/modules/grid/grid_tools/Grid_InvertNoData.h
index 3ecde70..7699083 100755
--- a/src/modules/grid/grid_tools/Grid_InvertNoData.h
+++ b/src/modules/grid/grid_tools/Grid_InvertNoData.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_InvertNoData.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     InvertNoData.h
diff --git a/src/modules/grid/grid_tools/Grid_Mask.cpp b/src/modules/grid/grid_tools/Grid_Mask.cpp
index 57adbca..e44a22a 100755
--- a/src/modules/grid/grid_tools/Grid_Mask.cpp
+++ b/src/modules/grid/grid_tools/Grid_Mask.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Mask.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Mask.h b/src/modules/grid/grid_tools/Grid_Mask.h
index 39f3cc7..a869292 100755
--- a/src/modules/grid/grid_tools/Grid_Mask.h
+++ b/src/modules/grid/grid_tools/Grid_Mask.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Mask.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Merge.cpp b/src/modules/grid/grid_tools/Grid_Merge.cpp
index da73a41..8444cde 100755
--- a/src/modules/grid/grid_tools/Grid_Merge.cpp
+++ b/src/modules/grid/grid_tools/Grid_Merge.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Merge.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Merge.h b/src/modules/grid/grid_tools/Grid_Merge.h
index f2d9560..ce57996 100755
--- a/src/modules/grid/grid_tools/Grid_Merge.h
+++ b/src/modules/grid/grid_tools/Grid_Merge.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Merge.h 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Orientation.cpp b/src/modules/grid/grid_tools/Grid_Orientation.cpp
index b1b8a59..a61b3d5 100755
--- a/src/modules/grid/grid_tools/Grid_Orientation.cpp
+++ b/src/modules/grid/grid_tools/Grid_Orientation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Orientation.cpp 2884 2016-04-08 15:18:50Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Orientation.h b/src/modules/grid/grid_tools/Grid_Orientation.h
index 7d5a0f0..8cf4125 100755
--- a/src/modules/grid/grid_tools/Grid_Orientation.h
+++ b/src/modules/grid/grid_tools/Grid_Orientation.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Orientation.h 2817 2016-02-23 15:16:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Proximity.cpp b/src/modules/grid/grid_tools/Grid_Proximity.cpp
index 164cf57..05cc784 100755
--- a/src/modules/grid/grid_tools/Grid_Proximity.cpp
+++ b/src/modules/grid/grid_tools/Grid_Proximity.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Proximity.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Proximity.h b/src/modules/grid/grid_tools/Grid_Proximity.h
index f48130b..945d408 100755
--- a/src/modules/grid/grid_tools/Grid_Proximity.h
+++ b/src/modules/grid/grid_tools/Grid_Proximity.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Proximity.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Resample.cpp b/src/modules/grid/grid_tools/Grid_Resample.cpp
index 97af94c..7d0f3cd 100755
--- a/src/modules/grid/grid_tools/Grid_Resample.cpp
+++ b/src/modules/grid/grid_tools/Grid_Resample.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Resample.cpp 2871 2016-03-30 11:32:35Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Resample.h b/src/modules/grid/grid_tools/Grid_Resample.h
index 17a0154..f54924f 100755
--- a/src/modules/grid/grid_tools/Grid_Resample.h
+++ b/src/modules/grid/grid_tools/Grid_Resample.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Resample.h 2212 2014-09-01 13:29:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp b/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp
index 7a75136..84ea145 100755
--- a/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp
+++ b/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Shrink_Expand.cpp 2881 2016-04-01 20:24:07Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Shrink_Expand.h b/src/modules/grid/grid_tools/Grid_Shrink_Expand.h
index 25c147c..59274af 100755
--- a/src/modules/grid/grid_tools/Grid_Shrink_Expand.h
+++ b/src/modules/grid/grid_tools/Grid_Shrink_Expand.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Shrink_Expand.h 1992 2014-02-13 12:30:26Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_SortRaster.cpp b/src/modules/grid/grid_tools/Grid_SortRaster.cpp
index b5072ab..8a99fcb 100755
--- a/src/modules/grid/grid_tools/Grid_SortRaster.cpp
+++ b/src/modules/grid/grid_tools/Grid_SortRaster.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_SortRaster.cpp 2596 2015-09-23 12:33:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     SortRaster.cpp
diff --git a/src/modules/grid/grid_tools/Grid_SortRaster.h b/src/modules/grid/grid_tools/Grid_SortRaster.h
index 921fd69..86ee29c 100755
--- a/src/modules/grid/grid_tools/Grid_SortRaster.h
+++ b/src/modules/grid/grid_tools/Grid_SortRaster.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_SortRaster.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     SortRaster.h
diff --git a/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp b/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp
index cd0c33a..baccf62 100755
--- a/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp
+++ b/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_ThresholdBuffer.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     ThresholdBuffer.cpp
diff --git a/src/modules/grid/grid_tools/Grid_ThresholdBuffer.h b/src/modules/grid/grid_tools/Grid_ThresholdBuffer.h
index 951ade0..87d5d5e 100755
--- a/src/modules/grid/grid_tools/Grid_ThresholdBuffer.h
+++ b/src/modules/grid/grid_tools/Grid_ThresholdBuffer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_ThresholdBuffer.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     ThresholdBuffer.h
diff --git a/src/modules/grid/grid_tools/Grid_Tiling.cpp b/src/modules/grid/grid_tools/Grid_Tiling.cpp
index db44482..aa0c028 100755
--- a/src/modules/grid/grid_tools/Grid_Tiling.cpp
+++ b/src/modules/grid/grid_tools/Grid_Tiling.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Tiling.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Tiling.h b/src/modules/grid/grid_tools/Grid_Tiling.h
index 95afb2d..84ceb75 100755
--- a/src/modules/grid/grid_tools/Grid_Tiling.h
+++ b/src/modules/grid/grid_tools/Grid_Tiling.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Tiling.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_filter/Filter_Majority.cpp b/src/modules/grid/grid_tools/Grid_Value_NoData.cpp
similarity index 62%
copy from src/modules/grid/grid_filter/Filter_Majority.cpp
copy to src/modules/grid/grid_tools/Grid_Value_NoData.cpp
index f52a77f..b74d94b 100755
--- a/src/modules/grid/grid_filter/Filter_Majority.cpp
+++ b/src/modules/grid/grid_tools/Grid_Value_NoData.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Majority.cpp 2476 2015-04-22 18:41:38Z oconrad $
+ * Version $Id: Grid_Value_NoData.cpp 2871 2016-03-30 11:32:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,13 +9,13 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                      Grid_Filter                      //
+//                      Grid_Tools                       //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                  Filter_Majority.cpp                  //
+//                  Grid_Value_NoData.cpp                //
 //                                                       //
-//                 Copyright (C) 2010 by                 //
+//                 Copyright (C) 2016 by                 //
 //                      Olaf Conrad                      //
 //                                                       //
 //-------------------------------------------------------//
@@ -59,7 +59,7 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include "Filter_Majority.h"
+#include "Grid_Value_NoData.h"
 
 
 ///////////////////////////////////////////////////////////
@@ -69,147 +69,125 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CFilter_Majority::CFilter_Majority(void)
+CGrid_Value_NoData::CGrid_Value_NoData(void)
 {
 	//-----------------------------------------------------
-	// 1. Info...
+	Set_Name		(_TL("Change a Grid's No-Data Value"));
 
-	Set_Name		(_TL("Majority Filter"));
-
-	Set_Author		("O.Conrad (c) 2010");
+	Set_Author		("O.Conrad (c) 2016");
 
 	Set_Description	(_TW(
-		"Majority filter for grids."
+		"This tool allows to change a grid's no-data value or value range "
+		"definition. It does not change the cell values of the grid. "
+		"Its main purpose is to support this type of operation for tool "
+		"chains and scripting environments."
 	));
 
-
 	//-----------------------------------------------------
-	// 2. Parameters...
-
 	Parameters.Add_Grid(
-		NULL, "INPUT"		, _TL("Grid"),
+		NULL	, "GRID"	, _TL("Grid"),
 		_TL(""),
 		PARAMETER_INPUT
 	);
 
-	Parameters.Add_Grid(
-		NULL, "RESULT"		, _TL("Filtered Grid"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
-	);
-
 	Parameters.Add_Choice(
-		NULL, "MODE"		, _TL("Search Mode"),
+		NULL	, "TYPE"	, _TL("Type"),
 		_TL(""),
 		CSG_String::Format("%s|%s|",
-			_TL("Square"),
-			_TL("Circle")
-		), 1
+			_TL("single value"),
+			_TL("value range")
+		), 0
 	);
 
-	Parameters.Add_Value(
-		NULL, "RADIUS"		, _TL("Radius"),
+	Parameters.Add_Double(
+		NULL	, "VALUE"	, _TL("No-Data Value"),
 		_TL(""),
-		PARAMETER_TYPE_Int, 1, 1, true
+		-99999.
 	);
 
-	Parameters.Add_Value(
-		NULL, "THRESHOLD"	, _TL("Threshold [Percent]"),
+	Parameters.Add_Range(
+		NULL	, "RANGE"	, _TL("No-Data Value Range"),
 		_TL(""),
-		PARAMETER_TYPE_Double, 0.0, 0.0, true, 100.0, true
+		-99999., -99999.
 	);
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CFilter_Majority::On_Execute(void)
+int CGrid_Value_NoData::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
 {
-	//-----------------------------------------------------
-	m_Kernel.Set_Radius(Parameters("RADIUS")->asInt(), Parameters("MODE")->asInt() == 0);
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "GRID") && pParameter->asGrid() )
+	{
+		CSG_Grid	*pGrid	= pParameter->asGrid();
 
-	m_Threshold	= 1 + (int)((1 + m_Kernel.Get_Count()) * Parameters("THRESHOLD")->asDouble() / 100.0);
+		pParameters->Set_Parameter("VALUE",
+			pGrid->Get_NoData_Value()
+		);
 
-	//-----------------------------------------------------
-	m_pInput	= Parameters("INPUT")->asGrid();
+		pParameters->Get_Parameter("RANGE")->asRange()->Set_Range(
+			pGrid->Get_NoData_Value(), pGrid->Get_NoData_hiValue()
+		);
 
-	CSG_Grid	Input, *pResult	= Parameters("RESULT")->asGrid();
+		pParameters->Set_Parameter("TYPE",
+			pGrid->Get_NoData_Value() < pGrid->Get_NoData_hiValue() ? 1 : 0
+		);
 
-	if( !pResult || pResult == m_pInput )
-	{
-		Input.Create(*m_pInput); pResult = m_pInput; m_pInput = &Input;
+		On_Parameters_Enable(pParameters, pParameters->Get_Parameter("TYPE"));
 	}
-	else
-	{
-		pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Majority Filter")));
 
-		pResult->Set_NoData_Value(m_pInput->Get_NoData_Value());
-	}
-
-	//-----------------------------------------------------
-	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			if( m_pInput->is_InGrid(x, y) )
-			{
-				pResult->Set_Value(x, y, Get_Majority(x, y));
-			}
-			else
-			{
-				pResult->Set_NoData(x, y);
-			}
-		}
-	}
+	return( CSG_Module_Grid::On_Parameter_Changed(pParameters, pParameter) );
+}
 
-	//-----------------------------------------------------
-	if( m_pInput == &Input )
+//---------------------------------------------------------
+int CGrid_Value_NoData::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "TYPE") )
 	{
-		DataObject_Update(pResult);
+		pParameters->Set_Enabled("VALUE", pParameter->asInt() == 0);
+		pParameters->Set_Enabled("RANGE", pParameter->asInt() == 1);
 	}
 
-	m_Kernel.Destroy();
-
-	return( true );
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-double CFilter_Majority::Get_Majority(int x, int y)
+bool CGrid_Value_NoData::On_Execute(void)
 {
-	CSG_Class_Statistics	Majority;
+	//-----------------------------------------------------
+	bool	bUpdate;
 
-	Majority.Add_Value(m_pInput->asDouble(x, y));
+	CSG_Grid	*pGrid	= Parameters("GRID")->asGrid();
 
-	for(int i=0; i<m_Kernel.Get_Count(); i++)
+	if( Parameters("TYPE")->asInt() == 0 )
 	{
-		int	ix	= m_Kernel.Get_X(i, x);
-		int	iy	= m_Kernel.Get_Y(i, y);
-
-		if( m_pInput->is_InGrid(ix, iy) )
-		{
-			Majority.Add_Value(m_pInput->asDouble(ix, iy));
-		}
+		bUpdate	= pGrid->Set_NoData_Value(
+			Parameters("VALUE")->asDouble()
+		);
+	}
+	else
+	{
+		bUpdate	= pGrid->Set_NoData_Value_Range(
+			Parameters("RANGE")->asRange()->Get_LoVal(),
+			Parameters("RANGE")->asRange()->Get_HiVal()
+		);
 	}
 
-	int		Count;
-	double	Value;
-
-	Majority.Get_Majority(Value, Count);
+	if( bUpdate )
+	{
+		DataObject_Update(pGrid);
+	}
 
-	return( Count > m_Threshold ? Value : m_pInput->asDouble(x, y) );
+	//-------------------------------------------------
+	return( true );
 }
 
 
diff --git a/src/modules/grid/grid_tools/Grid_Resample.h b/src/modules/grid/grid_tools/Grid_Value_NoData.h
similarity index 86%
copy from src/modules/grid/grid_tools/Grid_Resample.h
copy to src/modules/grid/grid_tools/Grid_Value_NoData.h
index 17a0154..462987e 100755
--- a/src/modules/grid/grid_tools/Grid_Resample.h
+++ b/src/modules/grid/grid_tools/Grid_Value_NoData.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Resample.h 2212 2014-09-01 13:29:48Z oconrad $
+ * Version $Id: Grid_Value_NoData.h 2212 2014-09-01 13:29:48Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -13,9 +13,9 @@
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                    Grid_Resample.h                    //
+//                   Grid_Value_NoData.h                 //
 //                                                       //
-//                 Copyright (C) 2003 by                 //
+//                 Copyright (C) 2014 by                 //
 //                      Olaf Conrad                      //
 //                                                       //
 //-------------------------------------------------------//
@@ -44,9 +44,7 @@
 //                                                       //
 //    contact:    Olaf Conrad                            //
 //                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
+//                University of Hamburg                  //
 //                Germany                                //
 //                                                       //
 ///////////////////////////////////////////////////////////
@@ -61,8 +59,8 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Grid_Resample_H
-#define HEADER_INCLUDED__Grid_Resample_H
+#ifndef HEADER_INCLUDED__Grid_Value_NoData_H
+#define HEADER_INCLUDED__Grid_Value_NoData_H
 
 
 ///////////////////////////////////////////////////////////
@@ -82,12 +80,12 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CGrid_Resample : public CSG_Module_Grid  
+class CGrid_Value_NoData : public CSG_Module_Grid  
 {
 public:
-	CGrid_Resample(void);
+	CGrid_Value_NoData(void);
 
-	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Grid|Grid System") );	}
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Grid|Values") );	}
 
 
 protected:
@@ -97,11 +95,6 @@ protected:
 
 	virtual bool				On_Execute				(void);
 
-
-private:
-
-	CSG_Parameters_Grid_Target	m_Grid_Target;
-
 };
 
 
@@ -112,4 +105,4 @@ private:
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Grid_Resample_H
+#endif // #ifndef HEADER_INCLUDED__Grid_Value_NoData_H
diff --git a/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp b/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp
index ea921ff..3f9d782 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp
+++ b/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Reclassify.cpp 2321 2014-11-03 21:10:22Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Value_Reclassify.h b/src/modules/grid/grid_tools/Grid_Value_Reclassify.h
index b1ddd2f..04030b6 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Reclassify.h
+++ b/src/modules/grid/grid_tools/Grid_Value_Reclassify.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Reclassify.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Value_Replace.cpp b/src/modules/grid/grid_tools/Grid_Value_Replace.cpp
index 48df2c2..1d9edf6 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Replace.cpp
+++ b/src/modules/grid/grid_tools/Grid_Value_Replace.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Replace.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Value_Replace.h b/src/modules/grid/grid_tools/Grid_Value_Replace.h
index 9cd59f5..7111c6b 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Replace.h
+++ b/src/modules/grid/grid_tools/Grid_Value_Replace.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Replace.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp b/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp
index 356254e..9d2dfdd 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp
+++ b/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Replace_Interactive.cpp 2841 2016-03-05 11:25:04Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_Value_Replace_Interactive.cpp
@@ -150,9 +150,14 @@ bool CGrid_Value_Replace_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG
 					Set_Value(m_Kernel.Get_X(i, Point.x), m_Kernel.Get_Y(i, Point.y));
 				}
 			}
+		}
+		return( true );
 
+	case MODULE_INTERACTIVE_LUP:
+		{
 			DataObject_Update(m_pGrid, SG_UI_DATAOBJECT_UPDATE_ONLY);
 		}
+		return( true );
 
 	//-----------------------------------------------------
 	default:
diff --git a/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h b/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h
index 03eed64..e76f609 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h
+++ b/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Replace_Interactive.h 2574 2015-09-04 12:30:31Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Grid_Value_Replace_Interactive.h
diff --git a/src/modules/grid/grid_tools/Grid_Value_Request.cpp b/src/modules/grid/grid_tools/Grid_Value_Request.cpp
index 44b2fef..743eb1f 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Request.cpp
+++ b/src/modules/grid/grid_tools/Grid_Value_Request.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Request.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Value_Request.h b/src/modules/grid/grid_tools/Grid_Value_Request.h
index 1059843..e2a9d00 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Request.h
+++ b/src/modules/grid/grid_tools/Grid_Value_Request.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Request.h 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Value_Type.cpp b/src/modules/grid/grid_tools/Grid_Value_Type.cpp
index 09b92cc..8f0e6bd 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Type.cpp
+++ b/src/modules/grid/grid_tools/Grid_Value_Type.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Type.cpp 2241 2014-09-22 11:04:27Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Grid_Value_Type.h b/src/modules/grid/grid_tools/Grid_Value_Type.h
index 43944c9..bf6a50c 100755
--- a/src/modules/grid/grid_tools/Grid_Value_Type.h
+++ b/src/modules/grid/grid_tools/Grid_Value_Type.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Type.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp b/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp
index 3319049..2812718 100755
--- a/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp
+++ b/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: GridsFromTableAndGrid.cpp 2241 2014-09-22 11:04:27Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     GridsFromTableAndGrid.cpp
diff --git a/src/modules/grid/grid_tools/GridsFromTableAndGrid.h b/src/modules/grid/grid_tools/GridsFromTableAndGrid.h
index bdfbcd1..ee8512d 100755
--- a/src/modules/grid/grid_tools/GridsFromTableAndGrid.h
+++ b/src/modules/grid/grid_tools/GridsFromTableAndGrid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: GridsFromTableAndGrid.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     GridsFromTableAndGrid.cpp
diff --git a/src/modules/grid/grid_tools/MLB_Interface.cpp b/src/modules/grid/grid_tools/MLB_Interface.cpp
index f013761..8793fd9 100755
--- a/src/modules/grid/grid_tools/MLB_Interface.cpp
+++ b/src/modules/grid/grid_tools/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2817 2016-02-23 15:16:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -114,6 +114,7 @@ CSG_String Get_Info(int i)
 #include "Grid_InvertNoData.h"
 #include "GridsFromTableAndGrid.h"
 
+#include "Grid_Value_NoData.h"
 #include "Grid_Value_Type.h"
 #include "Grid_Value_Replace.h"
 #include "Grid_Value_Replace_Interactive.h"
@@ -166,11 +167,13 @@ CSG_Module *		Create_Module(int i)
 	case  9: 	return( new CThresholdBuffer );
 	case 10:	return( new CGrid_Proximity_Buffer );
 
+	case 36:	return( new CGrid_Value_NoData );
 	case 11:	return( new CGrid_Value_Type );
 	case 12:	return( new CGrid_Value_Replace );
 	case 13:	return( new CGrid_Value_Replace_Interactive );
 	case 14:	return( new CGrid_Value_Request );
 	case 15:	return( new CGrid_Value_Reclassify );
+
 	case 16:	return( new CGrid_Fill );
 
 	case 17: 	return( new CCropToData );
diff --git a/src/modules/grid/grid_tools/MLB_Interface.h b/src/modules/grid/grid_tools/MLB_Interface.h
index 3506ab8..446763a 100755
--- a/src/modules/grid/grid_tools/MLB_Interface.h
+++ b/src/modules/grid/grid_tools/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_tools/Makefile.am b/src/modules/grid/grid_tools/Makefile.am
index 2c79645..e3095bb 100755
--- a/src/modules/grid/grid_tools/Makefile.am
+++ b/src/modules/grid/grid_tools/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
@@ -37,6 +37,7 @@ Grid_Support_Tool_Chains.cpp\
 Grid_ThresholdBuffer.cpp\
 Grid_Tiling.cpp\
 Grid_Transpose.cpp\
+Grid_Value_NoData.cpp\
 Grid_Value_Reclassify.cpp\
 Grid_Value_Replace.cpp\
 Grid_Value_Replace_Interactive.cpp\
@@ -70,6 +71,7 @@ Grid_Support_Tool_Chains.h\
 Grid_ThresholdBuffer.h\
 Grid_Tiling.h\
 Grid_Transpose.h\
+Grid_Value_NoData.h\
 Grid_Value_Reclassify.h\
 Grid_Value_Replace.h\
 Grid_Value_Replace_Interactive.h\
diff --git a/src/modules/grid/grid_tools/Makefile.in b/src/modules/grid/grid_tools/Makefile.in
index 92a7a6e..596c22e 100644
--- a/src/modules/grid/grid_tools/Makefile.in
+++ b/src/modules/grid/grid_tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_tools
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -136,10 +146,10 @@ am_libgrid_tools_la_OBJECTS = CreateGridSystem.lo Grid_Aggregate.lo \
 	Grid_Orientation.lo Grid_Proximity.lo Grid_Resample.lo \
 	Grid_Shrink_Expand.lo Grid_SortRaster.lo \
 	Grid_Support_Tool_Chains.lo Grid_ThresholdBuffer.lo \
-	Grid_Tiling.lo Grid_Transpose.lo Grid_Value_Reclassify.lo \
-	Grid_Value_Replace.lo Grid_Value_Replace_Interactive.lo \
-	Grid_Value_Request.lo Grid_Value_Type.lo \
-	GridsFromTableAndGrid.lo MLB_Interface.lo
+	Grid_Tiling.lo Grid_Transpose.lo Grid_Value_NoData.lo \
+	Grid_Value_Reclassify.lo Grid_Value_Replace.lo \
+	Grid_Value_Replace_Interactive.lo Grid_Value_Request.lo \
+	Grid_Value_Type.lo GridsFromTableAndGrid.lo MLB_Interface.lo
 libgrid_tools_la_OBJECTS = $(am_libgrid_tools_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -223,6 +233,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -256,6 +267,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -274,6 +292,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -363,6 +382,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -373,7 +393,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -408,6 +428,7 @@ Grid_Support_Tool_Chains.cpp\
 Grid_ThresholdBuffer.cpp\
 Grid_Tiling.cpp\
 Grid_Transpose.cpp\
+Grid_Value_NoData.cpp\
 Grid_Value_Reclassify.cpp\
 Grid_Value_Replace.cpp\
 Grid_Value_Replace_Interactive.cpp\
@@ -441,6 +462,7 @@ Grid_Support_Tool_Chains.h\
 Grid_ThresholdBuffer.h\
 Grid_Tiling.h\
 Grid_Transpose.h\
+Grid_Value_NoData.h\
 Grid_Value_Reclassify.h\
 Grid_Value_Replace.h\
 Grid_Value_Replace_Interactive.h\
@@ -466,7 +488,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/grid_tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/grid_tools/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -555,6 +576,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_ThresholdBuffer.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Tiling.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Transpose.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Value_NoData.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Value_Reclassify.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Value_Replace.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Grid_Value_Replace_Interactive.Plo at am__quote@
@@ -800,6 +822,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_visualisation/Grid_3D_Image.cpp b/src/modules/grid/grid_visualisation/Grid_3D_Image.cpp
index 2f052e5..ac13c87 100755
--- a/src/modules/grid/grid_visualisation/Grid_3D_Image.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_3D_Image.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_3D_Image.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_3D_Image.h b/src/modules/grid/grid_visualisation/Grid_3D_Image.h
index b0f1af7..492685e 100755
--- a/src/modules/grid/grid_visualisation/Grid_3D_Image.h
+++ b/src/modules/grid/grid_visualisation/Grid_3D_Image.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_3D_Image.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp b/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp
index 56b4f6e..5595f2b 100755
--- a/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Aspect_Slope_Map.cpp 2064 2014-03-21 13:20:57Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.h b/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.h
index f5604cf..2132e83 100755
--- a/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.h
+++ b/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Aspect_Slope_Map.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp b/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp
index aea3656..f1c9ad3 100755
--- a/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Blend.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Blend.h b/src/modules/grid/grid_visualisation/Grid_Color_Blend.h
index 42962b3..870063d 100755
--- a/src/modules/grid/grid_visualisation/Grid_Color_Blend.h
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Blend.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Blend.h 2157 2014-06-12 09:30:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Rotate.cpp b/src/modules/grid/grid_visualisation/Grid_Color_Rotate.cpp
index 86e7857..79df079 100755
--- a/src/modules/grid/grid_visualisation/Grid_Color_Rotate.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Rotate.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Rotate.cpp 2157 2014-06-12 09:30:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Rotate.h b/src/modules/grid/grid_visualisation/Grid_Color_Rotate.h
index e38c1f3..24077c5 100755
--- a/src/modules/grid/grid_visualisation/Grid_Color_Rotate.h
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Rotate.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Rotate.h 2157 2014-06-12 09:30:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp b/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp
index eb4bd0e..462d09f 100755
--- a/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Triangle.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Color_Triangle.h b/src/modules/grid/grid_visualisation/Grid_Color_Triangle.h
index 6aea01f..5241d3c 100755
--- a/src/modules/grid/grid_visualisation/Grid_Color_Triangle.h
+++ b/src/modules/grid/grid_visualisation/Grid_Color_Triangle.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Color_Triangle.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Colors_Fit.cpp b/src/modules/grid/grid_visualisation/Grid_Colors_Fit.cpp
index 85bc9b8..10681f7 100755
--- a/src/modules/grid/grid_visualisation/Grid_Colors_Fit.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Colors_Fit.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Colors_Fit.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Colors_Fit.h b/src/modules/grid/grid_visualisation/Grid_Colors_Fit.h
index 76851d2..7e9e5cb 100755
--- a/src/modules/grid/grid_visualisation/Grid_Colors_Fit.h
+++ b/src/modules/grid/grid_visualisation/Grid_Colors_Fit.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Colors_Fit.h 2157 2014-06-12 09:30:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.cpp b/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.cpp
index 4cc6292..e9c5597 100755
--- a/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Histogram_Surface.cpp 2245 2014-09-23 16:24:02Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.h b/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.h
index b23fca7..b4beaa1 100755
--- a/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.h
+++ b/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Histogram_Surface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp b/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp
index dfc3e16..c8c0da9 100755
--- a/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_RGB_Composite.cpp 2463 2015-04-02 09:02:26Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_RGB_Composite.h b/src/modules/grid/grid_visualisation/Grid_RGB_Composite.h
index 34c8643..1ad98c5 100755
--- a/src/modules/grid/grid_visualisation/Grid_RGB_Composite.h
+++ b/src/modules/grid/grid_visualisation/Grid_RGB_Composite.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_RGB_Composite.h 2155 2014-06-11 14:00:23Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Grid_Terrain_Map.cpp b/src/modules/grid/grid_visualisation/Grid_Terrain_Map.cpp
index 0abc4fb..f073628 100755
--- a/src/modules/grid/grid_visualisation/Grid_Terrain_Map.cpp
+++ b/src/modules/grid/grid_visualisation/Grid_Terrain_Map.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Terrain_Map.cpp 2484 2015-05-02 13:46:42Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -92,7 +92,7 @@ CGrid_Terrain_Map::CGrid_Terrain_Map(void)
 		"This module allows one to create different terrain visualisations from an elevation dataset:\n\n"
 		"* Topography: a simple map with an analytical hillshading of the terrain\n\n"
 		"* Morphology: a map which visualizes the terrain by combining positive and "
-		"negative openess (Yokoyama et al. 2002) with terrain slope in a single map. "
+		"negative openness (Yokoyama et al. 2002) with terrain slope in a single map. "
 		"In contrast to conventional shading methods this has the advantage of being "
 		"independent from the direction of the light source.\n\n"
 		"References:\n"
diff --git a/src/modules/grid/grid_visualisation/Grid_Terrain_Map.h b/src/modules/grid/grid_visualisation/Grid_Terrain_Map.h
index f0f36a8..2a1a4be 100755
--- a/src/modules/grid/grid_visualisation/Grid_Terrain_Map.h
+++ b/src/modules/grid/grid_visualisation/Grid_Terrain_Map.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Terrain_Map.h 2131 2014-05-27 13:34:07Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/MLB_Interface.cpp b/src/modules/grid/grid_visualisation/MLB_Interface.cpp
index e2d3aa4..7c55e50 100755
--- a/src/modules/grid/grid_visualisation/MLB_Interface.cpp
+++ b/src/modules/grid/grid_visualisation/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2529 2015-07-01 07:06:33Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/MLB_Interface.h b/src/modules/grid/grid_visualisation/MLB_Interface.h
index ae6d8f2..6ae81fd 100755
--- a/src/modules/grid/grid_visualisation/MLB_Interface.h
+++ b/src/modules/grid/grid_visualisation/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/grid/grid_visualisation/Makefile.am b/src/modules/grid/grid_visualisation/Makefile.am
index 5e4ea40..07d5a1c 100755
--- a/src/modules/grid/grid_visualisation/Makefile.am
+++ b/src/modules/grid/grid_visualisation/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/grid/grid_visualisation/Makefile.in b/src/modules/grid/grid_visualisation/Makefile.in
index 667399b..05107f3 100644
--- a/src/modules/grid/grid_visualisation/Makefile.in
+++ b/src/modules/grid/grid_visualisation/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/grid/grid_visualisation
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -216,6 +226,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +260,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +285,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +375,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -366,7 +386,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -415,7 +435,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/grid/grid_visualisation/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/grid/grid_visualisation/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -727,6 +746,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/Makefile.in b/src/modules/imagery/Makefile.in
index 6c2319c..966a20e 100644
--- a/src/modules/imagery/Makefile.in
+++ b/src/modules/imagery/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/imagery_classification/Makefile.in b/src/modules/imagery/imagery_classification/Makefile.in
index 8252016..f6d64a5 100644
--- a/src/modules/imagery/imagery_classification/Makefile.in
+++ b/src/modules/imagery/imagery_classification/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery/imagery_classification
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -216,6 +226,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +260,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +285,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +375,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -407,7 +427,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_classification/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_classification/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -717,6 +736,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/imagery_classification/classify_supervised_polygons.cpp b/src/modules/imagery/imagery_classification/classify_supervised_polygons.cpp
index b1f7c8f..08e48d5 100755
--- a/src/modules/imagery/imagery_classification/classify_supervised_polygons.cpp
+++ b/src/modules/imagery/imagery_classification/classify_supervised_polygons.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: classify_supervised_polygons.cpp 2452 2015-03-20 14:37:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_classification/classify_supervised_polygons.h b/src/modules/imagery/imagery_classification/classify_supervised_polygons.h
index 913ea4f..9aa2616 100755
--- a/src/modules/imagery/imagery_classification/classify_supervised_polygons.h
+++ b/src/modules/imagery/imagery_classification/classify_supervised_polygons.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: classify_supervised_polygons.h 2444 2015-03-18 19:56:49Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_maxent/Makefile.in b/src/modules/imagery/imagery_maxent/Makefile.in
index eff057d..c0cfe5e 100644
--- a/src/modules/imagery/imagery_maxent/Makefile.in
+++ b/src/modules/imagery/imagery_maxent/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery/imagery_maxent
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -212,6 +222,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +256,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +281,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +371,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -400,7 +420,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_maxent/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_maxent/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -709,6 +728,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/imagery_opencv/MLB_Interface.cpp b/src/modules/imagery/imagery_opencv/MLB_Interface.cpp
index 209e212..7c477bc 100755
--- a/src/modules/imagery/imagery_opencv/MLB_Interface.cpp
+++ b/src/modules/imagery/imagery_opencv/MLB_Interface.cpp
@@ -109,6 +109,7 @@ CSG_String Get_Info(int i)
 #include "opencv_svd.h"
 #include "opencv_nnet.h"
 #include "opencv_stereo_match.h"
+#include "opencv_ml.h"
 
 
 //---------------------------------------------------------
@@ -121,11 +122,20 @@ CSG_Module *		Create_Module(int i)
 	case  0:	return( new COpenCV_Morphology );
 	case  1:	return( new COpenCV_FFT );
 	case  2:	return( new COpenCV_SVD );
-	case  3:	return( new COpenCV_NNet );
-	case  4:	return( new COpenCV_Stereo_Match );
+	case  3:	return( new_COpenCV_NNet );
+	case  4:	return( new_COpenCV_Stereo_Match );
+
+	case  5:	return( new_COpenCV_ML_NBayes );
+	case  6:	return( new_COpenCV_ML_KNN );
+	case  7:	return( new_COpenCV_ML_SVM );
+	case  8:	return( new_COpenCV_ML_DTrees );
+	case  9:	return( new_COpenCV_ML_Boost );
+	case 10:	return( new_COpenCV_ML_RTrees );
+	case 11:	return( new_COpenCV_ML_ANN );
+
+	case 12:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
 	}
-
-	return( NULL );
 }
 
 
diff --git a/src/modules/imagery/imagery_opencv/Makefile.am b/src/modules/imagery/imagery_opencv/Makefile.am
index 3516cb9..1954267 100755
--- a/src/modules/imagery/imagery_opencv/Makefile.am
+++ b/src/modules/imagery/imagery_opencv/Makefile.am
@@ -15,6 +15,8 @@ libimagery_opencv_la_SOURCES =\
 MLB_Interface.cpp\
 opencv.cpp\
 opencv_fourier.cpp\
+opencv_ml.cpp\
+opencv_ml_tools.cpp\
 opencv_morphology.cpp\
 opencv_nnet.cpp\
 opencv_stereo_match.cpp\
@@ -22,6 +24,7 @@ opencv_svd.cpp\
 MLB_Interface.h\
 opencv.h\
 opencv_fourier.h\
+opencv_ml.h\
 opencv_morphology.h\
 opencv_nnet.h\
 opencv_stereo_match.h\
diff --git a/src/modules/imagery/imagery_opencv/Makefile.in b/src/modules/imagery/imagery_opencv/Makefile.in
index 08a4e1e..5467243 100644
--- a/src/modules/imagery/imagery_opencv/Makefile.in
+++ b/src/modules/imagery/imagery_opencv/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery/imagery_opencv
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -127,12 +137,14 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 @HAVE_CV_TRUE at libimagery_opencv_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
 am__libimagery_opencv_la_SOURCES_DIST = MLB_Interface.cpp opencv.cpp \
-	opencv_fourier.cpp opencv_morphology.cpp opencv_nnet.cpp \
-	opencv_stereo_match.cpp opencv_svd.cpp MLB_Interface.h \
-	opencv.h opencv_fourier.h opencv_morphology.h opencv_nnet.h \
+	opencv_fourier.cpp opencv_ml.cpp opencv_ml_tools.cpp \
+	opencv_morphology.cpp opencv_nnet.cpp opencv_stereo_match.cpp \
+	opencv_svd.cpp MLB_Interface.h opencv.h opencv_fourier.h \
+	opencv_ml.h opencv_morphology.h opencv_nnet.h \
 	opencv_stereo_match.h opencv_svd.h
 @HAVE_CV_TRUE at am_libimagery_opencv_la_OBJECTS = MLB_Interface.lo \
- at HAVE_CV_TRUE@	opencv.lo opencv_fourier.lo opencv_morphology.lo \
+ at HAVE_CV_TRUE@	opencv.lo opencv_fourier.lo opencv_ml.lo \
+ at HAVE_CV_TRUE@	opencv_ml_tools.lo opencv_morphology.lo \
 @HAVE_CV_TRUE@	opencv_nnet.lo opencv_stereo_match.lo \
 @HAVE_CV_TRUE@	opencv_svd.lo
 libimagery_opencv_la_OBJECTS = $(am_libimagery_opencv_la_OBJECTS)
@@ -219,6 +231,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -252,6 +265,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -270,6 +290,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -359,6 +380,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -381,6 +403,8 @@ top_srcdir = @top_srcdir@
 @HAVE_CV_TRUE at MLB_Interface.cpp\
 @HAVE_CV_TRUE at opencv.cpp\
 @HAVE_CV_TRUE at opencv_fourier.cpp\
+ at HAVE_CV_TRUE@opencv_ml.cpp\
+ at HAVE_CV_TRUE@opencv_ml_tools.cpp\
 @HAVE_CV_TRUE at opencv_morphology.cpp\
 @HAVE_CV_TRUE at opencv_nnet.cpp\
 @HAVE_CV_TRUE at opencv_stereo_match.cpp\
@@ -388,6 +412,7 @@ top_srcdir = @top_srcdir@
 @HAVE_CV_TRUE at MLB_Interface.h\
 @HAVE_CV_TRUE at opencv.h\
 @HAVE_CV_TRUE at opencv_fourier.h\
+ at HAVE_CV_TRUE@opencv_ml.h\
 @HAVE_CV_TRUE at opencv_morphology.h\
 @HAVE_CV_TRUE at opencv_nnet.h\
 @HAVE_CV_TRUE at opencv_stereo_match.h\
@@ -410,7 +435,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_opencv/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_opencv/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -476,6 +500,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_fourier.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_ml.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_ml_tools.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_morphology.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_nnet.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/opencv_stereo_match.Plo at am__quote@
@@ -718,6 +744,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/imagery_opencv/opencv_ml.cpp b/src/modules/imagery/imagery_opencv/opencv_ml.cpp
new file mode 100755
index 0000000..cca2bb8
--- /dev/null
+++ b/src/modules/imagery/imagery_opencv/opencv_ml.cpp
@@ -0,0 +1,507 @@
+/**********************************************************
+ * Version $Id: opencv_ml.cpp 0001 2016-05-24
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        OpenCV                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     opencv_ml.cpp                     //
+//                                                       //
+//                 Copyright (C) 2016 by                 //
+//                      Olaf Conrad                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "opencv_ml.h"
+
+#if CV_MAJOR_VERSION >= 3
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum
+{
+	CLASS_ID	= 0,
+	CLASS_NAME,
+	CLASS_COUNT,
+	CLASS_R,
+	CLASS_G,
+	CLASS_B
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+COpenCV_ML::COpenCV_ML(bool bProbability)
+{
+	CSG_Parameter	*pNode;
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Grid_List(
+		NULL	, "FEATURES"	, _TL("Features"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Bool(
+		pNode	, "NORMALIZE"	, _TL("Normalize"),
+		_TL(""),
+		false
+	);
+
+	if( bProbability )
+	{
+		Parameters.Add_Grid(
+			NULL	, "PROBABILITY"	, _TL("Probability"),
+			_TL(""),
+			PARAMETER_OUTPUT_OPTIONAL
+		);
+	}
+
+	pNode	= Parameters.Add_Shapes(
+		NULL	, "TRAIN_AREAS"	, _TL("Training Areas"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Polygon
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "TRAIN_CLASS"	, _TL("Class Identifier"),
+		_TL("")
+	);
+
+	pNode	= Parameters.Add_Grid(
+		NULL	, "CLASSES"		, _TL("Classification"),
+		_TL(""),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Short
+	);
+
+	Parameters.Add_Value(
+		pNode	, "RGB_COLORS"	, _TL("Update Colors from Features"),
+		_TL("Use the first three features in list to obtain blue, green, red components for class colour in look-up table."),
+		PARAMETER_TYPE_Bool, true
+	)->Set_UseInCMD(false);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int COpenCV_ML::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	//-----------------------------------------------------
+	return( CSG_Module_Grid::On_Parameter_Changed(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+int COpenCV_ML::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "FEATURES") )
+	{
+		pParameters->Set_Enabled("RGB_COLORS"     , pParameter->asGridList()->Get_Count() >= 3);
+	}
+
+	//-----------------------------------------------------
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool COpenCV_ML::_Initialize(void)
+{
+	m_pFeatures		= Parameters("FEATURES"   )->asGridList();
+	m_pClasses		= Parameters("CLASSES"    )->asGrid();
+	m_pProbability	= Parameters("PROBABILITY") ? Parameters("PROBABILITY")->asGrid() : NULL;
+	m_bNormalize	= Parameters("NORMALIZE"  )->asBool();
+
+	//-----------------------------------------------------
+	m_pClasses->Set_NoData_Value(-1.0);
+
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			bool	bNoData	= false;
+
+			for(int i=0; !bNoData && i<m_pFeatures->Get_Count(); i++)
+			{
+				bNoData	= m_pFeatures->asGrid(i)->is_NoData(x, y);
+			}
+
+			m_pClasses->Set_Value(x, y, bNoData ? -1.0 : 0.0);
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+//---------------------------------------------------------
+bool COpenCV_ML::_Finalize(void)
+{
+	CSG_Parameter	*pLUT	= DataObject_Get_Parameter(m_pClasses, "LUT");
+
+	if( pLUT && m_Classes.Get_Count() > 0 )
+	{
+		bool	bRGB	= m_pFeatures->Get_Count() >= 3 && Parameters("RGB_COLORS")->asBool();
+
+		for(int i=0; i<m_Classes.Get_Count(); i++)
+		{
+			CSG_Table_Record	*pClass	= pLUT->asTable()->Get_Record(i);
+
+			if( !pClass )
+			{
+				(pClass	= pLUT->asTable()->Add_Record())->Set_Value(0, SG_Color_Get_Random());
+			}
+
+			pClass->Set_Value(1, m_Classes[i].asString(1));
+			pClass->Set_Value(2, m_Classes[i].asString(1));
+			pClass->Set_Value(3, m_Classes[i].asInt   (0));
+			pClass->Set_Value(4, m_Classes[i].asInt   (0));
+
+			if( bRGB )
+			{
+				#define SET_COLOR_COMPONENT(c, i)	c = 127 + 127 * (m_bNormalize ? c : (c - m_pFeatures->asGrid(i)->Get_Mean()) / m_pFeatures->asGrid(i)->Get_StdDev());\
+					if( c < 0 ) c = 0; else if( c > 255 ) c = 255;
+
+				double	r = m_Classes[i].asDouble(CLASS_R) / m_Classes[i].asInt(CLASS_COUNT); SET_COLOR_COMPONENT(r, 2);
+				double	g = m_Classes[i].asDouble(CLASS_G) / m_Classes[i].asInt(CLASS_COUNT); SET_COLOR_COMPONENT(g, 1);
+				double	b = m_Classes[i].asDouble(CLASS_B) / m_Classes[i].asInt(CLASS_COUNT); SET_COLOR_COMPONENT(b, 0);
+
+				pClass->Set_Value(0, SG_GET_RGB(r, g, b));
+			}
+		}
+
+		pLUT->asTable()->Set_Record_Count(m_Classes.Get_Count());
+
+		DataObject_Set_Parameter(m_pClasses, pLUT);
+		DataObject_Set_Parameter(m_pClasses, "COLORS_TYPE", 1);	// Color Classification Type: Lookup Table
+	}
+
+	//-----------------------------------------------------
+	m_Classes.Destroy();
+
+	m_pClasses->Set_Name(Get_Name());
+
+	if( m_pProbability )
+	{
+		m_pProbability->Set_Name(Get_Name() + " [" + _TL("Probability") + "]");
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+inline double COpenCV_ML::_Get_Feature(int x, int y, int iFeature)
+{
+	CSG_Grid	*pFeature	= m_pFeatures->asGrid(iFeature);
+
+	double	Feature	= pFeature->asDouble(x, y);
+
+	if( m_bNormalize )
+	{
+		return( (Feature - pFeature->Get_Mean()) / pFeature->Get_StdDev() );
+	}
+
+	return( Feature );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool COpenCV_ML::_Get_Prediction(const Ptr<StatModel> &Model)
+{
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( !m_pClasses->is_NoData(x, y) )
+			{
+				Mat	Sample(1, m_pFeatures->Get_Count(), CV_32FC1);
+
+				for(int i=0; i<m_pFeatures->Get_Count(); i++)
+				{
+					Sample.at<float>(i)	= (float)_Get_Feature(x, y, i);
+				}
+
+				m_pClasses->Set_Value(x, y, Model->predict(Sample));
+
+				if( m_pProbability )
+				{
+					m_pProbability->Set_Value(x, y, Get_Probability(Model, Sample));
+				}
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool COpenCV_ML::_Get_Training(CSG_Matrix &Data)
+{
+	m_Classes.Destroy();
+
+	m_Classes.Add_Field("ID"   , SG_DATATYPE_Int   );	// CLASS_ID
+	m_Classes.Add_Field("NAME" , SG_DATATYPE_String);	// CLASS_NAME
+	m_Classes.Add_Field("COUNT", SG_DATATYPE_Int   );	// CLASS_COUNT
+	m_Classes.Add_Field("RED"  , SG_DATATYPE_Double);	// CLASS_R
+	m_Classes.Add_Field("GREEN", SG_DATATYPE_Double);	// CLASS_G
+	m_Classes.Add_Field("BLUE" , SG_DATATYPE_Double);	// CLASS_B
+
+	CSG_Shapes	*pPolygons	= Parameters("TRAIN_AREAS")->asShapes();
+	int			Field		= Parameters("TRAIN_CLASS")->asInt();
+	bool		bLabelAsId	= false;//Parameters("LABEL_AS_ID")->asBool();
+
+	pPolygons->Set_Index(Field, TABLE_INDEX_Ascending);
+
+	CSG_String			Label;
+	CSG_Table_Record	*pClass	= NULL;
+
+	//-----------------------------------------------------
+	for(int iPolygon=0, ID=0; iPolygon<pPolygons->Get_Count(); iPolygon++)
+	{
+		CSG_Shape_Polygon	*pPolygon	= (CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon);
+
+		if( !pClass || (bLabelAsId && ID != pPolygon->asInt(Field)) || Label.Cmp(pPolygon->asString(Field)) )
+		{
+			Label	= pPolygon->asString(Field);
+
+			if( !pClass || pClass->asInt(CLASS_COUNT) > 0 )
+			{
+				pClass	= m_Classes.Add_Record();
+
+				ID	= bLabelAsId ? pPolygon->asInt(Field) : ID + 1;
+			}
+
+			pClass->Set_Value(CLASS_ID  , ID   );
+			pClass->Set_Value(CLASS_NAME, Label);
+		}
+
+		_Get_Training(Data, pClass, pPolygon);
+	}
+
+	//-----------------------------------------------------
+	if( m_Classes.Get_Count() > 0 && m_Classes[m_Classes.Get_Count() - 1].asInt(CLASS_COUNT) <= 0 )
+	{
+		m_Classes.Del_Record(m_Classes.Get_Count() - 1);
+	}
+
+	return( m_Classes.Get_Count() > 0 );
+}
+
+//---------------------------------------------------------
+bool COpenCV_ML::_Get_Training(CSG_Matrix &Data, CSG_Table_Record *pClass, CSG_Shape_Polygon *pArea)
+{
+	int		ID	= pClass->asInt(CLASS_ID), n	= 0;
+	double	r	= 0.0, g	= 0.0, b	= 0.0;
+
+	int	xMin	= Get_System()->Get_xWorld_to_Grid(pArea->Get_Extent().Get_XMin());	if( xMin <  0        ) xMin = 0;
+	int	xMax	= Get_System()->Get_xWorld_to_Grid(pArea->Get_Extent().Get_XMax());	if( xMax >= Get_NX() ) xMax = Get_NX() - 1;
+	int	yMin	= Get_System()->Get_yWorld_to_Grid(pArea->Get_Extent().Get_YMin());	if( yMin <  0        ) yMin = 0;
+	int	yMax	= Get_System()->Get_yWorld_to_Grid(pArea->Get_Extent().Get_YMax());	if( yMax >= Get_NY() ) yMax = Get_NY() - 1;
+
+	for(int y=yMin; y<=yMax; y++)
+	{
+		for(int x=xMin; x<=xMax; x++)
+		{
+			if( !m_pClasses->is_NoData(x, y) && pArea->Contains(Get_System()->Get_Grid_to_World(x, y)) )
+			{
+				CSG_Vector	z(1 + m_pFeatures->Get_Count());
+
+				z[m_pFeatures->Get_Count()]	= ID;
+
+				for(int i=0; i<m_pFeatures->Get_Count(); i++)
+				{
+					z[i]	= _Get_Feature(x, y, i);
+				}
+
+				Data.Add_Row(z);
+
+				if( m_pFeatures->Get_Count() >= 3 )
+				{
+					r += z[2]; g += z[1]; b += z[0];
+				}
+
+				n++;
+			}
+		}
+	}
+
+	if( n > 0 )
+	{
+		pClass->Add_Value(CLASS_COUNT, n);
+		pClass->Add_Value(CLASS_R    , r);
+		pClass->Add_Value(CLASS_G    , g);
+		pClass->Add_Value(CLASS_B    , b);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+Ptr<TrainData> COpenCV_ML::Get_Training(const CSG_Matrix &Data)
+{
+	Mat	Samples (Data.Get_NRows(), Data.Get_NCols() - 1, CV_32F);
+	Mat	Response(Data.Get_NRows(),                    1, CV_32S);
+
+	for(int i=0; i<Data.Get_NRows(); i++)
+	{
+		Response.at<int>(i)	= (int)Data[i][Data.Get_NCols() - 1];
+
+		for(int j=0; j<Samples.cols; j++)
+		{
+			Samples.at<float>(i, j)	= (float)Data[i][j];
+		}
+	}
+
+	//-----------------------------------------------------
+	return( TrainData::create(Samples, ROW_SAMPLE, Response) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool COpenCV_ML::On_Execute(void)
+{
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("initializing"));
+
+	if( !_Initialize() )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("preparing"));
+
+	CSG_Matrix	Data;
+
+	if( !_Get_Training(Data) )
+	{
+		return( false );
+	}
+
+	Ptr<TrainData>	tData	= Get_Training(Data);	Data.Destroy();
+
+	Ptr<StatModel>	Model	= Get_Model();
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("training"));
+
+	Model->train(tData);
+
+	//-----------------------------------------------------
+	Process_Set_Text(_TL("prediction"));
+
+	_Get_Prediction(Model);
+
+	//-----------------------------------------------------
+	return( _Finalize() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // CV_MAJOR_VERSION >= 3
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/view_layout.cpp b/src/modules/imagery/imagery_opencv/opencv_ml.h
similarity index 51%
copy from src/saga_core/saga_gui/view_layout.cpp
copy to src/modules/imagery/imagery_opencv/opencv_ml.h
index 43289b9..5d4431e 100755
--- a/src/saga_core/saga_gui/view_layout.cpp
+++ b/src/modules/imagery/imagery_opencv/opencv_ml.h
@@ -1,279 +1,267 @@
-/**********************************************************
- * Version $Id: view_layout.cpp 2858 2016-03-23 16:05:24Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    User Interface                     //
-//                                                       //
-//                    Program: SAGA                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   VIEW_Layout.cpp                     //
-//                                                       //
-//          Copyright (C) 2005 by Olaf Conrad            //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// This file is part of 'SAGA - System for Automated     //
-// Geoscientific Analyses'. SAGA is free software; you   //
-// can redistribute it and/or modify it under the terms  //
-// of the GNU General Public License as published by the //
-// Free Software Foundation; version 2 of the License.   //
-//                                                       //
-// SAGA is distributed in the hope that it will be       //
-// useful, but WITHOUT ANY WARRANTY; without even the    //
-// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
-// PARTICULAR PURPOSE. See the GNU General Public        //
-// License for more details.                             //
-//                                                       //
-// You should have received a copy of the GNU General    //
-// Public License along with this program; if not,       //
-// write to the Free Software Foundation, Inc.,          //
-// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
-// USA.                                                  //
-//                                                       //
-//-------------------------------------------------------//
+/**********************************************************
+ * Version $Id: opencv_ml.h 0001 2016-05-24
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        OpenCV                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 Copyright (C) 2016 by                 //
+//                      Olaf Conrad                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
 //                                                       //
 //    contact:    Olaf Conrad                            //
 //                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
+//                University of Hamburg                  //
 //                Germany                                //
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include <wx/window.h>
-
-#include <saga_api/saga_api.h>
-
-#include "res_commands.h"
-#include "res_controls.h"
-#include "res_images.h"
-
-#include "helper.h"
-
-#include "wksp_map.h"
-
-#include "view_ruler.h"
-
-#include "view_layout.h"
-#include "view_layout_info.h"
-#include "view_layout_control.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-IMPLEMENT_CLASS(CVIEW_Layout, CVIEW_Base);
-
-//---------------------------------------------------------
-BEGIN_EVENT_TABLE(CVIEW_Layout, CVIEW_Base)
-	EVT_SIZE			(CVIEW_Layout::On_Size)
-
-	EVT_MENU			(ID_CMD_LAYOUT_PRINT_SETUP		, CVIEW_Layout::On_Print_Setup)
-	EVT_MENU			(ID_CMD_LAYOUT_PAGE_SETUP		, CVIEW_Layout::On_Page_Setup)
-	EVT_MENU			(ID_CMD_LAYOUT_PRINT			, CVIEW_Layout::On_Print)
-	EVT_MENU			(ID_CMD_LAYOUT_PRINT_PREVIEW	, CVIEW_Layout::On_Print_Preview)
-	EVT_MENU			(ID_CMD_LAYOUT_FIT_SCALE		, CVIEW_Layout::On_Fit_Scale)
-END_EVENT_TABLE()
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-CVIEW_Layout::CVIEW_Layout(CVIEW_Layout_Info *pInfo)
-: CVIEW_Base(pInfo->Get_Map(), ID_VIEW_LAYOUT, _TL("Layout"), ID_IMG_WND_LAYOUT, false)
-{
-	SetTitle(wxString::Format(wxT("%s [%s]"), pInfo->Get_Map()->Get_Name().c_str(), _TL("Layout")));
-
-	SYS_Set_Color_BG(this, wxSYS_COLOUR_3DFACE);
-
-	m_pInfo		= pInfo;
-
-	m_pRuler_X	= new CVIEW_Ruler(this, RULER_HORIZONTAL|RULER_EDGE_SUNKEN);
-	m_pRuler_Y	= new CVIEW_Ruler(this, RULER_VERTICAL  |RULER_EDGE_SUNKEN);
-
-	m_pControl	= new CVIEW_Layout_Control(this);
-	m_pControl->SetSize(GetClientSize());
-
-	Do_Show();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-wxMenu * CVIEW_Layout::_Create_Menu(void)
-{
-	wxMenu	*pMenu	= new wxMenu;
-
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_LAYOUT_FIT_SCALE);
-	pMenu->AppendSeparator();
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_LAYOUT_PAGE_SETUP);
-//	CMD_Menu_Add_Item(pMenu, false, ID_CMD_LAYOUT_PRINT_SETUP);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_LAYOUT_PRINT_PREVIEW);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_LAYOUT_PRINT);
-
-	return( pMenu );
-}
-
-//---------------------------------------------------------
-wxToolBarBase * CVIEW_Layout::_Create_ToolBar(void)
-{
-	wxToolBarBase	*pToolBar	= CMD_ToolBar_Create(ID_TB_VIEW_LAYOUT);
-
-	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_LAYOUT_PAGE_SETUP);
-//	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_LAYOUT_PRINT_SETUP);
-	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_LAYOUT_PRINT_PREVIEW);
-	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_LAYOUT_PRINT);
-
-	CMD_ToolBar_Add(pToolBar, _TL("Layout"));
-
-	return( pToolBar );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CVIEW_Layout::Do_Update(void)
-{
-	m_pControl->Refresh_Layout();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CVIEW_Layout::On_Size(wxSizeEvent &event)
-{
-	int		A, B, d, dX, dY;
-
-	A	= 1;
-	B	= 20;
-	d	= B - 4 * A;
-	dX	= GetClientSize().x - B;
-	dY	= GetClientSize().y - B;
-
-	Freeze();
-
-	m_pRuler_Y->SetSize(wxRect(A, B, d , dY));
-	m_pRuler_X->SetSize(wxRect(B, A, dX, d ));
-	m_pControl->SetSize(wxRect(B, B, dX, dY));
-	m_pControl->Fit_To_Size(dX, dY);
-
-	Thaw();
-
-	event.Skip();
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CVIEW_Layout::Ruler_Set_Position(int x, int y)
-{
-	m_pRuler_X->Set_Position(x);
-	m_pRuler_Y->Set_Position(y);
-}
-
-//---------------------------------------------------------
-void CVIEW_Layout::Ruler_Refresh(double xMin, double xMax, double yMin, double yMax)
-{
-	wxRect	r(m_pInfo->Get_Margins());
-
-	m_pRuler_X->Set_Range_Core(r.GetLeft(), r.GetLeft() + r.GetWidth());
-	m_pRuler_Y->Set_Range_Core(r.GetTop (), r.GetTop () + r.GetHeight());
-
-	m_pRuler_X->Set_Range(xMin, xMax);
-	m_pRuler_Y->Set_Range(yMin, yMax);
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CVIEW_Layout::On_Print_Setup(wxCommandEvent &event)
-{
-	if( m_pInfo->Setup_Print() )
-	{
-		m_pControl->Set_Dimensions();
-	}
-}
-
-//---------------------------------------------------------
-void CVIEW_Layout::On_Page_Setup(wxCommandEvent &event)
-{
-	if( m_pInfo->Setup_Page() )
-	{
-		m_pControl->Set_Dimensions();
-	}
-}
-
-//---------------------------------------------------------
-void CVIEW_Layout::On_Print(wxCommandEvent &event)
-{
-	m_pInfo->Print();
-}
-
-//---------------------------------------------------------
-void CVIEW_Layout::On_Print_Preview(wxCommandEvent &event)
-{
-	m_pInfo->Print_Preview();
-}
-
-//---------------------------------------------------------
-void CVIEW_Layout::On_Fit_Scale(wxCommandEvent &event)
-{
-	m_pInfo->Fit_Scale();
-}
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__OpenCV_ML_H
+#define HEADER_INCLUDED__OpenCV_ML_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "MLB_Interface.h"
+
+#include "opencv2/core/version.hpp"
+
+#if CV_MAJOR_VERSION >= 3
+
+#include <opencv2/ml.hpp>
+
+//---------------------------------------------------------
+using namespace cv;
+using namespace cv::ml;
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class COpenCV_ML : public CSG_Module_Grid
+{
+public:
+	COpenCV_ML(bool bProbability);
+
+	virtual CSG_String			Get_MenuPath	(void)	{	return( _TL("A:Imagery|Classification|Machine Learning (OpenCV)") );	}
+
+
+protected:
+
+	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
+	int							Get_Feature_Count		(void)	{	return( m_pFeatures->Get_Count() );	}
+	int							Get_Class_Count			(void)	{	return( m_Classes   .Get_Count() );	}
+
+	virtual Ptr<StatModel>		Get_Model				(void)	= 0;
+	virtual Ptr<TrainData>		Get_Training			(const CSG_Matrix &Data);
+
+	virtual double				Get_Probability			(const Ptr<StatModel> &Model, const Mat &Sample)	{	return( 0.0 );	}
+
+
+private:
+
+	bool						m_bNormalize;
+
+	CSG_Parameter_Grid_List		*m_pFeatures;
+
+	CSG_Grid					*m_pClasses, *m_pProbability;
+
+	CSG_Table					m_Classes;
+
+
+	double						_Get_Feature			(int x, int y, int iFeature);
+
+	bool						_Initialize				(void);
+	bool						_Finalize				(void);
+
+	bool						_Get_Training			(CSG_Matrix &Data);
+	bool						_Get_Training			(CSG_Matrix &Data, CSG_Table_Record *pClass, CSG_Shape_Polygon *pPolygon);
+
+	bool						_Get_Prediction			(const Ptr<StatModel> &Model);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class COpenCV_ML_NBayes : public COpenCV_ML
+{
+public:
+	COpenCV_ML_NBayes(void);
+
+
+protected:
+
+	virtual Ptr<StatModel>		Get_Model				(void);
+
+	virtual double				Get_Probability			(const Ptr<StatModel> &Model, const Mat &Sample);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class COpenCV_ML_KNN : public COpenCV_ML
+{
+public:
+	COpenCV_ML_KNN(void);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual Ptr<StatModel>		Get_Model				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class COpenCV_ML_SVM : public COpenCV_ML
+{
+public:
+	COpenCV_ML_SVM(void);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual Ptr<StatModel>		Get_Model				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class COpenCV_ML_DTrees : public COpenCV_ML
+{
+public:
+	COpenCV_ML_DTrees(void);
+
+
+protected:
+
+	virtual Ptr<StatModel>		Get_Model				(void);
+
+	virtual Ptr<DTrees>			Get_Trees				(void);
+
+};
+
+//---------------------------------------------------------
+class COpenCV_ML_Boost : public COpenCV_ML_DTrees
+{
+public:
+	COpenCV_ML_Boost(void);
+
+
+protected:
+
+	virtual Ptr<DTrees>			Get_Trees				(void);
+
+};
+
+//---------------------------------------------------------
+class COpenCV_ML_RTrees : public COpenCV_ML_DTrees
+{
+public:
+	COpenCV_ML_RTrees(void);
+
+
+protected:
+
+	virtual Ptr<DTrees>			Get_Trees				(void);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class COpenCV_ML_ANN : public COpenCV_ML
+{
+public:
+	COpenCV_ML_ANN(void);
+
+
+protected:
+
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual Ptr<StatModel>		Get_Model				(void);
+
+	virtual Ptr<TrainData>		Get_Training			(const CSG_Matrix &Data);
+
+};
 
 
 ///////////////////////////////////////////////////////////
@@ -283,3 +271,32 @@ void CVIEW_Layout::On_Fit_Scale(wxCommandEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#define new_COpenCV_ML_NBayes	new COpenCV_ML_NBayes
+#define new_COpenCV_ML_KNN		new COpenCV_ML_KNN
+#define new_COpenCV_ML_SVM		new COpenCV_ML_SVM
+#define new_COpenCV_ML_DTrees	new COpenCV_ML_DTrees
+#define new_COpenCV_ML_Boost	new COpenCV_ML_Boost
+#define new_COpenCV_ML_RTrees	new COpenCV_ML_RTrees
+#define new_COpenCV_ML_ANN		new COpenCV_ML_ANN
+
+#else // CV_MAJOR_VERSION == 3
+
+#define new_COpenCV_ML_NBayes	MLB_INTERFACE_SKIP_MODULE
+#define new_COpenCV_ML_KNN		MLB_INTERFACE_SKIP_MODULE
+#define new_COpenCV_ML_SVM		MLB_INTERFACE_SKIP_MODULE
+#define new_COpenCV_ML_DTrees	MLB_INTERFACE_SKIP_MODULE
+#define new_COpenCV_ML_Boost	MLB_INTERFACE_SKIP_MODULE
+#define new_COpenCV_ML_RTrees	MLB_INTERFACE_SKIP_MODULE
+#define new_COpenCV_ML_ANN		MLB_INTERFACE_SKIP_MODULE
+
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__OpenCV_ML_H
diff --git a/src/modules/imagery/imagery_opencv/opencv_ml_tools.cpp b/src/modules/imagery/imagery_opencv/opencv_ml_tools.cpp
new file mode 100755
index 0000000..eb22267
--- /dev/null
+++ b/src/modules/imagery/imagery_opencv/opencv_ml_tools.cpp
@@ -0,0 +1,738 @@
+/**********************************************************
+ * Version $Id: opencv_ml_normalbayes.cpp 0001 2016-05-24
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                        OpenCV                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//               opencv_ml_normalbayes.cpp               //
+//                                                       //
+//                 Copyright (C) 2016 by                 //
+//                      Olaf Conrad                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "opencv_ml.h"
+
+#if CV_MAJOR_VERSION >= 3
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+COpenCV_ML_NBayes::COpenCV_ML_NBayes(void)
+	: COpenCV_ML(true)
+{
+	Set_Name		(_TL("Normal Bayes Classification (OpenCV)"));
+
+	Set_Author		("O.Conrad (c) 2016");
+
+	Set_Description	(_TW(
+		"Integration of the OpenCV Machine Learning library for "
+		"Normal Bayes classification of gridded features.\n"
+		"<a href=\"http://docs.opencv.org\">Open Source Computer Vision</a>"
+	));
+}
+
+//---------------------------------------------------------
+Ptr<StatModel> COpenCV_ML_NBayes::Get_Model(void)
+{
+	return(	NormalBayesClassifier::create() );
+}
+
+//---------------------------------------------------------
+double COpenCV_ML_NBayes::Get_Probability(const Ptr<StatModel> &Model, const Mat &Sample)
+{
+	const Ptr<NormalBayesClassifier>	&m	= *((Ptr<NormalBayesClassifier>*)&Model);
+
+	Mat	Output, Probabilities;
+
+	return( m->predictProb(Sample, Output, Probabilities) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+COpenCV_ML_KNN::COpenCV_ML_KNN(void)
+	: COpenCV_ML(false)
+{
+	Set_Name		(_TL("K-Nearest Neighbours Classification (OpenCV)"));
+
+	Set_Author		("O.Conrad (c) 2016");
+
+	Set_Description	(_TW(
+		"Integration of the OpenCV Machine Learning library for "
+		"K-Nearest Neighbours classification of gridded features.\n"
+		"<a href=\"http://docs.opencv.org\">Open Source Computer Vision</a>"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Int(
+		NULL	, "NEIGHBOURS"	, _TL("Default Number of Neighbours"),
+		_TL(""),
+		3, 1, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TRAINING"	, _TL("Training Method"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("classification"),
+			_TL("regression model")
+		), 0
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "ALGORITHM"	, _TL("Algorithm Type"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("brute force"),
+			_TL("KD Tree")
+		), 0
+	);
+
+	Parameters.Add_Int(
+		NULL	, "EMAX"		, _TL("Parameter for KD Tree implementation"),
+		_TL(""),
+		1000, 1, true
+	);
+}
+
+//---------------------------------------------------------
+int COpenCV_ML_KNN::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "ALGORITHM") )
+	{
+		pParameters->Set_Enabled("EMAX", pParameter->asInt() == 1);
+	}
+
+	//-----------------------------------------------------
+	return( COpenCV_ML::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+Ptr<StatModel> COpenCV_ML_KNN::Get_Model(void)
+{
+	Ptr<KNearest>	Model	= KNearest::create();
+
+	switch( Parameters("ALGORITHM")->asInt() )
+	{
+	default:	Model->setAlgorithmType(KNearest::BRUTE_FORCE);	break;
+	case  1:	Model->setAlgorithmType(KNearest::KDTREE     );	break;
+	}
+
+	Model->setDefaultK    (Parameters("NEIGHBOURS")->asInt());
+	Model->setIsClassifier(Parameters("TRAINING"  )->asInt() == 0);
+//	Model->setEmax        (Parameters("EMAX"      )->asInt());
+
+	return(	Model );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+COpenCV_ML_SVM::COpenCV_ML_SVM(void)
+	: COpenCV_ML(false)
+{
+	Set_Name		(_TL("Support Vector Machine Classification (OpenCV)"));
+
+	Set_Author		("O.Conrad (c) 2016");
+
+	Set_Description	(_TW(
+		"Integration of the OpenCV Machine Learning library for "
+		"Support Vector Machine classification of gridded features.\n"
+		"<a href=\"http://docs.opencv.org\">Open Source Computer Vision</a>"
+	));
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode;
+
+	pNode	= Parameters.Add_Choice(
+		NULL	, "SVM_TYPE"	, _TL("SVM Type"),
+		_TL(""),
+		CSG_String::Format("%s|%s|%s|%s|%s|",
+			_TL("c-support vector classification"),
+			_TL("nu support vector classification"),
+			_TL("distribution estimation (one class)"),
+			_TL("epsilon support vector regression"),
+			_TL("nu support vector regression")
+		), 0
+	);
+
+	Parameters.Add_Double(pNode, "C" , _TL("C" ), _TL(""), 1.0, 0.0, true);
+	Parameters.Add_Double(pNode, "NU", _TL("Nu"), _TL(""), 0.5, 0.0, true);
+	Parameters.Add_Double(pNode, "P" , _TL("P" ), _TL(""), 0.5, 0.0, true);
+
+	pNode	= Parameters.Add_Choice(
+		NULL	, "KERNEL"		, _TL("Kernel Type"),
+		_TL(""),
+		CSG_String::Format("%s|%s|%s|%s|%s|%s|",
+			_TL("linear"),
+			_TL("polynomial"),
+			_TL("radial basis function"),
+			_TL("sigmoid"),
+			_TL("exponential chi2"),
+			_TL("histogram intersection"),
+			_TL("custom")
+		), 1
+	);
+
+	Parameters.Add_Double(pNode, "COEF0" , _TL("Coefficient 0"), _TL(""), 1.0, 0.0, true);
+	Parameters.Add_Double(pNode, "DEGREE", _TL("Degree"       ), _TL(""), 0.5, 0.0, true);
+	Parameters.Add_Double(pNode, "GAMMA" , _TL("Gamma"        ), _TL(""), 1.0, 0.0, true);
+}
+
+//---------------------------------------------------------
+int COpenCV_ML_SVM::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "SVM_TYPE") )
+	{
+		pParameters->Set_Enabled("C"     , pParameter->asInt() == 0 || pParameter->asInt() == 3 || pParameter->asInt() == 4);
+		pParameters->Set_Enabled("NU"    , pParameter->asInt() == 1 || pParameter->asInt() == 2 || pParameter->asInt() == 4);
+		pParameters->Set_Enabled("P"     , pParameter->asInt() == 3);
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "KERNEL") )
+	{
+		pParameters->Set_Enabled("COEF0" , pParameter->asInt() == 1 || pParameter->asInt() == 3);
+		pParameters->Set_Enabled("DEGREE", pParameter->asInt() == 1);
+		pParameters->Set_Enabled("GAMMA" , pParameter->asInt() >= 1 && pParameter->asInt() <= 4);
+	}
+
+	//-----------------------------------------------------
+	return( COpenCV_ML::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+Ptr<StatModel> COpenCV_ML_SVM::Get_Model(void)
+{
+	Ptr<SVM>	Model	= SVM::create();
+
+	switch( Parameters("SVM_TYPE")->asInt() )
+	{
+	default:	Model->setType(SVM::C_SVC    );	break;
+	case  1:	Model->setType(SVM::NU_SVC   );	break;
+	case  2:	Model->setType(SVM::ONE_CLASS);	break;
+	case  3:	Model->setType(SVM::EPS_SVR  );	break;
+	case  4:	Model->setType(SVM::NU_SVR   );	break;
+	}
+
+	switch( Parameters("KERNEL")->asInt() )
+	{
+	default:	Model->setKernel(SVM::LINEAR );	break;
+	case  1:	Model->setKernel(SVM::POLY   );	break;
+	case  2:	Model->setKernel(SVM::RBF    );	break;
+	case  3:	Model->setKernel(SVM::SIGMOID);	break;
+	case  4:	Model->setKernel(SVM::CHI2   );	break;
+	case  5:	Model->setKernel(SVM::INTER  );	break;
+	case  6:	Model->setKernel(SVM::CUSTOM );	break;
+	}
+
+	Model->setC     (Parameters("C"     )->asDouble());
+	Model->setCoef0 (Parameters("COEF0" )->asDouble());
+	Model->setDegree(Parameters("DEGREE")->asDouble());
+	Model->setGamma (Parameters("GAMMA" )->asDouble());
+	Model->setNu    (Parameters("NU"    )->asDouble());
+	Model->setP     (Parameters("P"     )->asDouble());
+
+	Model->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, 0.01));
+
+	return(	Model );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+COpenCV_ML_DTrees::COpenCV_ML_DTrees(void)
+	: COpenCV_ML(false)
+{
+	Set_Name		(_TL("Decision Tree Classification (OpenCV)"));
+
+	Set_Author		("O.Conrad (c) 2016");
+
+	Set_Description	(_TW(
+		"Integration of the OpenCV Machine Learning library for "
+		"Decision Tree classification of gridded features.\n"
+		"<a href=\"http://docs.opencv.org\">Open Source Computer Vision</a>"
+	));
+
+	Parameters.Add_Int(
+		NULL	, "MAX_DEPTH"		, _TL("Maximum Tree Depth"),
+		_TL("The maximum possible depth of the tree. That is the training algorithms attempts to split a node while its depth is less than maxDepth. The root node has zero depth."),
+		10, 1, true
+	);
+
+	Parameters.Add_Int(
+		NULL	, "MIN_SAMPLES"		, _TL("Minimum Sample Count"),
+		_TL("If the number of samples in a node is less than this parameter then the node will not be split."),
+		2, 2, true
+	);
+
+	Parameters.Add_Int(
+		NULL	, "MAX_CATEGRS"		, _TL("Maximum Categories"),
+		_TL("Cluster possible values of a categorical variable into K<=maxCategories clusters to find a suboptimal split."),
+		10, 1, true
+	);
+
+	//Parameters.Add_Int(
+	//	NULL	, "CV_FOLDS"		, _TL("CV Folds"),
+	//	_TL("If CVFolds > 1 then algorithms prunes the built decision tree using K-fold cross-validation procedure where K is equal to CVFolds. Default value is 10."),
+	//	10, 0, true
+	//);
+
+	Parameters.Add_Bool(
+		NULL	, "1SE_RULE"		, _TL("Use 1SE Rule"),
+		_TL("If true then a pruning will be harsher. This will make a tree more compact and more resistant to the training data noise but a bit less accurate."),
+		true
+	);
+
+	Parameters.Add_Bool(
+		NULL	, "TRUNC_PRUNED"	, _TL("Truncate Pruned Trees"),
+		_TL("If true then pruned branches are physically removed from the tree. Otherwise they are retained and it is possible to get results from the original unpruned (or pruned less aggressively) tree."),
+		true
+	);
+
+	Parameters.Add_Double(
+		NULL	, "REG_ACCURACY"	, _TL("Regression Accuracy"),
+		_TL("Termination criteria for regression trees. If all absolute differences between an estimated value in a node and values of train samples in this node are less than this parameter then the node will not be split further."),
+		 0.01, 0.0, true
+	);
+
+//	Parameters.Add_Bool(
+//		NULL	, "SURROGATES"		, _TL("Use Surrogates"),
+//		_TL("If true then surrogate splits will be built. These splits allow to work with missing data and compute variable importance correctly."),
+//		 false
+//	);
+}
+
+//---------------------------------------------------------
+Ptr<DTrees> COpenCV_ML_DTrees::Get_Trees(void)
+{
+	return( DTrees::create() );
+}
+
+//---------------------------------------------------------
+Ptr<StatModel> COpenCV_ML_DTrees::Get_Model(void)
+{
+	Ptr<DTrees>	Model	= Get_Trees();
+
+	Model->setMaxDepth          (Parameters("MAX_DEPTH"   )->asInt   ());
+	Model->setMinSampleCount    (Parameters("MIN_SAMPLES" )->asInt   ());
+	Model->setMaxCategories     (Parameters("MAX_CATEGRS" )->asInt   ());
+//	Model->setCVFolds           (Parameters("CV_FOLDS"    )->asInt   ());
+	Model->setCVFolds           (0);
+	Model->setUse1SERule        (Parameters("1SE_RULE"    )->asBool  ());
+	Model->setTruncatePrunedTree(Parameters("TRUNC_PRUNED")->asBool  ());
+	Model->setRegressionAccuracy(Parameters("REG_ACCURACY")->asDouble());
+//	Model->setUseSurrogates     (Parameters("SURROGATES"  )->asBool  ());
+
+	return(	Model );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+COpenCV_ML_Boost::COpenCV_ML_Boost(void)
+{
+	Set_Name		(_TL("Boosting Classification (OpenCV)"));
+
+	Set_Author		("O.Conrad (c) 2016");
+
+	Set_Description	(_TW(
+		"Integration of the OpenCV Machine Learning library for "
+		"Boosted Trees classification of gridded features.\n"
+		"<a href=\"http://docs.opencv.org\">Open Source Computer Vision</a>"
+	));
+
+	Parameters.Add_Int(
+		NULL	, "WEAK_COUNT"		, _TL("Weak Count"),
+		_TL("The number of weak classifiers."),
+		100, 0, true
+	);
+
+	Parameters.Add_Double(
+		NULL	, "WGT_TRIM_RATE"	, _TL("Weight Trim Rate"),
+		_TL("A threshold between 0 and 1 used to save computational time. Set this parameter to 0 to turn off this functionality."),
+		0.95, 0.0, true, 1.0, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "BOOST_TYPE"	, _TL("Boost Type"),
+		_TL(""),
+		CSG_String::Format("%s|%s|%s|%s|",
+			_TL("Discrete AdaBoost"),
+			_TL("Real AdaBoost"),
+			_TL("LogitBoost"),
+			_TL("Gentle AdaBoost")
+		), 1
+	);
+}
+
+//---------------------------------------------------------
+Ptr<DTrees> COpenCV_ML_Boost::Get_Trees(void)
+{
+	Ptr<Boost>	Model	= Boost::create();
+
+	Model->setWeakCount         (Parameters("WEAK_COUNT"   )->asInt   ());
+	Model->setWeightTrimRate    (Parameters("WGT_TRIM_RATE")->asDouble());
+
+	switch( Parameters("BOOST_TYPE")->asInt() )
+	{
+	default:	Model->setBoostType(Boost::DISCRETE);	break;
+	case  1:	Model->setBoostType(Boost::REAL    );	break;
+	case  2:	Model->setBoostType(Boost::LOGIT   );	break;
+	case  3:	Model->setBoostType(Boost::GENTLE  );	break;
+	}
+
+//	Model->setPriors        (Mat());
+
+	return(	Model );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+COpenCV_ML_RTrees::COpenCV_ML_RTrees(void)
+{
+	Set_Name		(_TL("Random Forest Classification (OpenCV)"));
+
+	Set_Author		("O.Conrad (c) 2016");
+
+	Set_Description	(_TW(
+		"Integration of the OpenCV Machine Learning library for "
+		"Random Forest classification of gridded features.\n"
+		"<a href=\"http://docs.opencv.org\">Open Source Computer Vision</a>"
+	));
+
+	Parameters.Add_Int(
+		NULL	, "ACTIVE_VARS"	, _TL("Active Variable Count"),
+		_TL("The size of the randomly selected subset of features at each tree node and that are used to find the best split(s). If you set it to 0 then the size will be set to the square root of the total number of features."),
+		0, 0, true
+	);
+}
+
+//---------------------------------------------------------
+Ptr<DTrees> COpenCV_ML_RTrees::Get_Trees(void)
+{
+	Ptr<RTrees>	Model	= RTrees::create();
+
+	Model->setActiveVarCount(Parameters("ACTIVE_VARS")->asInt());
+
+	Model->setCalculateVarImportance(false);
+
+	Model->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER, 5, 0));
+
+//	Model->setPriors                (Mat());
+
+	return(	Model );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+enum E_ANN_ACTIVATION
+{
+	ANN_ACTIVATION_IDENTITY	= 0,
+	ANN_ACTIVATION_SIGMOID,
+	ANN_ACTIVATION_GAUSSIAN
+};
+
+//---------------------------------------------------------
+enum E_ANN_PROPAGATION
+{
+	ANN_PROPAGATION_RESILIENT = 0,
+	ANN_PROPAGATION_BACK
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+COpenCV_ML_ANN::COpenCV_ML_ANN(void)
+	: COpenCV_ML(false)
+{
+	Set_Name		(_TL("Artificial Neural Network Classification (OpenCV)"));
+
+	Set_Author		("O.Conrad (c) 2016, L.Piras (c) 2013");
+
+	Set_Description	(_TW(
+		"Integration of the OpenCV Machine Learning library for "
+		"Artificial Neural Network classification of gridded features.\n"
+		"<a href=\"http://docs.opencv.org\">Open Source Computer Vision</a>"
+	));
+
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode;
+
+	Parameters.Add_Int(
+		NULL	, "ANN_LAYERS"		, _TL("Number of Layers"),
+		_TL("You can specify the number of layers in the network (not including input and output layer)."),
+		3, 1, true
+	);
+
+	Parameters.Add_Int(
+		NULL	, "ANN_NEURONS"		, _TL("Number of Neurons"),
+		_TL("You can specify the number of neurons in each layer of the network."),
+		3, 1, true
+	);
+
+	Parameters.Add_Int(
+		NULL	, "ANN_MAXITER"		, _TL("Maximum Number of Iterations"),
+		_TL(""),
+		300, 1, true
+	);
+
+	Parameters.Add_Double(
+		NULL	, "ANN_EPSILON"		, _TL("Error Change (Epsilon)"),
+		_TL("Termination criteria of the training algorithm. You can specify how much the error could change between the iterations to make the algorithm continue (epsilon)."),
+		FLT_EPSILON, 0.0, true
+	);
+
+	pNode	= Parameters.Add_Choice(
+		NULL	, "ANN_ACTIVATION"	, _TL("Activation Function"),
+		_TL(""),
+		CSG_String::Format("%s|%s|%s|",
+			_TL("Identity"),	
+			_TL("Sigmoid"),
+			_TL("Gaussian")
+		), 1
+	);
+ 
+	Parameters.Add_Double(pNode, "ANN_ACT_ALPHA", _TL("Function's Alpha"), _TL(""), 1.0);
+	Parameters.Add_Double(pNode, "ANN_ACT_BETA" , _TL("Function's Beta" ), _TL(""), 1.0);
+
+	pNode	= Parameters.Add_Choice(
+		NULL	, "ANN_PROPAGATION"		, _TL("Training Method"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("resilient propagation"),
+			_TL("back propagation")
+		), 1
+	);
+
+	Parameters.Add_Double(pNode, "ANN_RP_DW0"     , _TL("Initial Update Value"    ), _TL(""), 0.0);							// _TL("Initial value delta_0 of update-values delta_ij.")
+	Parameters.Add_Double(pNode, "ANN_RP_DW_PLUS" , _TL("Increase Factor"         ), _TL(""), 1.2, 1.01, true);				// _TL("Increase factor n_plus. Must be > 1.")
+	Parameters.Add_Double(pNode, "ANN_RP_DW_MINUS", _TL("Decrease Factor"         ), _TL(""), 0.5, 0.01, true, 0.99, true);	// _TL("Decrease factor n_minus. Must be < 1.")
+	Parameters.Add_Double(pNode, "ANN_RP_DW_MIN"  , _TL("Lower Value Update Limit"), _TL(""), 0.1, 0.01, true);				// _TL("Corresponds to delta_min. Must be > 0")
+	Parameters.Add_Double(pNode, "ANN_RP_DW_MAX"  , _TL("Upper Value Update Limit"), _TL(""), 1.1, 1.01, true);				// _TL("Corresponds to delta_max. Must be > 1")
+
+	Parameters.Add_Double(pNode, "ANN_BP_DW"      , _TL("Weight Gradient Term"    ), _TL(""), 0.1);							// _TL("Strength of the weight gradient term. The recommended value is about 0.1.")
+	Parameters.Add_Double(pNode, "ANN_BP_MOMENT"  , _TL("Moment Term"             ), _TL(""), 0.1);							// _TL("Strength of the momentum term (the difference between weights on the 2 previous iterations). This parameter provides some inertia to smooth the random fluctuations of the weights. It can vary from 0 (the feature is disabled) to 1 and beyond. The value 0.1 or so is good enough.")
+}
+
+//---------------------------------------------------------
+int COpenCV_ML_ANN::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "ANN_ACTIVATION") )
+	{
+		pParameters->Set_Enabled("ANN_ACT_ALPHA"  , pParameter->asInt() != ANN_ACTIVATION_IDENTITY);
+		pParameters->Set_Enabled("ANN_ACT_BETA"   , pParameter->asInt() != ANN_ACTIVATION_IDENTITY);
+	}
+
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "ANN_PROPAGATION") )
+	{
+		pParameters->Set_Enabled("ANN_RP_DW0"     , pParameter->asInt() == ANN_PROPAGATION_RESILIENT);
+		pParameters->Set_Enabled("ANN_RP_DW_PLUS" , pParameter->asInt() == ANN_PROPAGATION_RESILIENT);
+		pParameters->Set_Enabled("ANN_RP_DW_MINUS", pParameter->asInt() == ANN_PROPAGATION_RESILIENT);
+		pParameters->Set_Enabled("ANN_RP_DW_MIN"  , pParameter->asInt() == ANN_PROPAGATION_RESILIENT);
+		pParameters->Set_Enabled("ANN_RP_DW_MAX"  , pParameter->asInt() == ANN_PROPAGATION_RESILIENT);
+
+		pParameters->Set_Enabled("ANN_BP_DW"      , pParameter->asInt() == ANN_PROPAGATION_BACK);
+		pParameters->Set_Enabled("ANN_BP_MOMENT"  , pParameter->asInt() == ANN_PROPAGATION_BACK);
+	}
+
+	//-----------------------------------------------------
+	return( COpenCV_ML::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+Ptr<StatModel> COpenCV_ML_ANN::Get_Model(void)
+{
+	Ptr<ANN_MLP>	Model	= ANN_MLP::create();
+
+	//-----------------------------------------------------
+	Mat	layer_sizes(1, 2 + Parameters("ANN_LAYERS")->asInt(), CV_32SC1);
+
+	layer_sizes.at<int>(0)	= Get_Feature_Count();	// The first layer needs the same size (number of neurons) as the number of columns in the training data
+
+	for(int i=1; i<layer_sizes.cols-1; i++)
+	{
+		layer_sizes.at<int>(i)	= Parameters("ANN_NEURONS")->asInt();
+	}
+
+	layer_sizes.at<int>(layer_sizes.cols-1)	= Get_Class_Count();	// The last layer needs the same size (number of neurons) as the number of output columns
+
+	Model->setLayerSizes(layer_sizes);
+
+	//-----------------------------------------------------
+	switch( Parameters("ANN_ACTIVATION")->asInt() )
+	{
+	case  0:	// Identity
+		Model->setActivationFunction(ANN_MLP::IDENTITY);
+		break;
+
+	default:	// Sigmoid
+		Model->setActivationFunction(ANN_MLP::SIGMOID_SYM, 
+			Parameters("ANN_ACT_ALPHA")->asDouble(),
+			Parameters("ANN_ACT_BETA" )->asDouble()
+		);
+		break;
+
+	case  2:	// Gaussian
+		Model->setActivationFunction(ANN_MLP::GAUSSIAN,
+			Parameters("ANN_ACT_ALPHA")->asDouble(),
+			Parameters("ANN_ACT_BETA" )->asDouble()
+		);
+		break;
+	}
+
+	//-----------------------------------------------------
+	Model->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS,
+		Parameters("ANN_MAXITER")->asInt   (),
+		Parameters("ANN_EPSILON")->asDouble()
+	));
+
+	//-----------------------------------------------------
+	switch( Parameters("ANN_PROPAGATION")->asInt() )
+	{
+	case  0:	// resilient propagation
+		Model->setTrainMethod(ANN_MLP::RPROP);
+		Model->setRpropDW0             (Parameters("ANN_RP_DW0"     )->asDouble());
+		Model->setRpropDWPlus          (Parameters("ANN_RP_DW_PLUS" )->asDouble());
+		Model->setRpropDWMinus         (Parameters("ANN_RP_DW_MINUS")->asDouble());
+		Model->setRpropDWMin           (Parameters("ANN_RP_DW_MIN"  )->asDouble());
+		Model->setRpropDWMax           (Parameters("ANN_RP_DW_MAX"  )->asDouble());
+		break;
+
+	default:
+		Model->setTrainMethod(ANN_MLP::BACKPROP);
+		Model->setBackpropMomentumScale(Parameters("ANN_BP_MOMENT"  )->asDouble());
+		Model->setBackpropWeightScale  (Parameters("ANN_BP_DW"      )->asDouble());
+		break;
+	}
+
+	//-----------------------------------------------------
+	return( Model );
+}
+
+//---------------------------------------------------------
+Ptr<TrainData> COpenCV_ML_ANN::Get_Training(const CSG_Matrix &Data)
+{
+	Mat	Samples (Data.Get_NRows(), Data.Get_NCols() - 1 , CV_32F);
+	Mat	Response(Data.Get_NRows(), Get_Class_Count()    , CV_32F);
+
+	for(int i=0; i<Data.Get_NRows(); i++)
+	{
+		int	j, k	= (int)Data[i][Data.Get_NCols() - 1];
+
+		for(j=0; j<Response.cols; j++)
+		{
+			Response.at<float>(i, j)	= j == k ? 1.f : 0.f;
+		}
+
+		for(j=0; j<Samples.cols; j++)
+		{
+			Samples.at<float>(i, j)	= (float)Data[i][j];
+		}
+	}
+
+	return( TrainData::create(Samples, ROW_SAMPLE, Response) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // CV_MAJOR_VERSION >= 3
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/imagery/imagery_opencv/opencv_nnet.cpp b/src/modules/imagery/imagery_opencv/opencv_nnet.cpp
index 96b283a..ab9b793 100755
--- a/src/modules/imagery/imagery_opencv/opencv_nnet.cpp
+++ b/src/modules/imagery/imagery_opencv/opencv_nnet.cpp
@@ -60,8 +60,9 @@
 
 //---------------------------------------------------------
 #include "opencv_nnet.h"
-#include <opencv/cxcore.h>
-#include <opencv/ml.h>
+
+#if CV_MAJOR_VERSION == 2
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -74,7 +75,7 @@ COpenCV_NNet::COpenCV_NNet(void)
 {
 	CSG_Parameter	*pNodeTrainData, *pNodeTrainAreas, *pNodeTopology, *pNodeActFun, *pNodeRPROP, *pNodeBPROP, *pNodeData;
 
-	Set_Name		(_TL("Neural Networks (OpenCV)"));
+	Set_Name		(_TL("[deprecated] Neural Networks (OpenCV)"));
 
 	Set_Author		(SG_T("Luca Piras"));
 
@@ -953,3 +954,5 @@ CvMat** COpenCV_NNet::GetTrainAndOutputMatrix(CSG_Parameter_Grid_List *gl_grids,
 	mat_array[1] = mat_outputData;
 	return mat_array;
 }
+
+#endif // CV_MAJOR_VERSION == 2
diff --git a/src/modules/imagery/imagery_opencv/opencv_nnet.h b/src/modules/imagery/imagery_opencv/opencv_nnet.h
index 276530b..25128a5 100755
--- a/src/modules/imagery/imagery_opencv/opencv_nnet.h
+++ b/src/modules/imagery/imagery_opencv/opencv_nnet.h
@@ -64,9 +64,15 @@
 
 //---------------------------------------------------------
 #include "MLB_Interface.h"
+
+#include "opencv2/core/version.hpp"
+
+#if CV_MAJOR_VERSION == 2
+
 #include <opencv/cxcore.h>
 #include <opencv/ml.h>
 
+
 ///////////////////////////////////////////////////////////
 //														 //
 //														 //
@@ -106,6 +112,22 @@ private:
 	virtual CvMat**				GetTrainAndOutputMatrix(CSG_Parameter_Grid_List *gl_grids, int type, CSG_Shapes *s_areas, int i_classId, CSG_Grid *g_evalOut, CSG_Grid *g_evalOutCert);
 	virtual CSG_Vector			GetClassVectorByName(CSG_Shapes *s_areas, const SG_Char *s_class, int i_classId); 
 };
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#define new_COpenCV_NNet	new COpenCV_NNet
+
+#else // CV_MAJOR_VERSION == 2
+
+#define new_COpenCV_NNet	MLB_INTERFACE_SKIP_MODULE
+
+#endif
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_opencv/opencv_stereo_match.cpp b/src/modules/imagery/imagery_opencv/opencv_stereo_match.cpp
index ff3b350..dc66d94 100755
--- a/src/modules/imagery/imagery_opencv/opencv_stereo_match.cpp
+++ b/src/modules/imagery/imagery_opencv/opencv_stereo_match.cpp
@@ -61,27 +61,7 @@
 //---------------------------------------------------------
 #include "opencv_stereo_match.h"
 
-#include "opencv2/calib3d/calib3d.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-//#include "opencv2/imgcodecs.hpp"
-//#include "opencv2/core/utility.hpp"
-#include "opencv2/opencv.hpp"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-enum
-{
-	STEREO_BM	= 0,
-	STEREO_SGBM	= 1,
-	STEREO_HH	= 2,
-	STEREO_VAR	= 3
-};
+#if CV_MAJOR_VERSION == 3
 
 
 ///////////////////////////////////////////////////////////
@@ -95,7 +75,7 @@ COpenCV_Stereo_Match::COpenCV_Stereo_Match(void)
 {
 	Set_Name		(_TL("Stereo Match (OpenCV)"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2014"));
+	Set_Author		("O.Conrad (c) 2014");
 
 	Set_Description	(_TW(
 		"References:\n"
@@ -103,6 +83,9 @@ COpenCV_Stereo_Match::COpenCV_Stereo_Match(void)
 		"<a target=\"_blank\" href=\"http://opencv.org\">http://opencv.org</a>"
 	));
 
+	//-----------------------------------------------------
+	CSG_Parameter	*pNode;
+
 	Parameters.Add_Grid(
 		NULL	, "LEFT"		, _TL("Left Image"),
 		_TL(""),
@@ -121,284 +104,271 @@ COpenCV_Stereo_Match::COpenCV_Stereo_Match(void)
 		PARAMETER_OUTPUT
 	);
 
-//	Parameters.Add_PointCloud(
-//		NULL	, "POINTS"		, _TL("3D Points"),
-//		_TL(""),
-//		PARAMETER_OUTPUT
-//	);
+	Parameters.Add_PointCloud(
+		NULL	, "POINTS"		, _TL("Points"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL
+	);
 
+	//-----------------------------------------------------
 	Parameters.Add_Choice(
-		NULL	, "ALGORITHM"	, _TL("Algorithm"),
+		NULL	, "ALGORITHM"		, _TL("Algorithm"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
-			_TL("bm"),
-			_TL("sgbm"),
-			_TL("hh"),
-			_TL("var")
+		CSG_String::Format("%s|%s|",
+			_TL("Block Matching"),
+			_TL("Modified Hirschmuller")
 		)
 	);
 
-	Parameters.Add_Value(
-		NULL	, "BLOCKSIZE"	, _TL("Block Size"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 4, 0, true
+	Parameters.Add_Int(
+		NULL	, "DISP_MIN"		, _TL("Minimum Disparity"),
+		_TL("Minimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly."),
+		0, 0, true
 	);
 
-	Parameters.Add_Value(
-		NULL	, "DISP_MAX"	, _TL("Maximum Disparity"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 1, 1, true
+	Parameters.Add_Int(
+		NULL	, "DISP_NUM"		, _TL("Number of Disparities"),
+		_TL("Maximum disparity minus minimum disparity. The value is always greater than zero."),
+		1, 1, true
 	);
 
-	Parameters.Add_Value(
-		NULL	, "SCALE"		, _TL("Scale Factor"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
+	Parameters.Add_Int(
+		NULL	, "BLOCKSIZE"		, _TL("Block Size"),
+		_TL("The linear size of the blocks compared by the algorithm. Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher chance for algorithm to find a wrong correspondence."),
+		4, 0, true
 	);
-}
 
+	Parameters.Add_Int(
+		NULL	, "DIFF_MAX"		, _TL("Maximum Disparity Difference"),
+		_TL("Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check."),
+		1, -1, true
+	);
 
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool COpenCV_Stereo_Match::On_Execute(void)
-{
-	CSG_Grid	*pLeft, *pRight, *pDisp;
+	Parameters.Add_Int(
+		NULL	, "UNIQUENESS"		, _TL("Uniqueness Ratio"),
+		_TL("Margin in percentage by which the best (minimum) computed cost function value should \"win\" the second best value to consider the found match correct. Normally, a value within the 5-15 range is good enough."),
+		15, 0, true
+	);
 
-	pLeft	= Parameters("LEFT" )->asGrid();
-	pRight	= Parameters("RIGHT")->asGrid();
+	Parameters.Add_Int(
+		NULL	, "SPECKLE_SIZE"	, _TL("Speckle Window Size"),
+		_TL("Maximum size of smooth disparity regions to consider their noise speckles and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the 50-200 range."),
+		100, 0, true
+	);
 
-	pDisp	= Parameters("DISPARITY")->asGrid();
+	Parameters.Add_Int(
+		NULL	, "SPECKLE_RANGE"	, _TL("Speckle Range"),
+		_TL("Maximum disparity variation within each connected component. If you do speckle filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. Normally, 1 or 2 is good enough."),
+		2, 0, true
+	);
 
 	//-----------------------------------------------------
-	int		BlockSize, Algorithm, maxDisp;
-	double	Scale;
+	pNode	= Parameters.Add_Node(
+		NULL	, "BM_NODE"			, _TL("Block Matching"),
+		_TL("")
+	);
 
-	BlockSize	= Parameters("BLOCKSIZE")->asInt() * 2 + 1;
-	maxDisp		= Parameters("DISP_MAX" )->asInt() * 16;
-	Scale		= Parameters("SCALE"    )->asDouble();
+	Parameters.Add_Int(
+		pNode	, "BM_TEXTURE"		, _TL("Texture Threshold"),
+		_TL(""),
+		31, 0, true
+	);
 
-	switch( Parameters("ALGORITHM")->asInt() )
-	{
-	case  0:	Algorithm	= STEREO_BM;	break;
-	default:	Algorithm	= STEREO_SGBM;	break;
-	case  2:	Algorithm	= STEREO_HH;	break;
-	case  3:	Algorithm	= STEREO_VAR;	break;
-	}
+	Parameters.Add_Int(
+		pNode	, "BM_FILTER_CAP"	, _TL("Prefilter Truncation Value"),
+		_TL("Truncation value for the prefiltered image pixels."),
+		31, 0, true
+	);
 
-	//-----------------------------------------------------
-	cv::StereoBM	bm;//(CV_STEREO_BM_BASIC, maxDisp);
-
-	cv::Rect	roi1, roi2;
-	bm.state->roi1					= roi1;
-	bm.state->roi2					= roi2;
-	bm.state->preFilterCap			= 31;
-	bm.state->SADWindowSize			= BlockSize > 0 ? BlockSize : 9;
-	bm.state->minDisparity			= 0;
-	bm.state->numberOfDisparities	= maxDisp;
-	bm.state->textureThreshold		= 10;
-	bm.state->uniquenessRatio		= 15;
-	bm.state->speckleWindowSize		= 100;
-	bm.state->speckleRange			= 32;
-	bm.state->disp12MaxDiff			= 1;
-/**/
+	//Parameters.Add_Int(
+	//	pNode	, "BM_FILTER_SIZE"	, _TL("Prefilter Size"),
+	//	_TL(""),
+	//	31, 0, true
+	//);
+
+	//Parameters.Add_Choice(
+	//	pNode	, "BM_FILTER_TYPE"	, _TL("Prefilter Type"),
+	//	_TL(""),
+	//	CSG_String::Format("%s|%s|",
+	//		_TL("normalized response"),
+	//		_TL("Sobel")
+	//	)
+	//);
 
 	//-----------------------------------------------------
-	cv::Mat	Left, Right, Disparity;
+	pNode	= Parameters.Add_Node(
+		NULL	, "SGBM_NODE"		, _TL("Modified Hirschmuller"),
+		_TL("")
+	);
 
-	Get_CVMatrix(Left , pLeft , SG_DATATYPE_Byte);
-	Get_CVMatrix(Right, pRight, SG_DATATYPE_Byte);
+	Parameters.Add_Choice(
+		pNode	, "SGBM_MODE"		, _TL("Mode"),
+		_TL(""),
+		CSG_String::Format("%s|%s|%s|",
+			_TL("Semi-Global Block Matching"),
+			_TL("HH"),
+			_TL("SGBM 3 Way")
+		)
+	);
 
-	bm(Left, Right, Disparity, CV_32F);
+	Parameters.Add_Int(
+		pNode	, "SGBM_P1"			, _TL("Disparity Smoothness Parameter 1"),
+		_TL("The larger the value, the smoother the disparity. Parameter 1 is the penalty on the disparity change by plus or minus 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1."),
+		8, 0, true
+	);
 
-	//-----------------------------------------------------
-	Copy_CVMatrix_To_Grid(pDisp, &Disparity);
+	Parameters.Add_Int(
+		pNode	, "SGBM_P2"			, _TL("Disparity Smoothness Parameter 2"),
+		_TL("The larger the value, the smoother the disparity. Parameter 2 is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1."),
+		32, 0, true
+	);
 
-//	pDisp->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), Get_Name().c_str()));
+	Parameters.Add_Int(
+		pNode	, "SGBM_FILTER_CAP"	, _TL("Prefilter Truncation Value"),
+		_TL("Truncation value for the prefiltered image pixels. The algorithm first computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. The result values are passed to the Birchfield-Tomasi pixel cost function."),
+		31, 0, true
+	);
+}
 
-	return( true );
 
-	//-----------------------------------------------------
-/*
-	if( (intrinsic_filename != 0) ^ (extrinsic_filename != 0) )
-	{
-	printf("Command-line parameter error: either both intrinsic and extrinsic parameters must be specified, or none of them (when the stereo pair is already rectified)\n");
-	return -1;
-	}
-	if( extrinsic_filename == 0 && point_cloud_filename )
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int COpenCV_Stereo_Match::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "ALGORITHM") )
 	{
-	printf("Command-line parameter error: extrinsic and intrinsic parameters must be specified to compute the point cloud\n");
-	return -1;
+		pParameters->Set_Enabled(  "BM_NODE", pParameter->asInt() == 0);
+		pParameters->Set_Enabled("SGBM_NODE", pParameter->asInt() == 1);
 	}
 
-	//-----------------------------------------------------
-	if( Scale != 1.f )
-	{
-		Mat temp1, temp2;
-		int method = Scale < 1 ? INTER_AREA : INTER_CUBIC;
-		resize(img1, temp1, Size(), Scale, Scale, method);
-		img1 = temp1;
-		resize(img2, temp2, Size(), Scale, Scale, method);
-		img2 = temp2;
-	}
-
-	Size img_size = img1.size();
+	//-----------------------------------------------------
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
+}
 
-	Rect roi1, roi2;
-	Mat Q;
 
-	if( intrinsic_filename )
-	{
-		// reading intrinsic parameters
-		FileStorage fs(intrinsic_filename, CV_STORAGE_READ);
-		if(!fs.isOpened())
-		{
-			printf("Failed to open file %s\n", intrinsic_filename);
-			return -1;
-		}
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
 
-		Mat M1, D1, M2, D2;
-		fs["M1"] >> M1;
-		fs["D1"] >> D1;
-		fs["M2"] >> M2;
-		fs["D2"] >> D2;
+//---------------------------------------------------------
+bool COpenCV_Stereo_Match::On_Execute(void)
+{
+	//-----------------------------------------------------
+	Mat	Left, Right, Disparity;
 
-		M1 *= Scale;
-		M2 *= Scale;
+	Get_CVMatrix(Left , Parameters("LEFT" )->asGrid(), SG_DATATYPE_Byte);
+	Get_CVMatrix(Right, Parameters("RIGHT")->asGrid(), SG_DATATYPE_Byte);
 
-		fs.open(extrinsic_filename, CV_STORAGE_READ);
-		if(!fs.isOpened())
+	switch( Parameters("ALGORITHM")->asInt() )
+	{
+	//-----------------------------------------------------
+	default:
 		{
-			printf("Failed to open file %s\n", extrinsic_filename);
-			return -1;
-		}
-
-		Mat R, T, R1, P1, R2, P2;
-		fs["R"] >> R;
-		fs["T"] >> T;
-
-		stereoRectify( M1, D1, M2, D2, img_size, R, T, R1, R2, P1, P2, Q, CALIB_ZERO_DISPARITY, -1, img_size, &roi1, &roi2 );
+			cv::Ptr<cv::StereoBM>	Algorithm	= cv::StereoBM::create();
 
-		Mat map11, map12, map21, map22;
-		initUndistortRectifyMap(M1, D1, R1, P1, img_size, CV_16SC2, map11, map12);
-		initUndistortRectifyMap(M2, D2, R2, P2, img_size, CV_16SC2, map21, map22);
+			//---------------------------------------------
+			Algorithm->setMinDisparity      (Parameters("DISP_MIN"     )->asInt());
+			Algorithm->setNumDisparities    (Parameters("DISP_NUM"     )->asInt() * 16);
+			Algorithm->setBlockSize         (Parameters("BLOCKSIZE"    )->asInt() * 2 + 1);
+			Algorithm->setDisp12MaxDiff     (Parameters("DIFF_MAX"     )->asInt());
+			Algorithm->setUniquenessRatio   (Parameters("UNIQUENESS"   )->asInt());
+			Algorithm->setSpeckleWindowSize (Parameters("SPECKLE_SIZE" )->asInt());
+			Algorithm->setSpeckleRange      (Parameters("SPECKLE_RANGE")->asInt() * 16);
 
-		Mat img1r, img2r;
-		remap(img1, img1r, map11, map12, INTER_LINEAR);
-		remap(img2, img2r, map21, map22, INTER_LINEAR);
+			//---------------------------------------------
+			cv::Rect	BM_ROIs[2];
 
-		img1 = img1r;
-		img2 = img2r;
-	}
+			Algorithm->setROI1(BM_ROIs[0]);
+			Algorithm->setROI2(BM_ROIs[1]);
 
-	maxDisp = maxDisp > 0 ? maxDisp : ((img_size.width/8) + 15) & -16;
+			Algorithm->setTextureThreshold  (Parameters("BM_TEXTURE"    )->asInt());
+
+			//Algorithm->setSmallerBlockSize  (Parameters("BM_SMALLER"    )->asInt());
 
-	StereoBM	bm;
-	StereoSGBM	sgbm;
+			Algorithm->setPreFilterCap      (Parameters("BM_FILTER_CAP" )->asInt());
+			//Algorithm->setPreFilterSize     (Parameters("BM_FILTER_SIZE")->asInt());
 
-	bm.state->roi1 = roi1;
-	bm.state->roi2 = roi2;
-	bm.state->preFilterCap = 31;
-	bm.state->SADWindowSize = BlockSize > 0 ? BlockSize : 9;
-	bm.state->minDisparity = 0;
-	bm.state->numberOfDisparities = maxDisp;
-	bm.state->textureThreshold = 10;
-	bm.state->uniquenessRatio = 15;
-	bm.state->speckleWindowSize = 100;
-	bm.state->speckleRange = 32;
-	bm.state->disp12MaxDiff = 1;
-
-	sgbm.preFilterCap = 63;
-	sgbm.SADWindowSize = BlockSize > 0 ? BlockSize : 3;
-
-	int cn = img1.channels();
-
-	sgbm.P1 = 8*cn*sgbm.SADWindowSize*sgbm.SADWindowSize;
-	sgbm.P2 = 32*cn*sgbm.SADWindowSize*sgbm.SADWindowSize;
-	sgbm.minDisparity = 0;
-	sgbm.numberOfDisparities = maxDisp;
-	sgbm.uniquenessRatio = 10;
-	sgbm.speckleWindowSize = bm.state->speckleWindowSize;
-	sgbm.speckleRange = bm.state->speckleRange;
-	sgbm.disp12MaxDiff = 1;
-	sgbm.fullDP = Algorithm == STEREO_HH;
-
-	Mat disp, disp8;
-	//Mat img1p, img2p, dispp;
-	//copyMakeBorder(img1, img1p, 0, 0, maxDisp, 0, IPL_BORDER_REPLICATE);
-	//copyMakeBorder(img2, img2p, 0, 0, maxDisp, 0, IPL_BORDER_REPLICATE);
-
-	int64 t = getTickCount();
-
-	switch( Algorithm )
-	{
-	case STEREO_BM:
-		bm(img1, img2, disp);
+			//switch( Parameters("BM_FILTER_TYPE")->asInt() )
+			//{
+			//default: Algorithm->setPreFilterType(cv::StereoBM::PREFILTER_NORMALIZED_RESPONSE); break;
+			//case  1: Algorithm->setPreFilterType(cv::StereoBM::PREFILTER_XSOBEL             ); break;
+			//}
+
+			//---------------------------------------------
+			Algorithm->compute(Left, Right, Disparity);
+		}
 		break;
 
-	case STEREO_SGBM:
-	case STEREO_HH:
-		sgbm(img1, img2, disp);
-		break;
+	//-----------------------------------------------------
+	case  1:
+		{
+			cv::Ptr<cv::StereoSGBM>	Algorithm	= cv::StereoSGBM::create(0, 16, 3);
+
+			//---------------------------------------------
+			Algorithm->setMinDisparity      (Parameters("DISP_MIN"     )->asInt());
+			Algorithm->setNumDisparities    (Parameters("DISP_NUM"     )->asInt() * 16);
+			Algorithm->setBlockSize         (Parameters("BLOCKSIZE"    )->asInt() * 2 + 1);
+			Algorithm->setDisp12MaxDiff     (Parameters("DIFF_MAX"     )->asInt());
+			Algorithm->setUniquenessRatio   (Parameters("UNIQUENESS"   )->asInt());
+			Algorithm->setSpeckleWindowSize (Parameters("SPECKLE_SIZE" )->asInt());
+			Algorithm->setSpeckleRange      (Parameters("SPECKLE_RANGE")->asInt() * 16);
+
+			//---------------------------------------------
+			switch( Parameters("SGBM_MODE")->asInt() )
+			{
+			default: Algorithm->setMode(cv::StereoSGBM::MODE_SGBM     ); break;
+			case  1: Algorithm->setMode(cv::StereoSGBM::MODE_HH       ); break;
+			case  2: Algorithm->setMode(cv::StereoSGBM::MODE_SGBM_3WAY); break;
+			}
+
+			Algorithm->setP1                (Parameters("SGBM_P1")->asInt() * Algorithm->getBlockSize()*Algorithm->getBlockSize());
+			Algorithm->setP2                (Parameters("SGBM_P2")->asInt() * Algorithm->getBlockSize()*Algorithm->getBlockSize());
+
+			Algorithm->setPreFilterCap      (Parameters("SGBM_FILTER_CAP")->asInt());
 
-	case STEREO_VAR:
-		var(img1, img2, disp);
+			//---------------------------------------------
+			Algorithm->compute(Left, Right, Disparity);
+		}
 		break;
 	}
 
-	t = getTickCount() - t;
-	printf("Time elapsed: %fms\n", t*1000/getTickFrequency());
-
-	//disp = dispp.colRange(maxDisp, img1p.cols);
-	if( Algorithm != STEREO_VAR )
-		disp.convertTo(disp8, CV_8U, 255/(maxDisp*16.));
-	else
-		disp.convertTo(disp8, CV_8U);
+	//-----------------------------------------------------
+	Copy_CVMatrix_To_Grid(Parameters("DISPARITY")->asGrid(), &Disparity);
 
-	if(disparity_filename)
-		imwrite(disparity_filename, disp8);
+	//-----------------------------------------------------
+	CSG_PointCloud	*pPoints	= Parameters("POINTS")->asPointCloud();
 
-	if(point_cloud_filename)
+	if( pPoints )
 	{
-		printf("storing the point cloud...");
-		fflush(stdout);
-		Mat xyz;
-		reprojectImageTo3D(disp, xyz, Q, true);
-		saveXYZ(point_cloud_filename, xyz);
-		printf("\n");
-	}
-/**/
-}
+		pPoints->Create();	pPoints->Set_Name(_TL("Points"));
+
+		const double max_z = 1.0e4;
 
+		cv::Mat	Points, Q(4, 4, CV_32F);
 
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
+		cv::reprojectImageTo3D(Disparity, Points, Q, true);
 
-//---------------------------------------------------------
-
-/*using namespace cv;
-static void saveXYZ(const char* filename, const Mat& mat)
-{
-	const double max_z = 1.0e4;
-	FILE* fp = fopen(filename, "wt");
-	for(int y = 0; y < mat.rows; y++)
-	{
-		for(int x = 0; x < mat.cols; x++)
-		{
-			Vec3f point = mat.at<Vec3f>(y, x);
-			if(fabs(point[2] - max_z) < FLT_EPSILON || fabs(point[2]) > max_z) continue;
-			fprintf(fp, "%f %f %f\n", point[0], point[1], point[2]);
-		}
-	}
-	fclose(fp);
-}
+		for(int y=0; y<Points.rows; y++)
+		{
+			for(int x=0; x<Points.cols; x++)
+			{
+				cv::Vec3f	Point	= Points.at<cv::Vec3f>(y, x);
+
+			//	if( fabs(Point[2] - max_z) <  FLT_EPSILON || fabs(Point[2]) >  max_z ) continue;
+				if( fabs(Point[2] - max_z) >= FLT_EPSILON && fabs(Point[2]) <= max_z )
+				{
+					pPoints->Add_Point(Point[0], Point[1], Point[2]);
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	return( true );
+}
 
 
 ///////////////////////////////////////////////////////////
@@ -408,6 +378,7 @@ static void saveXYZ(const char* filename, const Mat& mat)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#endif // CV_MAJOR_VERSION == 2
 
 
 ///////////////////////////////////////////////////////////
@@ -418,6 +389,7 @@ static void saveXYZ(const char* filename, const Mat& mat)
 
 //---------------------------------------------------------
 
+/*/---------------------------------------------------------
 #include "opencv2/calib3d/calib3d.hpp"
 #include "opencv2/imgproc/imgproc.hpp"
 #include "opencv2/highgui/highgui.hpp"
diff --git a/src/modules/imagery/imagery_opencv/opencv_stereo_match.h b/src/modules/imagery/imagery_opencv/opencv_stereo_match.h
index a34c203..bb1ffa5 100755
--- a/src/modules/imagery/imagery_opencv/opencv_stereo_match.h
+++ b/src/modules/imagery/imagery_opencv/opencv_stereo_match.h
@@ -71,6 +71,14 @@
 
 //---------------------------------------------------------
 #include "opencv.h"
+
+#include "opencv2/core/version.hpp"
+
+#if CV_MAJOR_VERSION == 3
+
+#include <opencv2/calib3d.hpp>
+
+using namespace cv;
 
 
 ///////////////////////////////////////////////////////////
@@ -85,13 +93,17 @@ class COpenCV_Stereo_Match : public CSG_Module_Grid
 public:
 	COpenCV_Stereo_Match(void);
 
-	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("A:Garden|Imagery") );	}
+	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Garden|Imagery") );	}
 
 
 protected:
 
-	virtual bool			On_Execute			(void);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
+
 
+private:
 
 };
 
@@ -103,4 +115,20 @@ protected:
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#define new_COpenCV_Stereo_Match	new COpenCV_Stereo_Match
+
+#else // CV_MAJOR_VERSION == 3
+
+#define new_COpenCV_Stereo_Match	MLB_INTERFACE_SKIP_MODULE
+
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #endif // #ifndef HEADER_INCLUDED__opencv_stereo_match_H
diff --git a/src/modules/imagery/imagery_photogrammetry/Colorisation.cpp b/src/modules/imagery/imagery_photogrammetry/Colorisation.cpp
index 97c7c72..0efa30e 100755
--- a/src/modules/imagery/imagery_photogrammetry/Colorisation.cpp
+++ b/src/modules/imagery/imagery_photogrammetry/Colorisation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Colorisation.cpp 1945 2014-01-16 10:00:22Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_photogrammetry/Colorisation.h b/src/modules/imagery/imagery_photogrammetry/Colorisation.h
index 735a357..796c343 100755
--- a/src/modules/imagery/imagery_photogrammetry/Colorisation.h
+++ b/src/modules/imagery/imagery_photogrammetry/Colorisation.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Colorisation.h 1945 2014-01-16 10:00:22Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_photogrammetry/MLB_Interface.cpp b/src/modules/imagery/imagery_photogrammetry/MLB_Interface.cpp
index 7734fae..8973aa2 100755
--- a/src/modules/imagery/imagery_photogrammetry/MLB_Interface.cpp
+++ b/src/modules/imagery/imagery_photogrammetry/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_photogrammetry/MLB_Interface.h b/src/modules/imagery/imagery_photogrammetry/MLB_Interface.h
index 877bae2..fd1f58c 100755
--- a/src/modules/imagery/imagery_photogrammetry/MLB_Interface.h
+++ b/src/modules/imagery/imagery_photogrammetry/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1945 2014-01-16 10:00:22Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_photogrammetry/Makefile.in b/src/modules/imagery/imagery_photogrammetry/Makefile.in
index 1975eba..d7dbe7b 100644
--- a/src/modules/imagery/imagery_photogrammetry/Makefile.in
+++ b/src/modules/imagery/imagery_photogrammetry/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery/imagery_photogrammetry
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -394,7 +414,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_photogrammetry/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_photogrammetry/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -699,6 +718,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/imagery_photogrammetry/Resection.cpp b/src/modules/imagery/imagery_photogrammetry/Resection.cpp
index dc96a4c..038cc7a 100755
--- a/src/modules/imagery/imagery_photogrammetry/Resection.cpp
+++ b/src/modules/imagery/imagery_photogrammetry/Resection.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Resection.cpp 2134 2014-05-29 10:33:16Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_photogrammetry/Resection.h b/src/modules/imagery/imagery_photogrammetry/Resection.h
index b60ca6f..8988726 100755
--- a/src/modules/imagery/imagery_photogrammetry/Resection.h
+++ b/src/modules/imagery/imagery_photogrammetry/Resection.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Resection.h 1945 2014-01-16 10:00:22Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_photogrammetry/methods.cpp b/src/modules/imagery/imagery_photogrammetry/methods.cpp
index 72eccad..1484235 100755
--- a/src/modules/imagery/imagery_photogrammetry/methods.cpp
+++ b/src/modules/imagery/imagery_photogrammetry/methods.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: methods.cpp 1945 2014-01-16 10:00:22Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_photogrammetry/methods.h b/src/modules/imagery/imagery_photogrammetry/methods.h
index 0dd6668..80d0823 100755
--- a/src/modules/imagery/imagery_photogrammetry/methods.h
+++ b/src/modules/imagery/imagery_photogrammetry/methods.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: methods.h 1945 2014-01-16 10:00:22Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_segmentation/Makefile.in b/src/modules/imagery/imagery_segmentation/Makefile.in
index ba75d31..4f06c81 100644
--- a/src/modules/imagery/imagery_segmentation/Makefile.in
+++ b/src/modules/imagery/imagery_segmentation/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery/imagery_segmentation
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -400,7 +420,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_segmentation/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_segmentation/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -706,6 +725,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/imagery_svm/Makefile.in b/src/modules/imagery/imagery_svm/Makefile.in
index 6fb697a..7d59a5a 100644
--- a/src/modules/imagery/imagery_svm/Makefile.in
+++ b/src/modules/imagery/imagery_svm/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery/imagery_svm
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -211,6 +221,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -244,6 +255,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -262,6 +280,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -351,6 +370,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -390,7 +410,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_svm/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_svm/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -694,6 +713,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/imagery_tools/Image_VI_Distance.cpp b/src/modules/imagery/imagery_tools/Image_VI_Distance.cpp
index 77a8b45..b8a8917 100755
--- a/src/modules/imagery/imagery_tools/Image_VI_Distance.cpp
+++ b/src/modules/imagery/imagery_tools/Image_VI_Distance.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Image_VI_Distance.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Image_VI_Distance.cpp
diff --git a/src/modules/imagery/imagery_tools/Image_VI_Distance.h b/src/modules/imagery/imagery_tools/Image_VI_Distance.h
index 54852d3..af51100 100755
--- a/src/modules/imagery/imagery_tools/Image_VI_Distance.h
+++ b/src/modules/imagery/imagery_tools/Image_VI_Distance.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Image_VI_Distance.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Image_VI_Distance.h
diff --git a/src/modules/imagery/imagery_tools/Image_VI_Slope.cpp b/src/modules/imagery/imagery_tools/Image_VI_Slope.cpp
index 18f0d19..a106d6f 100755
--- a/src/modules/imagery/imagery_tools/Image_VI_Slope.cpp
+++ b/src/modules/imagery/imagery_tools/Image_VI_Slope.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Image_VI_Slope.cpp 2786 2016-02-15 14:35:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Image_VI_Slope.cpp
diff --git a/src/modules/imagery/imagery_tools/Image_VI_Slope.h b/src/modules/imagery/imagery_tools/Image_VI_Slope.h
index ab4281a..637fa57 100755
--- a/src/modules/imagery/imagery_tools/Image_VI_Slope.h
+++ b/src/modules/imagery/imagery_tools/Image_VI_Slope.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Image_VI_Slope.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Image_VI_Slope.h
diff --git a/src/modules/imagery/imagery_tools/MLB_Interface.cpp b/src/modules/imagery/imagery_tools/MLB_Interface.cpp
index 2be1912..66c95aa 100755
--- a/src/modules/imagery/imagery_tools/MLB_Interface.cpp
+++ b/src/modules/imagery/imagery_tools/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2326 2014-11-04 14:31:09Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/MLB_Interface.h b/src/modules/imagery/imagery_tools/MLB_Interface.h
index c706fbe..84b8722 100755
--- a/src/modules/imagery/imagery_tools/MLB_Interface.h
+++ b/src/modules/imagery/imagery_tools/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1938 2014-01-12 13:44:06Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/Makefile.in b/src/modules/imagery/imagery_tools/Makefile.in
index ed42077..54a74ac 100644
--- a/src/modules/imagery/imagery_tools/Makefile.in
+++ b/src/modules/imagery/imagery_tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery/imagery_tools
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -407,7 +427,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_tools/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -718,6 +737,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/imagery/imagery_tools/evi.cpp b/src/modules/imagery/imagery_tools/evi.cpp
index ba03c3e..963eb57 100755
--- a/src/modules/imagery/imagery_tools/evi.cpp
+++ b/src/modules/imagery/imagery_tools/evi.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: evi.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/evi.h b/src/modules/imagery/imagery_tools/evi.h
index 766780b..b963564 100755
--- a/src/modules/imagery/imagery_tools/evi.h
+++ b/src/modules/imagery/imagery_tools/evi.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: evi.h 1938 2014-01-12 13:44:06Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/landsat_acca.cpp b/src/modules/imagery/imagery_tools/landsat_acca.cpp
index 65886fa..28512b4 100755
--- a/src/modules/imagery/imagery_tools/landsat_acca.cpp
+++ b/src/modules/imagery/imagery_tools/landsat_acca.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: landsat_acca.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/landsat_acca.h b/src/modules/imagery/imagery_tools/landsat_acca.h
index 9e081a1..bf0cad3 100755
--- a/src/modules/imagery/imagery_tools/landsat_acca.h
+++ b/src/modules/imagery/imagery_tools/landsat_acca.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: landsat_acca.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/landsat_toar.cpp b/src/modules/imagery/imagery_tools/landsat_toar.cpp
index 14617eb..06988d8 100755
--- a/src/modules/imagery/imagery_tools/landsat_toar.cpp
+++ b/src/modules/imagery/imagery_tools/landsat_toar.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: landsat_toar.cpp 2685 2015-11-10 16:12:27Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -89,7 +89,7 @@ enum
 #define PRM_IN(sensor, id)				CSG_String::Format("DN_%s%02d", CSG_String(sensor).c_str(), id)
 #define PRM_OUT(sensor, id)				CSG_String::Format("RF_%s%02d", CSG_String(sensor).c_str(), id)
 #define PRM_ADD_BAND__IN(sensor, id)	Parameters.Add_Grid(pNode, PRM_IN (sensor, id), CSG_String::Format("%s %s %d", _TL("DN")         , _TL("Band"), id), _TL(""), PARAMETER_INPUT_OPTIONAL);
-#define PRM_ADD_BAND_OUT(sensor, id)	Parameters.Add_Grid(pNode, PRM_OUT(sensor, id), CSG_String::Format("%s %s %d", _TL("Reflectance"), _TL("Band"), id), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Byte);
+#define PRM_ADD_BAND_OUT(sensor, id)	Parameters.Add_Grid(pNode, PRM_OUT(sensor, id), CSG_String::Format("%s %s %d", _TL("Reflectance"), _TL("Band"), id), _TL(""), PARAMETER_OUTPUT, true, SG_STR_CMP(sensor, "OLI") ? SG_DATATYPE_Byte : SG_DATATYPE_Word);
 #define PRM_ENABLE_OUTPUT(sensor, id)	pParameters->Set_Enabled(PRM_OUT(sensor, id), pParameters->Get_Parameter(PRM_IN(sensor, id)) && pParameters->Get_Parameter(PRM_IN(sensor, id))->asGrid())
 
 //---------------------------------------------------------
@@ -475,9 +475,11 @@ CSG_Grid * CLandsat_TOAR::Get_Band_Output(int iBand, int Sensor)
 
 		if( pOutput )
 		{
+			TSG_Data_Type	DataType	= Sensor == oli8 ? SG_DATATYPE_Word : SG_DATATYPE_Byte;
+
 			if( !pOutput->asGrid() )
 			{
-				CSG_Grid	*pGrid	= SG_Create_Grid(pInput, SG_DATATYPE_Byte);
+				CSG_Grid	*pGrid	= SG_Create_Grid(pInput, DataType);
 
 				if( pGrid && pGrid->is_Valid() && pGrid->Get_System() == pInput->Get_System() )
 				{
@@ -684,6 +686,8 @@ bool CLandsat_TOAR::On_Execute(void)
 	sAll	+= GET_DESC_FLT(_TL("Solar Height")          , lsat.sun_elev);
 	sAll	+= GET_DESC_STR(_TL("Atmospheric Correction"), Parameters("AC_METHOD")->asString());
 
+	double	MaxVal	= Sensor != oli8 ? 255. : 65535.;
+
 	//-----------------------------------------------------
 	for(iBand=0; iBand<lsat.bands && Process_Get_Okay(); iBand++)
 	{
@@ -699,25 +703,25 @@ bool CLandsat_TOAR::On_Execute(void)
 		if( bRadiance )
 		{
 			pOutput->Set_Name(CSG_String::Format("%s [%s]", pInput->Get_Name(), _TL("Radiance"   )));
-			pOutput->asGrid()->Set_NoData_Value(255.0);
+			pOutput->asGrid()->Set_NoData_Value(MaxVal);
 
 			double	min	= lsat_qcal2rad(pInput->Get_ZMin(), &lsat.band[iBand]);
 			double	max	= lsat_qcal2rad(pInput->Get_ZMax(), &lsat.band[iBand]);
 
-			pOutput->asGrid()->Set_Scaling((max - min) / 254.0, min);
+			pOutput->asGrid()->Set_Scaling((max - min) / (MaxVal - 1.0), min);
 		}
 		else if( lsat.band[iBand].thermal )
 		{
 			pOutput->Set_Name(CSG_String::Format("%s [%s]", pInput->Get_Name(), _TL("Temperature")));
 			pOutput->Set_Unit(_TL("Kelvin"));
-			pOutput->asGrid()->Set_NoData_Value(255.0);
-			pOutput->asGrid()->Set_Scaling(0.5, 200.0);
+			pOutput->asGrid()->Set_NoData_Value(MaxVal);
+			pOutput->asGrid()->Set_Scaling(150.0 / (MaxVal - 1.0), 183.16);	// -90�C to 60�C
 		}
 		else
 		{
 			pOutput->Set_Name(CSG_String::Format("%s [%s]", pInput->Get_Name(), _TL("Reflectance")));
-			pOutput->asGrid()->Set_NoData_Value(255.0);
-			pOutput->asGrid()->Set_Scaling(1.0 / 254.0);
+			pOutput->asGrid()->Set_NoData_Value(MaxVal);
+			pOutput->asGrid()->Set_Scaling(1.0 / (MaxVal - 1.0));
 		}
 
 		//-------------------------------------------------
diff --git a/src/modules/imagery/imagery_tools/landsat_toar.h b/src/modules/imagery/imagery_tools/landsat_toar.h
index 9fe15c5..c7bd8ff 100755
--- a/src/modules/imagery/imagery_tools/landsat_toar.h
+++ b/src/modules/imagery/imagery_tools/landsat_toar.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: landsat_toar.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/pansharpening.cpp b/src/modules/imagery/imagery_tools/pansharpening.cpp
index 572dbff..b037d97 100755
--- a/src/modules/imagery/imagery_tools/pansharpening.cpp
+++ b/src/modules/imagery/imagery_tools/pansharpening.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pansharpening.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/pansharpening.h b/src/modules/imagery/imagery_tools/pansharpening.h
index 2f5f3d4..ec79bda 100755
--- a/src/modules/imagery/imagery_tools/pansharpening.h
+++ b/src/modules/imagery/imagery_tools/pansharpening.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pansharpening.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/tasseled_cap.cpp b/src/modules/imagery/imagery_tools/tasseled_cap.cpp
index ccb6a40..34934e7 100755
--- a/src/modules/imagery/imagery_tools/tasseled_cap.cpp
+++ b/src/modules/imagery/imagery_tools/tasseled_cap.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: tasseled_cap.cpp 1938 2014-01-12 13:44:06Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_tools/tasseled_cap.h b/src/modules/imagery/imagery_tools/tasseled_cap.h
index 714f490..9b7b95d 100755
--- a/src/modules/imagery/imagery_tools/tasseled_cap.h
+++ b/src/modules/imagery/imagery_tools/tasseled_cap.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: tasseled_cap.h 1938 2014-01-12 13:44:06Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/imagery/imagery_vigra/Makefile.in b/src/modules/imagery/imagery_vigra/Makefile.in
index c44b18d..bc3424f 100644
--- a/src/modules/imagery/imagery_vigra/Makefile.in
+++ b/src/modules/imagery/imagery_vigra/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/imagery/imagery_vigra
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -222,6 +232,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -255,6 +266,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -273,6 +291,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -362,6 +381,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -417,7 +437,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/imagery/imagery_vigra/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/imagery/imagery_vigra/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -727,6 +746,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/Makefile.in b/src/modules/io/Makefile.in
index 44a2219..6290424 100644
--- a/src/modules/io/Makefile.in
+++ b/src/modules/io/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -150,6 +161,7 @@ ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = io_esri_e00 io_gdal io_gps io_grid io_shapes \
 	io_shapes_dxf io_shapes_las io_table io_virtual io_grid_image
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -208,6 +220,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -226,6 +245,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -315,6 +335,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -340,7 +361,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -635,6 +655,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_esri_e00/Makefile.in b/src/modules/io/io_esri_e00/Makefile.in
index d9e0d0f..460a022 100644
--- a/src/modules/io/io_esri_e00/Makefile.in
+++ b/src/modules/io/io_esri_e00/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_esri_e00
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -215,6 +225,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -248,6 +259,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -266,6 +284,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -355,6 +374,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -406,7 +426,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_esri_e00/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_esri_e00/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -759,6 +778,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_gdal/Makefile.am b/src/modules/io/io_gdal/Makefile.am
index a029ec5..fb61888 100755
--- a/src/modules/io/io_gdal/Makefile.am
+++ b/src/modules/io/io_gdal/Makefile.am
@@ -5,9 +5,9 @@ if DEBUG
 DBGFLAGS = -g -DDEBUG
 endif
 
-DEP_LIBS = `gdal-config --libs`
+DEP_LIBS = $(GDAL_LDFLAGS)
 DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
-CXX_INCS           = -I$(top_srcdir)/src/saga_core `gdal-config --cflags`
+CXX_INCS           = -I$(top_srcdir)/src/saga_core $(GDAL_CFLAGS) $(GDAL2FLAGS)
 AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
 AM_LDFLAGS         = -fPIC -shared -avoid-version $(DEP_LIBS)
 pkglib_LTLIBRARIES = libio_gdal.la
diff --git a/src/modules/io/io_gdal/Makefile.in b/src/modules/io/io_gdal/Makefile.in
index c2e9510..5d1f7a9 100644
--- a/src/modules/io/io_gdal/Makefile.in
+++ b/src/modules/io/io_gdal/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_gdal
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -367,9 +387,9 @@ top_srcdir = @top_srcdir@
 # $Id: Makefile.am 1465 2012-08-23 09:20:00Z oconrad $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
-DEP_LIBS = `gdal-config --libs`
+DEP_LIBS = $(GDAL_LDFLAGS)
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
-CXX_INCS = -I$(top_srcdir)/src/saga_core `gdal-config --cflags`
+CXX_INCS = -I$(top_srcdir)/src/saga_core $(GDAL_CFLAGS) $(GDAL2FLAGS)
 AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
 AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS)
 pkglib_LTLIBRARIES = libio_gdal.la
@@ -416,7 +436,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_gdal/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_gdal/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -729,6 +748,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_gdal/gdal_driver.cpp b/src/modules/io/io_gdal/gdal_driver.cpp
index 1b9325c..4763ba8 100755
--- a/src/modules/io/io_gdal/gdal_driver.cpp
+++ b/src/modules/io/io_gdal/gdal_driver.cpp
@@ -155,15 +155,25 @@ CSG_String CSG_GDAL_Drivers::Get_Extension(int Index) const
 }
 
 //---------------------------------------------------------
+bool CSG_GDAL_Drivers::is_Raster(int Index) const
+{
+#ifdef USE_GDAL_V2
+	return( Get_Driver(Index) && CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_RASTER, false) );
+#else
+	return( true );
+#endif
+}
+
+//---------------------------------------------------------
 bool CSG_GDAL_Drivers::Can_Read(int Index) const
 {
-	return( Index >= 0 && Index < Get_Count() );	// ? CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_CREATE, false) != 0 : false );
+	return( Get_Driver(Index) != NULL );	// ? CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_CREATE, false) != 0 : false );
 }
 
 //---------------------------------------------------------
 bool CSG_GDAL_Drivers::Can_Write(int Index) const
 {
-	return( Index >= 0 && Index < Get_Count() ? CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_CREATE, false) != 0 : false );
+	return( Get_Driver(Index) && CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_CREATE, false) );
 }
 
 
diff --git a/src/modules/io/io_gdal/gdal_driver.h b/src/modules/io/io_gdal/gdal_driver.h
index 530a84b..25d2680 100755
--- a/src/modules/io/io_gdal/gdal_driver.h
+++ b/src/modules/io/io_gdal/gdal_driver.h
@@ -88,6 +88,8 @@ public:
 	CSG_String					Get_Description		(int Index)					const;
 	CSG_String					Get_Extension		(int Index)					const;
 
+	bool						is_Raster			(int Index)					const;
+
 	bool						Can_Read			(int Index)					const;
 	bool						Can_Write			(int Index)					const;
 
diff --git a/src/modules/io/io_gdal/gdal_export.cpp b/src/modules/io/io_gdal/gdal_export.cpp
index 72e865c..55841b4 100755
--- a/src/modules/io/io_gdal/gdal_export.cpp
+++ b/src/modules/io/io_gdal/gdal_export.cpp
@@ -74,7 +74,7 @@ CGDAL_Export::CGDAL_Export(void)
 
 	Set_Author	("O.Conrad (c) 2007");
 
-	CSG_String	Description, Formats;
+	CSG_String	Description, Formats, Filter;
 
 	Description	= _TW(
 		"The \"GDAL Raster Export\" module exports one or more grids to various file formats using the "
@@ -84,57 +84,63 @@ CGDAL_Export::CGDAL_Export(void)
 		"  http://www.gdal.org</a>\n"
 	);
 
-	Description	+= CSG_String::Format(SG_T("\nGDAL %s:%s\n\n"), _TL("Version"), SG_Get_GDAL_Drivers().Get_Version().c_str());
+	Description	+= CSG_String::Format("\nGDAL %s:%s\n\n", _TL("Version"), SG_Get_GDAL_Drivers().Get_Version().c_str());
 
-	Description	+= _TW(
-		"Following raster formats are currently supported:\n"
-		"<table border=\"1\"><tr><th>ID</th><th>Name</th></tr>\n"
+	Description	+= _TL("Following raster formats are currently supported:");
+
+	Description	+= CSG_String::Format("\n<table border=\"1\"><tr><th>%s</th><th>%s</th><th>%s</th></tr>\n",
+		_TL("ID"), _TL("Name"), _TL("Extension")
 	);
 
+	Filter.Printf("%s|*.*", _TL("All Files"));
+
 	for(int i=0; i<SG_Get_GDAL_Drivers().Get_Count(); i++)
     {
-		if( SG_Get_GDAL_Drivers().Can_Write(i) )
+		if( SG_Get_GDAL_Drivers().is_Raster(i) && SG_Get_GDAL_Drivers().Can_Write(i) )
 		{
-			Description	+= CSG_String::Format(SG_T("<tr><td>%s</td><td>%s</td></tr>\n"),
-				SG_Get_GDAL_Drivers().Get_Description(i).c_str(),
-				SG_Get_GDAL_Drivers().Get_Name       (i).c_str()
-			);
-
-			Formats		+= CSG_String::Format(SG_T("{%s}%s|"),
-				SG_Get_GDAL_Drivers().Get_Description(i).c_str(),
-				SG_Get_GDAL_Drivers().Get_Name       (i).c_str()
-			);
+			CSG_String	ID		= SG_Get_GDAL_Drivers().Get_Description(i).c_str();
+			CSG_String	Name	= SG_Get_GDAL_Drivers().Get_Name       (i).c_str();
+			CSG_String	Ext		= SG_Get_GDAL_Drivers().Get_Extension  (i).c_str();
+
+			Description	+= "<tr><td>" + ID + "</td><td>" + Name + "</td><td>" + Ext + "</td></tr>";
+			Formats		+= "{" + ID + "}" + Name + "|";
+
+			if( !Ext.is_Empty() )
+			{
+				Ext.Replace("/", ";");
+
+				Filter	+= "|" + Name + "|*." + Ext;
+			}
 		}
     }
 
-	Description	+= SG_T("</table>");
+	Description	+= "</table>";
 
 	Set_Description(Description);
 
 	//-----------------------------------------------------
 	Parameters.Add_Grid_List(
-		NULL, "GRIDS"	, _TL("Grid(s)"),
-		_TL("The SAGA grids to be exported."),
+		NULL	, "GRIDS"		, _TL("Grid(s)"),
+		_TL(""),
 		PARAMETER_INPUT
 	);
 
 	Parameters.Add_FilePath(
-		NULL, "FILE"	, _TL("File"),
+		NULL	, "FILE"		, _TL("File"),
 		_TL("The GDAL dataset to be created."),
-		NULL, NULL, true
+		Filter, NULL, true
 	);
 
 	Parameters.Add_Choice(
-		NULL, "FORMAT"	, _TL("Format"),
+		NULL	, "FORMAT"		, _TL("Format"),
 		_TL("The GDAL raster format (driver) to be used."),
 		Formats
 	);
 
 	Parameters.Add_Choice(
-		NULL, "TYPE"	, _TL("Data Type"),
+		NULL	, "TYPE"		, _TL("Data Type"),
 		_TL("The GDAL datatype of the created dataset."),
-
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"),
+		CSG_String::Format("%s|%s|%s|%s|%s|%s|%s|%s|",
 			_TL("match input data"),
 			_TL("8 bit unsigned integer"),
 			_TL("16 bit unsigned integer"),
@@ -146,22 +152,21 @@ CGDAL_Export::CGDAL_Export(void)
 		), 0
 	);
 	
-	Parameters.Add_Value(
-		NULL, "SET_NODATA"		, _TL("Set Custom NoData"),
+	Parameters.Add_Bool(
+		NULL	, "SET_NODATA"	, _TL("Set Custom NoData"),
 		_TL(""),
-		PARAMETER_TYPE_Bool, 0.0
+		false
 	);
 
-	Parameters.Add_Value(
-		NULL, "NODATA"		, _TL("NoData Value"),
+	Parameters.Add_Double(
+		NULL	, "NODATA"		, _TL("NoData Value"),
 		_TL(""),
 		PARAMETER_TYPE_Double, 0.0
 	);
 
 	Parameters.Add_String(
-		NULL, "OPTIONS"	, _TL("Creation Options"),
-		_TL("A space separated list of key-value pairs (K=V)."), _TL("")
-		
+		NULL	, "OPTIONS"		, _TL("Creation Options"),
+		_TL("A space separated list of key-value pairs (K=V)."), _TL("")		
 	);
 }
 
diff --git a/src/modules/io/io_gdal/gdal_import.cpp b/src/modules/io/io_gdal/gdal_import.cpp
index 8edb21a..9939cba 100755
--- a/src/modules/io/io_gdal/gdal_import.cpp
+++ b/src/modules/io/io_gdal/gdal_import.cpp
@@ -76,7 +76,7 @@ CGDAL_Import::CGDAL_Import(void)
 
 	Set_Author	("O.Conrad (c) 2007 (A.Ringeler)");
 
-	CSG_String	Description;
+	CSG_String	Description, Filter, Filter_All;
 
 	Description	= _TW(
 		"The \"GDAL Raster Import\" module imports grid data from various file formats using the "
@@ -88,23 +88,39 @@ CGDAL_Import::CGDAL_Import(void)
 
 	Description	+= CSG_String::Format("\nGDAL %s:%s\n\n", _TL("Version"), SG_Get_GDAL_Drivers().Get_Version().c_str());
 
-	Description	+= _TW(
-		"Following raster formats are currently supported:\n"
-		"<table border=\"1\"><tr><th>ID</th><th>Name</th></tr>\n"
+	Description	+= _TL("Following raster formats are currently supported:");
+
+	Description	+= CSG_String::Format("\n<table border=\"1\"><tr><th>%s</th><th>%s</th><th>%s</th></tr>",
+		_TL("ID"), _TL("Name"), _TL("Extension")
 	);
 
 	for(int i=0; i<SG_Get_GDAL_Drivers().Get_Count(); i++)
     {
-		Description	+= CSG_String::Format("<tr><td>%s</td><td>%s</td></tr>\n",
-			SG_Get_GDAL_Drivers().Get_Description(i).c_str(),
-			SG_Get_GDAL_Drivers().Get_Name       (i).c_str()
-		);
+		if( SG_Get_GDAL_Drivers().is_Raster(i) && SG_Get_GDAL_Drivers().Can_Read(i) )
+		{
+			CSG_String	ID		= SG_Get_GDAL_Drivers().Get_Description(i).c_str();
+			CSG_String	Name	= SG_Get_GDAL_Drivers().Get_Name       (i).c_str();
+			CSG_String	Ext		= SG_Get_GDAL_Drivers().Get_Extension  (i).c_str();
+
+			Description	+= "<tr><td>" + ID + "</td><td>" + Name + "</td><td>" + Ext + "</td></tr>";
+
+			if( !Ext.is_Empty() )
+			{
+				Ext.Replace("/", ";");
+
+				Filter		+= Name + "|*." + Ext + "|";
+				Filter_All	+= (Filter_All.is_Empty() ? "*." : ";*.") + Ext;
+			}
+		}
     }
 
 	Description	+= "</table>";
 
 	Set_Description(Description);
 
+	Filter.Prepend(CSG_String::Format("%s|%s|" , _TL("All Recognized Files"), Filter_All.c_str()));
+	Filter.Append (CSG_String::Format("%s|*.*" , _TL("All Files")));
+
 	//-----------------------------------------------------
 	Parameters.Add_Grid_List(
 		NULL	, "GRIDS"		, _TL("Grids"),
@@ -115,21 +131,35 @@ CGDAL_Import::CGDAL_Import(void)
 	Parameters.Add_FilePath(
 		NULL	, "FILES"		, _TL("Files"),
 		_TL(""),
-		NULL, NULL, false, false, true
+		Filter, NULL, false, false, true
 	);
 
 	//-----------------------------------------------------
-	Parameters.Add_Value(
+	Parameters.Add_String(
+		NULL	, "SELECTION"	, _TL("Select from Multiple Bands"),
+		_TL("Semicolon separated list of band indexes. Do not set to select all bands for import."),
+		""
+	)->Set_UseInGUI(false);
+
+	Parameters.Add_Bool(
 		NULL	, "SELECT"		, _TL("Select from Multiple Bands"),
 		_TL(""),
-		PARAMETER_TYPE_Bool, true
+		true
 	)->Set_UseInCMD(false);
 
+	pNode	= SG_UI_Get_Window_Main() ? Parameters("SELECT") : NULL;
+
+	Parameters.Add_Bool(
+		pNode	, "SELECT_SORT"	, _TL("Alphanumeric Sorting"),
+		_TL(""),
+		true
+	);
+
 	//-----------------------------------------------------
-	pNode	= Parameters.Add_Value(
+	pNode	= Parameters.Add_Bool(
 		NULL	, "TRANSFORM"	, _TL("Transformation"),
 		_TL("align grid to coordinate system"),
-		PARAMETER_TYPE_Bool, true
+		true
 	);
 
 	Parameters.Add_Choice(
@@ -142,9 +172,6 @@ CGDAL_Import::CGDAL_Import(void)
 			_TL("B-Spline Interpolation")
 		), 3
 	);
-
-	//-----------------------------------------------------
-	Add_Parameters("SELECTION", _TL("Select from Multiple Bands"), _TL(""));
 }
 
 
@@ -157,16 +184,34 @@ int CGDAL_Import::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Paramete
 {
 	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "TRANSFORM") )
 	{
-		pParameters->Get_Parameter("RESAMPLING")->Set_Enabled(pParameter->asBool());
+		pParameters->Set_Enabled("RESAMPLING" , pParameter->asBool());
 	}
 
-	if( !SG_STR_CMP(pParameters->Get_Identifier(), "SELECTION")
-	&&  !SG_STR_CMP(pParameter ->Get_Identifier(), "ALL") && pParameters->Get_Parameter("BANDS") )
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "SELECT") )
 	{
-		pParameters->Get_Parameter("BANDS")->Set_Enabled(!pParameter->asBool());
+		pParameters->Set_Enabled("SELECT_SORT", pParameter->asBool());
 	}
 
-	return( 1 );
+	return( CSG_Module::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
+int CGDAL_Import::On_Selection_Changed(CSG_Parameter *pParameter, int Flags)
+{
+	if( pParameter && pParameter->Get_Owner() && pParameter->Get_Owner()->Get_Owner() )
+	{
+		if( Flags & PARAMETER_CHECK_ENABLE )
+		{
+			if( !SG_STR_CMP(pParameter->Get_Identifier(), "ALL") )
+			{
+				pParameter->Get_Owner()->Set_Enabled("BANDS", pParameter->asBool() == false);
+			}
+		}
+
+		return( 1 );
+	}
+
+	return( 0 );
 }
 
 
@@ -177,33 +222,27 @@ int CGDAL_Import::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Paramete
 //---------------------------------------------------------
 bool CGDAL_Import::On_Execute(void)
 {
-	CSG_Strings			Files;
-	CSG_GDAL_DataSet	DataSet;
+	CSG_Strings	Files;
 
-	//-----------------------------------------------------
 	if( !Parameters("FILES")->asFilePath()->Get_FilePaths(Files) )
 	{
 		return( false );
 	}
 
 	//-----------------------------------------------------
-	m_pGrids	= Parameters("GRIDS")->asGridList();
-	m_pGrids	->Del_Items();
+	(m_pGrids = Parameters("GRIDS")->asGridList())->Del_Items();
 
 	for(int i=0; i<Files.Get_Count(); i++)
 	{
 		Message_Add(CSG_String::Format("\n%s: %s", _TL("loading"), Files[i].c_str()), false);
 
-		if( DataSet.Open_Read(Files[i]) == false )
+		if( Load(Files[i]) == false )
 		{
 			Message_Add(_TL("failed: could not find a suitable import driver"));
 		}
-		else
-		{
-			Load(DataSet, SG_File_Get_Name(Files[i], false));
-		}
 	}
 
+	//-----------------------------------------------------
 	return( m_pGrids->Get_Count() > 0 );
 }
 
@@ -213,131 +252,87 @@ bool CGDAL_Import::On_Execute(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CGDAL_Import::Load_Sub(CSG_GDAL_DataSet &DataSet)
+bool CGDAL_Import::Load(const CSG_String &File)
 {
-	CSG_MetaData	MetaData;
+	//-----------------------------------------------------
+	CSG_GDAL_DataSet	DataSet;
 
-	if( !DataSet.Get_MetaData(MetaData, "SUBDATASETS") )
+	if( DataSet.Open_Read(File) == false )
 	{
 		return( false );
 	}
 
 	//-----------------------------------------------------
-	int				i, n;
-	CSG_Parameters	P;
-
-	for(i=0, n=0; i==n; i++)
-	{
-		CSG_MetaData	*pName	= MetaData.Get_Child(CSG_String::Format("SUBDATASET_%d_NAME", i + 1));
-		CSG_MetaData	*pDesc	= MetaData.Get_Child(CSG_String::Format("SUBDATASET_%d_DESC", i + 1));
-
-		if( pName )
-		{
-			n++;
-
-			Message_Add(CSG_String::Format("\n%s", pName->Get_Content().c_str()), false);
-
-			P.Add_Value(NULL, pName->Get_Content(), pDesc ? pDesc->Get_Content().c_str() : _TL("unnamed"), SG_T(""), PARAMETER_TYPE_Bool, SG_UI_Get_Window_Main() == NULL);
-		}
-	}
-
-	if( SG_UI_Get_Window_Main() && !Dlg_Parameters(&P, _TL("Select from Subdatasets...")) )	// with gui
+	if( DataSet.Get_Count() < 1 )
 	{
-		return( false );
+		return( Load_Subset(DataSet) );
 	}
 
 	//-----------------------------------------------------
-	for(i=0, n=0; i<P.Get_Count() && Process_Get_Okay(false); i++)
+	CSG_Table	Bands;	Bands.Add_Field("NAME", SG_DATATYPE_String);
+
 	{
-		if( P(i)->asBool() && DataSet.Open_Read(P(i)->Get_Identifier()) && Load(DataSet, P(i)->Get_Name()) )
+		for(int i=0; i<DataSet.Get_Count(); i++)
 		{
-			n++;
+			Bands.Add_Record()->Set_Value(0, DataSet.Get_Name(i));
 		}
 	}
 
-	//---------------------------------------------
-	return( n > 0 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CGDAL_Import::Load(CSG_GDAL_DataSet &DataSet, const CSG_String &Name)
-{
-	if( !DataSet.is_Reading() )
-	{
-		return( false );
-	}
-
-	//-----------------------------------------------------
-	if( DataSet.Get_Count() <= 0 )
+	if( Parameters("SELECT_SORT")->asBool() )
 	{
-		return( Load_Sub(DataSet) );
+		Bands.Set_Index(0, TABLE_INDEX_Ascending);
 	}
 
 	//-----------------------------------------------------
-	CSG_Vector	A;
-	CSG_Matrix	B;
-
-	DataSet.Get_Transformation(A, B);
-
-	Message_Add("\n", false);
-	Message_Add(CSG_String::Format("\n%s: %s", _TL("Driver" ), DataSet.Get_DriverID().c_str()   ), false);
-	Message_Add(CSG_String::Format("\n%s: %d", _TL("Bands"  ), DataSet.Get_Count()              ), false);
-	Message_Add(CSG_String::Format("\n%s: %d", _TL("Rows"   ), DataSet.Get_NX()                 ), false);
-	Message_Add(CSG_String::Format("\n%s: %d", _TL("Columns"), DataSet.Get_NY()                 ), false);
-	Message_Add("\n", false);
-	Message_Add(CSG_String::Format("\n%s:", _TL("Transformation")                               ), false);
-	Message_Add(CSG_String::Format("\n  x' = %.6f + x * %.6f + y * %.6f", A[0], B[0][0], B[0][1]), false);
-	Message_Add(CSG_String::Format("\n  y' = %.6f + x * %.6f + y * %.6f", A[1], B[1][0], B[1][1]), false);
-	Message_Add("\n", false);
-
-	//-----------------------------------------------------
-	int			i, n;
-	CSG_Table	Bands;
-
-	Bands.Add_Field("NAME", SG_DATATYPE_String);
-
-	for(i=0; i<DataSet.Get_Count(); i++)
+	if( DataSet.Get_Count() > 1 )
 	{
-		Bands.Add_Record()->Set_Value(0, DataSet.Get_Name(i));
-	}
-
-	Bands.Set_Index(0, TABLE_INDEX_Ascending);
+		if( !SG_UI_Get_Window_Main() )
+		{
+			CSG_String_Tokenizer	Indexes(Parameters("SELECTION")->asString(), ";,");
+
+			while( Indexes.Has_More_Tokens() )
+			{
+				int	i;
+
+				if( Indexes.Get_Next_Token().asInt(i) && i >= 0 && i < Bands.Get_Count() )
+				{
+					Bands.Select(Bands[i].Get_Index(), true);
+				}
+			}
+		}
+		else if( Parameters("SELECT")->asBool() )
+		{
+			CSG_Parameters	Selection(this, _TL("Select from Multiple Bands"), _TL(""), SG_T("SELECTION"));
 
-	//-----------------------------------------------------
-	if( Parameters("SELECT") && Parameters("SELECT")->asBool() && DataSet.Get_Count() > 1 )
-	{
-		CSG_Parameters	*pSelection	= Get_Parameters("SELECTION");
-		pSelection->Add_Value(NULL, "ALL", _TL("Load all bands"), _TL(""), PARAMETER_TYPE_Bool, false);
-		CSG_Parameter	*pNode	= pSelection->Add_Node(NULL, "BANDS", _TL("Bands"), _TL(""));
+			Selection.Set_Callback_On_Parameter_Changed(&On_Selection_Changed);
 
-		for(i=0; i<Bands.Get_Count(); i++)
-		{
-			CSG_Table_Record	*pBand	= Bands.Get_Record_byIndex(i);
+			Selection.Add_Bool(NULL, "ALL"  , _TL("Load all bands"), _TL(""), false);
+			Selection.Add_Node(NULL, "BANDS", _TL("Bands"         ), _TL(""));
 
-			pSelection->Add_Value(pNode, SG_Get_String(i, 0), pBand->asString(0), _TL(""), PARAMETER_TYPE_Bool, false);
-		}
+			for(int i=0; i<Bands.Get_Count(); i++)
+			{
+				Selection.Add_Bool(Selection(1), SG_Get_String(i, 0), Bands[i].asString(0), CSG_String::Format("%s: %d\n%s: %d\n%s: %s",
+					_TL("List Order"), i,
+					_TL("Index"     ), Bands[i].Get_Index(),
+					_TL("Name"      ), Bands[i].asString(0)), false
+				);
+			}
 
-		if( Dlg_Parameters("SELECTION") )
-		{
-			for(i=0; i<Bands.Get_Count(); i++)
+			if( Dlg_Parameters(&Selection, _TL("Select from Multiple Bands")) )
 			{
-				if( pSelection->Get_Parameter(0)->asBool() || pSelection->Get_Parameter(i + 2)->asBool() )
+				for(int i=0; i<Bands.Get_Count(); i++)
 				{
-					Bands.Select(Bands.Get_Record_byIndex(i)->Get_Index(), true);
+					if( Selection(0)->asBool() || Selection(i + 2)->asBool() )
+					{
+						Bands.Select(Bands[i].Get_Index(), true);
+					}
 				}
 			}
-		}
-
-		pSelection->Del_Parameters();
 
-		if( Bands.Get_Selection_Count() <= 0 )
-		{
-			return( false );
+			if( Bands.Get_Selection_Count() <= 0 )
+			{
+				return( false );
+			}
 		}
 	}
 
@@ -352,84 +347,120 @@ bool CGDAL_Import::Load(CSG_GDAL_DataSet &DataSet, const CSG_String &Name)
 	case  3:	Resampling	= GRID_RESAMPLING_BSpline;			break;
 	}
 
+	CSG_Vector	A;	CSG_Matrix	B;	DataSet.Get_Transformation(A, B);
+
 	bool	bTransform	= Parameters("TRANSFORM")->asBool() && DataSet.Needs_Transformation();
 
 	//-----------------------------------------------------
-	for(i=0, n=0; i<DataSet.Get_Count() && Process_Get_Okay(); i++)
+	Message_Add("\n", false);
+	Message_Add(CSG_String::Format("\n%s: %s", _TL("Driver" ), DataSet.Get_DriverID().c_str()), false);
+	Message_Add(CSG_String::Format("\n%s: %d", _TL("Bands"  ), DataSet.Get_Count   ()        ), false);
+	Message_Add(CSG_String::Format("\n%s: %d", _TL("Rows"   ), DataSet.Get_NX      ()        ), false);
+	Message_Add(CSG_String::Format("\n%s: %d", _TL("Columns"), DataSet.Get_NY      ()        ), false);
+	Message_Add("\n", false);
+
+	if( DataSet.Needs_Transformation() )
 	{
-		CSG_Table_Record	*pBand	= Bands.Get_Record_byIndex(i);
+		Message_Add(CSG_String::Format("\n%s:", _TL("Transformation")                               ), false);
+		Message_Add(CSG_String::Format("\n  x' = %.6f + x * %.6f + y * %.6f", A[0], B[0][0], B[0][1]), false);
+		Message_Add(CSG_String::Format("\n  y' = %.6f + x * %.6f + y * %.6f", A[1], B[1][0], B[1][1]), false);
+		Message_Add("\n", false);
+	}
 
-		if( !Bands.Get_Selection_Count() || pBand->is_Selected() )
+	//-----------------------------------------------------
+	for(int i=0; i<DataSet.Get_Count() && Process_Get_Okay(); i++)
+	{
+		if( !Bands.Get_Selection_Count() || Bands[i].is_Selected() )
 		{
-			Process_Set_Text(CSG_String::Format("%s [%d/%d]", _TL("loading band"), i + 1, DataSet.Get_Count()));
+			CSG_String	Message	= "%s: " + SG_File_Get_Name(File, false);	if( DataSet.Get_Count() > 1 )	Message	+= CSG_String::Format(" [%d/%d]", i + 1, DataSet.Get_Count());
 
-			CSG_Grid	*pGrid	= DataSet.Read(pBand->Get_Index());
+			Process_Set_Text(CSG_String::Format(Message.c_str(), _TL("loading")));
+
+			CSG_Grid	*pGrid	= DataSet.Read(Bands[i].Get_Index());
 
 			if( pGrid != NULL )
 			{
-				n++;
-
 				if( bTransform )
 				{
-					Process_Set_Text(CSG_String::Format("%s [%d/%d]", _TL("band transformation"), i + 1, DataSet.Get_Count()));
+					Process_Set_Text(CSG_String::Format(Message.c_str(), _TL("translation")));
 
 					DataSet.Get_Transformation(&pGrid, Resampling, true);
 				}
 
-				pGrid->Set_Name(DataSet.Get_Count() > 1
-					? CSG_String::Format("%s [%s]", Name.c_str(), pGrid->Get_Name()).c_str()
-					: Name.c_str()
-				);
-
+				pGrid->Get_MetaData().Add_Child("GDAL_DRIVER", DataSet.Get_DriverID());
 				pGrid->Set_File_Name(DataSet.Get_File_Name());
+				pGrid->Set_Name(SG_File_Get_Name(File, false) + (DataSet.Get_Count() == 1 ? CSG_String("") : CSG_String::Format(" [%s]", Bands[i].asString(0))));
+				pGrid->Set_Description(DataSet.Get_Description(Bands[i].Get_Index()));
 
 				m_pGrids->Add_Item(pGrid);
 
 				DataObject_Add       (pGrid);
 				DataObject_Set_Colors(pGrid, CSG_Colors(11, SG_COLORS_RAINBOW, false));
-
-				if( DataSet.Get_Count() == 1 )
-				{
-					pGrid->Set_File_Name(DataSet.Get_File_Name());
-					pGrid->Get_MetaData().Add_Child("GDAL_DRIVER", DataSet.Get_DriverID());
-				}
 			}
 		}
     }
 
 	//-----------------------------------------------------
-	return( n > 0 );
+	return( true );
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool	SG_GDAL_Import	(const CSG_String &File_Name)
+bool CGDAL_Import::Load_Subset(CSG_GDAL_DataSet &DataSet)
 {
-	CGDAL_Import	Import;
+	CSG_MetaData	MetaData;
 
-	if(	!Import.Get_Parameters()->Set_Parameter("FILES", File_Name, PARAMETER_TYPE_FilePath) )
+	if( !DataSet.Get_MetaData(MetaData, "SUBDATASETS") )
 	{
 		return( false );
 	}
 
-	if(	!Import.Execute() )
+	//-----------------------------------------------------
+	int		i;
+
+	CSG_Parameters	Subsets;
+
+	for(i=0; ; i++)
 	{
-		return( false );
+		CSG_String	ID	= CSG_String::Format("SUBDATASET_%d_", i + 1);
+
+		if( MetaData(ID + "NAME") )
+		{
+			Subsets.Add_Bool(NULL,
+				MetaData.Get_Content(ID + "NAME"),
+				MetaData.Get_Content(ID + "DESC"),
+				"", SG_UI_Get_Window_Main() == NULL
+			);
+		}
+		else
+		{
+			break;
+		}
 	}
 
-	CSG_Parameter_Grid_List	*pGrids	= Import.Get_Parameters()->Get_Parameter("GRIDS")->asGridList();
+	//-----------------------------------------------------
+	if( SG_UI_Get_Window_Main() && !Dlg_Parameters(&Subsets, _TL("Select from Subdatasets...")) )	// with gui
+	{
+		return( false );
+	}
 
-	for(int i=0; i<pGrids->Get_Count(); i++)
+	//-----------------------------------------------------
+	for(i=0; i<Subsets.Get_Count() && Process_Get_Okay(false); i++)
 	{
-		SG_UI_DataObject_Add(pGrids->asGrid(i), SG_UI_DATAOBJECT_UPDATE_ONLY);
+		if( Subsets(i)->asBool() )
+		{
+			if( Load(Subsets(i)->Get_Identifier()) == false )
+			{
+				Error_Fmt("%s: %s", _TL("failed to import subset"), Subsets(i)->Get_Name());
+			}
+		}
 	}
 
+	//-----------------------------------------------------
 	return( true );
 }
 
diff --git a/src/modules/io/io_gdal/gdal_import.h b/src/modules/io/io_gdal/gdal_import.h
index 6647140..ce6fb43 100755
--- a/src/modules/io/io_gdal/gdal_import.h
+++ b/src/modules/io/io_gdal/gdal_import.h
@@ -60,6 +60,13 @@
 #ifndef HEADER_INCLUDED__gdal_import_H
 #define HEADER_INCLUDED__gdal_import_H
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #include "gdal_driver.h"
 
@@ -71,7 +78,7 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class io_gdal_EXPORT CGDAL_Import : public CSG_Module
+class CGDAL_Import : public CSG_Module
 {
 public:
 	CGDAL_Import(void);
@@ -81,28 +88,22 @@ public:
 
 protected:
 
-	virtual bool				On_Execute				(void);
-
 	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 
+	virtual bool				On_Execute				(void);
+
 
 private:
 
 	CSG_Parameter_Grid_List		*m_pGrids;
 
 
-	bool						Load_Sub				(CSG_GDAL_DataSet &DataSet);
-	bool						Load					(CSG_GDAL_DataSet &DataSet, const CSG_String &Name);
-
-};
+	static int					On_Selection_Changed	(CSG_Parameter *pParameter, int Flags);
 
+	bool						Load					(const CSG_String &File);
+	bool						Load_Subset				(CSG_GDAL_DataSet &DataSet);
 
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-io_gdal_EXPORT	bool	SG_GDAL_Import	(const CSG_String &File_Name);
+};
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_gdal/gdal_import_wms.cpp b/src/modules/io/io_gdal/gdal_import_wms.cpp
index 36f22c6..1156741 100755
--- a/src/modules/io/io_gdal/gdal_import_wms.cpp
+++ b/src/modules/io/io_gdal/gdal_import_wms.cpp
@@ -510,12 +510,12 @@ bool CGDAL_Import_WMS::Get_Bands(CSG_Grid *pBands[3], const CSG_Grid_System &Sys
 //---------------------------------------------------------
 CSG_String CGDAL_Import_WMS::Get_Request(void)
 {
-	CSG_String	Server, Projection	= "EPSG:900913";
+	CSG_String	Server, Projection	= "EPSG:3857";
 
 	switch( Parameters("SERVER")->asInt() )
 	{
-	default:	Server	= "tile.openstreetmap.org/${z}/${x}/${y}.png"                          ; Projection = "EPSG:3857";	break;	// Open Street Map
-	case  1:	Server	= "otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png"                ; Projection = "EPSG:3857";	break;	// MapQuest
+	default:	Server	= "tile.openstreetmap.org/${z}/${x}/${y}.png"                                                    ;	break;	// Open Street Map
+	case  1:	Server	= "otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png"                                          ;	break;	// MapQuest
 	case  2:	Server	= "mt.google.com/vt/lyrs=m&x=${x}&y=${y}&z=${z}"                                                 ;	break;	// Google Map
 	case  3:	Server	= "mt.google.com/vt/lyrs=s&x=${x}&y=${y}&z=${z}"                                                 ;	break;	// Google Satellite
 	case  4:	Server	= "mt.google.com/vt/lyrs=y&x=${x}&y=${y}&z=${z}"                                                 ;	break;	// Google Hybrid
diff --git a/src/modules/io/io_gdal/ogr_driver.cpp b/src/modules/io/io_gdal/ogr_driver.cpp
index 69c9abd..6e5ebbe 100755
--- a/src/modules/io/io_gdal/ogr_driver.cpp
+++ b/src/modules/io/io_gdal/ogr_driver.cpp
@@ -114,6 +114,12 @@ CSG_OGR_Drivers::~CSG_OGR_Drivers(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+CSG_String CSG_OGR_Drivers::Get_Version(void) const
+{
+	return( GDALVersionInfo("RELEASE_NAME") );
+}
+
+//---------------------------------------------------------
 int CSG_OGR_Drivers::Get_Count(void) const
 {
 	return( m_pDrivers->GetDriverCount() );
@@ -143,6 +149,30 @@ CSG_String CSG_OGR_Drivers::Get_Description(int Index) const
 	return( m_pDrivers->GetDriver(Index)->GetDescription() );
 }
 
+//---------------------------------------------------------
+CSG_String CSG_OGR_Drivers::Get_Extension(int Index) const
+{
+	return( Get_Driver(Index)->GetMetadataItem(GDAL_DMD_EXTENSION) );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_Drivers::is_Vector(int Index) const
+{
+	return( Get_Driver(Index) && CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_VECTOR, false) );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_Drivers::Can_Read(int Index) const
+{
+	return( Get_Driver(Index) != NULL );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_Drivers::Can_Write(int Index) const
+{
+	return( Get_Driver(Index) && CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_CREATE, false) );
+}
+
 #else
 //---------------------------------------------------------
 OGRSFDriver * CSG_OGR_Drivers::Get_Driver(int Index) const
@@ -195,7 +225,17 @@ CSG_String CSG_OGR_Drivers::Get_Description(int Index) const
 	return( s );
 }
 
-#endif
+//---------------------------------------------------------
+CSG_String CSG_OGR_Drivers::Get_Extension(int Index) const
+{
+	return( "" );
+}
+
+//---------------------------------------------------------
+bool CSG_OGR_Drivers::is_Vector(int Index) const
+{
+	return( true );
+}
 
 //---------------------------------------------------------
 bool CSG_OGR_Drivers::Can_Read(int Index) const
@@ -206,9 +246,11 @@ bool CSG_OGR_Drivers::Can_Read(int Index) const
 //---------------------------------------------------------
 bool CSG_OGR_Drivers::Can_Write(int Index) const
 {
-	return( Get_Driver(Index) != NULL );//&& Get_Driver(Index)->TestCapability(ODrCCreateDataSource) );
+	return( Get_Driver(Index) );
 }
 
+#endif // #ifndef USE_GDAL_V2
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -347,36 +389,36 @@ int CSG_OGR_Drivers::Get_Data_Type(TSG_Data_Type Type)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CSG_OGR_DataSource::CSG_OGR_DataSource(void)
+CSG_OGR_DataSet::CSG_OGR_DataSet(void)
 {
-	m_pDataSource	= NULL;
+	m_pDataSet	= NULL;
 }
 
-CSG_OGR_DataSource::CSG_OGR_DataSource(const CSG_String &File)
+CSG_OGR_DataSet::CSG_OGR_DataSet(const CSG_String &File)
 {
-	m_pDataSource	= NULL;
+	m_pDataSet	= NULL;
 
 	Create(File);
 }
 
 //---------------------------------------------------------
-CSG_OGR_DataSource::~CSG_OGR_DataSource(void)
+CSG_OGR_DataSet::~CSG_OGR_DataSet(void)
 {
 	Destroy();
 }
 
 #ifdef USE_GDAL_V2
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::Create(const CSG_String &File)
+bool CSG_OGR_DataSet::Create(const CSG_String &File)
 {
 	Destroy();
 
-	m_pDataSource	= (GDALDataset *)GDALOpenEx(File, GDAL_OF_VECTOR, NULL, NULL, NULL);
+	m_pDataSet	= (GDALDataset *)GDALOpenEx(File, GDAL_OF_VECTOR, NULL, NULL, NULL);
 
-	return( m_pDataSource != NULL );
+	return( m_pDataSet != NULL );
 }
 
-bool CSG_OGR_DataSource::Create(const CSG_String &File, const CSG_String &DriverName)
+bool CSG_OGR_DataSet::Create(const CSG_String &File, const CSG_String &DriverName)
 {
 	GDALDriver	*pDriver;
 
@@ -384,37 +426,76 @@ bool CSG_OGR_DataSource::Create(const CSG_String &File, const CSG_String &Driver
 
 	if( (pDriver = gSG_OGR_Drivers.Get_Driver(DriverName)) != NULL )
 	{
-		m_pDataSource	= pDriver->Create(File, 0, 0, 0, GDT_Unknown, NULL);
+		m_pDataSet	= pDriver->Create(File, 0, 0, 0, GDT_Unknown, NULL);
 	}
 
-	return( m_pDataSource != NULL );
+	return( m_pDataSet != NULL );
 }
 
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::Destroy(void)
+bool CSG_OGR_DataSet::Destroy(void)
 {
-	if( m_pDataSource )
+	if( m_pDataSet )
 	{
-		GDALClose(m_pDataSource);
+		GDALClose(m_pDataSet);
 
-		m_pDataSource	= NULL;
+		m_pDataSet	= NULL;
 	}
 
 	return( true );
 }
 
+//---------------------------------------------------------
+CSG_String CSG_OGR_DataSet::Get_DriverID(void)	const
+{
+	return( m_pDataSet && m_pDataSet->GetDriver() && m_pDataSet->GetDriver()->GetDescription() ? m_pDataSet->GetDriver()->GetDescription() : "" );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_OGR_DataSet::Get_Description(void)	const
+{
+	return( m_pDataSet ? m_pDataSet->GetDescription() : "" );
+}
+
+//---------------------------------------------------------
+CSG_String CSG_OGR_DataSet::Get_Description(int i)	const
+{
+	CSG_String		Description;
+
+	OGRLayer	*pLayer	= Get_Layer(i);
+
+	if( pLayer != NULL )
+	{
+		char	**pMetaData	= pLayer->GetMetadata() + 0;
+
+		if( pMetaData )
+		{
+			while( *pMetaData )
+			{
+				CSG_String	s(*pMetaData);
+
+				Description	+= s + "\n";
+
+				pMetaData++;
+			}
+		}
+	}
+
+	return( Description );
+}
+
 #else
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::Create(const CSG_String &File)
+bool CSG_OGR_DataSet::Create(const CSG_String &File)
 {
 	Destroy();
 
-	m_pDataSource	= OGRSFDriverRegistrar::Open(File);
+	m_pDataSet	= OGRSFDriverRegistrar::Open(File);
 
-	return( m_pDataSource != NULL );
+	return( m_pDataSet != NULL );
 }
 
-bool CSG_OGR_DataSource::Create(const CSG_String &File, const CSG_String &DriverName)
+bool CSG_OGR_DataSet::Create(const CSG_String &File, const CSG_String &DriverName)
 {
 	OGRSFDriver	*pDriver;
 
@@ -422,25 +503,30 @@ bool CSG_OGR_DataSource::Create(const CSG_String &File, const CSG_String &Driver
 
 	if( (pDriver = gSG_OGR_Drivers.Get_Driver(DriverName)) != NULL )
 	{
-		m_pDataSource	= pDriver->CreateDataSource(File, NULL);
+		m_pDataSet	= pDriver->CreateDataSource(File, NULL);
 	}
 
-	return( m_pDataSource != NULL );
+	return( m_pDataSet != NULL );
 }
 
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::Destroy(void)
+bool CSG_OGR_DataSet::Destroy(void)
 {
-	if( m_pDataSource )
+	if( m_pDataSet )
 	{
-		OGRDataSource::DestroyDataSource(m_pDataSource);
+		OGRDataSource::DestroyDataSource(m_pDataSet);
 
-		m_pDataSource	= NULL;
+		m_pDataSet	= NULL;
 	}
 
 	return( true );
 }
 
+//---------------------------------------------------------
+CSG_String CSG_OGR_DataSet::Get_DriverID   (void)	const	{	return( "" );	}
+CSG_String CSG_OGR_DataSet::Get_Description(void)	const	{	return( "" );	}
+CSG_String CSG_OGR_DataSet::Get_Description(int i)	const	{	return( "" );	}
+
 #endif
 
 
@@ -451,29 +537,29 @@ bool CSG_OGR_DataSource::Destroy(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-int CSG_OGR_DataSource::Get_Count(void)
+int CSG_OGR_DataSet::Get_Count(void)	const
 {
-	if( m_pDataSource )
+	if( m_pDataSet )
 	{
-		return( m_pDataSource->GetLayerCount() );
+		return( m_pDataSet->GetLayerCount() );
 	}
 
 	return( 0 );
 }
 
 //---------------------------------------------------------
-OGRLayer * CSG_OGR_DataSource::Get_Layer(int iLayer)
+OGRLayer * CSG_OGR_DataSet::Get_Layer(int iLayer)	const
 {
-	if( m_pDataSource && iLayer >= 0 && iLayer < m_pDataSource->GetLayerCount() )
+	if( m_pDataSet && iLayer >= 0 && iLayer < m_pDataSet->GetLayerCount() )
 	{
-		return( m_pDataSource->GetLayer(iLayer) );
+		return( m_pDataSet->GetLayer(iLayer) );
 	}
 
 	return( NULL );
 }
 
 //---------------------------------------------------------
-TSG_Shape_Type CSG_OGR_DataSource::Get_Type(int iLayer)
+TSG_Shape_Type CSG_OGR_DataSet::Get_Type(int iLayer)	const
 {
 	if( Get_Layer(iLayer) )
 	{
@@ -484,7 +570,7 @@ TSG_Shape_Type CSG_OGR_DataSource::Get_Type(int iLayer)
 }
 
 //---------------------------------------------------------
-TSG_Vertex_Type CSG_OGR_DataSource::Get_Coordinate_Type(int iLayer)
+TSG_Vertex_Type CSG_OGR_DataSet::Get_Coordinate_Type(int iLayer)	const
 {
 	if( Get_Layer(iLayer) )
 	{
@@ -495,7 +581,7 @@ TSG_Vertex_Type CSG_OGR_DataSource::Get_Coordinate_Type(int iLayer)
 }
 
 //---------------------------------------------------------
-CSG_Projection CSG_OGR_DataSource::Get_Projection(int iLayer)
+CSG_Projection CSG_OGR_DataSet::Get_Projection(int iLayer)	const
 {
 	CSG_Projection	Projection;
 
@@ -531,7 +617,7 @@ CSG_Projection CSG_OGR_DataSource::Get_Projection(int iLayer)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CSG_Shapes * CSG_OGR_DataSource::Read(int iLayer, int iGeomTypeChoice)
+CSG_Shapes * CSG_OGR_DataSet::Read(int iLayer, int iGeomTypeChoice)
 {
 	//-----------------------------------------------------
 	OGRLayer	*pLayer	= Get_Layer(iLayer);
@@ -607,7 +693,7 @@ CSG_Shapes * CSG_OGR_DataSource::Read(int iLayer, int iGeomTypeChoice)
 }
 
 //---------------------------------------------------------
-int CSG_OGR_DataSource::_Get_GeomType_Choice(int iGeomTypeChoice)
+int CSG_OGR_DataSet::_Get_GeomType_Choice(int iGeomTypeChoice)
 {
 	switch( iGeomTypeChoice )
 	{
@@ -631,7 +717,7 @@ int CSG_OGR_DataSource::_Get_GeomType_Choice(int iGeomTypeChoice)
 }
 
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::_Read_Geometry(CSG_Shape *pShape, OGRGeometry *pGeometry)
+bool CSG_OGR_DataSet::_Read_Geometry(CSG_Shape *pShape, OGRGeometry *pGeometry)
 {
 	if( pShape && pGeometry )
 	{
@@ -683,7 +769,7 @@ bool CSG_OGR_DataSource::_Read_Geometry(CSG_Shape *pShape, OGRGeometry *pGeometr
 }
 
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::_Read_Line(CSG_Shape *pShape, OGRLineString *pLine)
+bool CSG_OGR_DataSet::_Read_Line(CSG_Shape *pShape, OGRLineString *pLine)
 {
 	if( pShape && pLine && pLine->getNumPoints() > 0 )
 	{
@@ -703,7 +789,7 @@ bool CSG_OGR_DataSource::_Read_Line(CSG_Shape *pShape, OGRLineString *pLine)
 }
 
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::_Read_Polygon(CSG_Shape *pShape, OGRPolygon *pPolygon)
+bool CSG_OGR_DataSet::_Read_Polygon(CSG_Shape *pShape, OGRPolygon *pPolygon)
 {
 	if( pShape && pPolygon )
 	{
@@ -728,9 +814,9 @@ bool CSG_OGR_DataSource::_Read_Polygon(CSG_Shape *pShape, OGRPolygon *pPolygon)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::Write(CSG_Shapes *pShapes, const CSG_String &DriverName)
+bool CSG_OGR_DataSet::Write(CSG_Shapes *pShapes)
 {
-	if( !m_pDataSource || !pShapes || !pShapes->is_Valid() )
+	if( !m_pDataSet || !pShapes || !pShapes->is_Valid() )
 	{
 		return( false );
 	}
@@ -745,7 +831,7 @@ bool CSG_OGR_DataSource::Write(CSG_Shapes *pShapes, const CSG_String &DriverName
 	//	pSRS	->importFromProj4(pShapes->Get_Projection().Get_Proj4());
 	}
 
-	OGRLayer	*pLayer	= m_pDataSource->CreateLayer(CSG_String(pShapes->Get_Name()), pSRS,
+	OGRLayer	*pLayer	= m_pDataSet->CreateLayer(CSG_String(pShapes->Get_Name()), pSRS,
 		(OGRwkbGeometryType)gSG_OGR_Drivers.Get_Shape_Type(pShapes->Get_Type(), pShapes->Get_Vertex_Type() != SG_VERTEX_TYPE_XY)
 	);
 
@@ -755,7 +841,8 @@ bool CSG_OGR_DataSource::Write(CSG_Shapes *pShapes, const CSG_String &DriverName
 	}
 
 	//-------------------------------------------------
-	if( SG_STR_CMP(DriverName, "DXF") )
+#ifdef USE_GDAL_V2
+	if( SG_STR_CMP(m_pDataSet->GetDriver()->GetDescription(), "DXF") )
 	{
 		// the dxf driver does not support arbitrary field creation and returns OGRERR_FAILURE;
 		// it seems like there is no method in OGR to check whether a driver supports field creation or not;
@@ -773,6 +860,7 @@ bool CSG_OGR_DataSource::Write(CSG_Shapes *pShapes, const CSG_String &DriverName
 			}
 		}
 	}
+#endif
 
 	//-----------------------------------------------------
 	for(int iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
@@ -819,7 +907,7 @@ bool CSG_OGR_DataSource::Write(CSG_Shapes *pShapes, const CSG_String &DriverName
 }
 
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::_Write_Geometry(CSG_Shape *pShape, OGRFeature *pFeature, bool bZ)
+bool CSG_OGR_DataSet::_Write_Geometry(CSG_Shape *pShape, OGRFeature *pFeature, bool bZ)
 {
 	if( !pShape || !pFeature )
 	{
@@ -910,7 +998,7 @@ bool CSG_OGR_DataSource::_Write_Geometry(CSG_Shape *pShape, OGRFeature *pFeature
 }
 
 //---------------------------------------------------------
-bool CSG_OGR_DataSource::_Write_Line(CSG_Shape *pShape, OGRLineString *pLine, int iPart, bool bZ)
+bool CSG_OGR_DataSet::_Write_Line(CSG_Shape *pShape, OGRLineString *pLine, int iPart, bool bZ)
 {
 	if( pLine && pShape && iPart >= 0 && iPart < pShape->Get_Part_Count() )
 	{
diff --git a/src/modules/io/io_gdal/ogr_driver.h b/src/modules/io/io_gdal/ogr_driver.h
index ce2fead..afefdd9 100755
--- a/src/modules/io/io_gdal/ogr_driver.h
+++ b/src/modules/io/io_gdal/ogr_driver.h
@@ -119,12 +119,14 @@ const SG_Char	gSG_Geom_Type_Choice_Key_Name[GEOM_TYPE_KEY_Count][32]	=
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class io_gdal_EXPORT CSG_OGR_Drivers
+class CSG_OGR_Drivers
 {
 public:
 	CSG_OGR_Drivers(void);
 	virtual ~CSG_OGR_Drivers(void);
 
+	CSG_String					Get_Version			(void)						const;
+
 	int							Get_Count			(void)						const;
 
 #ifdef USE_GDAL_V2
@@ -137,6 +139,9 @@ public:
 
 	CSG_String					Get_Name			(int Index)					const;
 	CSG_String					Get_Description		(int Index)					const;
+	CSG_String					Get_Extension		(int Index)					const;
+
+	bool						is_Vector			(int Index)					const;
 
 	bool						Can_Read			(int Index)					const;
 	bool						Can_Write			(int Index)					const;
@@ -160,7 +165,7 @@ private:
 };
 
 //---------------------------------------------------------
-io_gdal_EXPORT const CSG_OGR_Drivers &	SG_Get_OGR_Drivers	(void);
+const CSG_OGR_Drivers &	SG_Get_OGR_Drivers	(void);
 
 
 ///////////////////////////////////////////////////////////
@@ -168,34 +173,38 @@ io_gdal_EXPORT const CSG_OGR_Drivers &	SG_Get_OGR_Drivers	(void);
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class io_gdal_EXPORT CSG_OGR_DataSource
+class CSG_OGR_DataSet
 {
 public:
-	CSG_OGR_DataSource(void);
-	CSG_OGR_DataSource(const CSG_String &File);
-	CSG_OGR_DataSource(const CSG_String &File, const CSG_String &DriverName);
-	virtual ~CSG_OGR_DataSource(void);
+	CSG_OGR_DataSet(void);
+	CSG_OGR_DataSet(const CSG_String &File);
+	CSG_OGR_DataSet(const CSG_String &File, const CSG_String &DriverName);
+	virtual ~CSG_OGR_DataSet(void);
 
 	bool						Create				(const CSG_String &File);
 	bool						Create				(const CSG_String &File, const CSG_String &DriverName);
 	bool						Destroy				(void);
 
-	int							Get_Count			(void);
-	class OGRLayer *			Get_Layer			(int iLayer);
-	TSG_Shape_Type				Get_Type			(int iLayer);
-	TSG_Vertex_Type				Get_Coordinate_Type	(int iLayer);
-	CSG_Projection				Get_Projection		(int iLayer);
+	CSG_String					Get_DriverID		(void)			const;
+	CSG_String					Get_Description		(void)			const;
+	CSG_String					Get_Description		(int iLayer)	const;
+
+	int							Get_Count			(void)			const;
+	class OGRLayer *			Get_Layer			(int iLayer)	const;
+	TSG_Shape_Type				Get_Type			(int iLayer)	const;
+	TSG_Vertex_Type				Get_Coordinate_Type	(int iLayer)	const;
+	CSG_Projection				Get_Projection		(int iLayer)	const;
 
 	CSG_Shapes *				Read				(int iLayer, int iGeomTypeChoice);
-	bool						Write				(CSG_Shapes *pShapes, const CSG_String &DriverName);
+	bool						Write				(CSG_Shapes *pShapes);
 
 
 private:
 
 #ifdef USE_GDAL_V2
-	class GDALDataset			*m_pDataSource;
+	class GDALDataset			*m_pDataSet;
 #else
-	class OGRDataSource			*m_pDataSource;
+	class OGRDataSource			*m_pDataSet;
 #endif
 
 
diff --git a/src/modules/io/io_gdal/ogr_export.cpp b/src/modules/io/io_gdal/ogr_export.cpp
index eefa85f..7976d08 100755
--- a/src/modules/io/io_gdal/ogr_export.cpp
+++ b/src/modules/io/io_gdal/ogr_export.cpp
@@ -69,11 +69,11 @@
 //---------------------------------------------------------
 COGR_Export::COGR_Export(void)
 {
-	Set_Name		(_TL("Export Shapes"));
+	Set_Name	(_TL("Export Shapes"));
 
-	Set_Author		("O.Conrad (c) 2008");
+	Set_Author	("O.Conrad (c) 2008");
 
-	CSG_String	Description, Formats;
+	CSG_String	Description, Formats, Filter;
 
 	Description	= _TW(
 		"The \"OGR Vector Data Export\" module exports vector data to various file formats using the "
@@ -81,43 +81,57 @@ COGR_Export::COGR_Export(void)
 		"For more information have a look at the GDAL homepage:\n"
 		"  <a target=\"_blank\" href=\"http://www.gdal.org/\">"
 		"  http://www.gdal.org</a>\n"
-		"\n"
-		"Following vector formats are currently supported:\n"
-		"<table border=\"1\"><tr><th>Name</th><th>Description</th></tr>\n"
 	);
 
+	Description	+= CSG_String::Format("\nGDAL %s:%s\n\n", _TL("Version"), SG_Get_OGR_Drivers().Get_Version().c_str());
+
+	Description	+= _TL("Following vector formats are currently supported:");
+
+	Description	+= CSG_String::Format("\n<table border=\"1\"><tr><th>%s</th><th>%s</th><th>%s</th></tr>\n",
+		_TL("ID"), _TL("Name"), _TL("Extension")
+	);
+
+	Filter.Printf("%s|*.*", _TL("All Files"));
+
 	for(int i=0; i<SG_Get_OGR_Drivers().Get_Count(); i++)
     {
-		if( SG_Get_OGR_Drivers().Can_Write(i) )
+		if( SG_Get_OGR_Drivers().is_Vector(i) && SG_Get_OGR_Drivers().Can_Write(i) )
 		{
-			Description	+= CSG_String::Format(SG_T("<tr><td>%s</td><td>%s</td></tr>\n"),
-				SG_Get_OGR_Drivers().Get_Name(i).c_str(),
-				SG_Get_OGR_Drivers().Get_Description(i).c_str()
-			);
+			CSG_String	ID		= SG_Get_OGR_Drivers().Get_Description(i).c_str();
+			CSG_String	Name	= SG_Get_OGR_Drivers().Get_Name       (i).c_str();
+			CSG_String	Ext		= SG_Get_OGR_Drivers().Get_Extension  (i).c_str();
+
+			Description	+= "<tr><td>" + ID + "</td><td>" + Name + "</td><td>" + Ext + "</td></tr>";
+			Formats		+= "{" + ID + "}" + Name + "|";
+
+			if( !Ext.is_Empty() )
+			{
+				Ext.Replace("/", ";");
 
-			Formats		+= CSG_String::Format(SG_T("%s|"), SG_Get_OGR_Drivers().Get_Name(i).c_str());
+				Filter	+= "|" + Name + "|*." + Ext;
+			}
 		}
     }
 
-	Description	+= SG_T("</table>");
+	Description	+= "</table>";
 
 	Set_Description(Description);
 
 	//-----------------------------------------------------
 	Parameters.Add_Shapes(
-		NULL, "SHAPES"	, _TL("Shapes"),
+		NULL	, "SHAPES"	, _TL("Shapes"),
 		_TL(""),
 		PARAMETER_INPUT
 	);
 
 	Parameters.Add_FilePath(
-		NULL, "FILE"	, _TL("File"),
+		NULL	, "FILE"	, _TL("File"),
 		_TL(""),
-		NULL, NULL, true
+		Filter, NULL, true
 	);
 
 	Parameters.Add_Choice(
-		NULL, "FORMAT"	, _TL("Format"),
+		NULL	, "FORMAT"	, _TL("Format"),
 		_TL(""),
 		Formats
 	);
@@ -133,25 +147,23 @@ COGR_Export::COGR_Export(void)
 //---------------------------------------------------------
 bool COGR_Export::On_Execute(void)
 {
-	CSG_String			File_Name;
-	CSG_Shapes			*pShapes;
-	CSG_OGR_DataSource	DataSource;
+	CSG_OGR_DataSet	DataSource;
 
-	//-----------------------------------------------------
-	pShapes		= Parameters("SHAPES")	->asShapes();
-	File_Name	= Parameters("FILE")	->asString();
-
-	//-----------------------------------------------------
-	if( DataSource.Create(File_Name, Parameters("FORMAT")->asString()) == false )
+	if( !DataSource.Create(Parameters("FILE")->asString(), Parameters("FORMAT")->asString()) )
 	{
-		Message_Add(_TL("Could not create data source."));
+		Error_Set(_TL("data set creation failed"));
+
+		return( false );
 	}
-	else if( DataSource.Write(pShapes, Parameters("FORMAT")->asString()) )
+
+	if( !DataSource.Write(Parameters("SHAPES")->asShapes()) )
 	{
-		return( true );
+		Error_Set(_TL("failed to write data"));
+
+		return( false );
 	}
 
-	return( false );
+	return( true );
 }
 
 
diff --git a/src/modules/io/io_gdal/ogr_export_kml.cpp b/src/modules/io/io_gdal/ogr_export_kml.cpp
index 6e0b511..58d0a30 100755
--- a/src/modules/io/io_gdal/ogr_export_kml.cpp
+++ b/src/modules/io/io_gdal/ogr_export_kml.cpp
@@ -93,10 +93,10 @@ COGR_Export_KML::COGR_Export_KML(void)
 	);
 
 	Parameters.Add_FilePath(
-		NULL, "FILE"	, _TL("File"),
+		NULL	, "FILE"	, _TL("File"),
 		_TL(""),
 		CSG_String::Format(
-			SG_T("%s|*.kml;*.kml|%s|*.*"),
+			"%s|*.kml;*.kml|%s|*.*",
 			_TL("KML files (*.kml)"),
 			_TL("All Files")
 		), NULL, true
@@ -113,11 +113,7 @@ COGR_Export_KML::COGR_Export_KML(void)
 //---------------------------------------------------------
 bool COGR_Export_KML::On_Execute(void)
 {
-	CSG_String	File_Name, Driver_Name = "KML";
-	CSG_Shapes	*pShapes, Shapes;
-
-	pShapes		= Parameters("SHAPES")->asShapes();
-	File_Name	= Parameters("FILE"  )->asString();
+	CSG_Shapes	Shapes, *pShapes	= Parameters("SHAPES")->asShapes();
 
 	//-----------------------------------------------------
 	if( pShapes->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Undefined )
@@ -126,7 +122,7 @@ bool COGR_Export_KML::On_Execute(void)
 	}
 	else if( pShapes->Get_Projection().Get_Type() != SG_PROJ_TYPE_CS_Geographic )
 	{
-		Message_Add(CSG_String::Format(SG_T("\n%s (%s: %s)\n"), _TL("re-projection to geographic coordinates"), _TL("original"), pShapes->Get_Projection().Get_Name().c_str()), false);
+		Message_Add(CSG_String::Format("\n%s (%s: %s)\n", _TL("re-projection to geographic coordinates"), _TL("original"), pShapes->Get_Projection().Get_Name().c_str()), false);
 
 		bool	bResult;
 
@@ -140,27 +136,32 @@ bool COGR_Export_KML::On_Execute(void)
 		{
 			pShapes	= &Shapes;
 
-			Message_Add(CSG_String::Format(SG_T("\n%s: %s\n"), _TL("re-projection"), _TL("success")), false);
+			Message_Add(CSG_String::Format("\n%s: %s\n", _TL("re-projection"), _TL("success")), false);
 		}
 		else
 		{
-			Message_Add(CSG_String::Format(SG_T("\n%s: %s\n"), _TL("re-projection"), _TL("failed")), false);
+			Message_Add(CSG_String::Format("\n%s: %s\n", _TL("re-projection"), _TL("failed" )), false);
 		}
 	}
 
 	//-----------------------------------------------------
-	CSG_OGR_DataSource	DataSource;
+	CSG_OGR_DataSet	DataSource;
 
-	if( DataSource.Create(File_Name, Driver_Name) == false )
+	if( !DataSource.Create(Parameters("FILE")->asString(), "KML") )
 	{
-		Message_Add(_TL("could not create KML file"));
+		Error_Set(_TL("KML file creation failed"));
+
+		return( false );
 	}
-	else if( DataSource.Write(pShapes, Driver_Name) )
+
+	if( !DataSource.Write(pShapes) )
 	{
-		return( true );
+		Error_Set(_TL("failed to store data"));
+
+		return( false );
 	}
 
-	return( false );
+	return( true );
 }
 
 
diff --git a/src/modules/io/io_gdal/ogr_import.cpp b/src/modules/io/io_gdal/ogr_import.cpp
index bfaa0fa..0708eff 100755
--- a/src/modules/io/io_gdal/ogr_import.cpp
+++ b/src/modules/io/io_gdal/ogr_import.cpp
@@ -73,7 +73,7 @@ COGR_Import::COGR_Import(void)
 
 	Set_Author	("O.Conrad (c) 2008");
 
-	CSG_String	Description;
+	CSG_String	Description, Filter, Filter_All;
 
 	Description	= _TW(
 		"The \"OGR Vector Data Import\" module imports vector data from various file/database formats using the "
@@ -81,48 +81,64 @@ COGR_Import::COGR_Import(void)
 		"For more information have a look at the GDAL homepage:\n"
 		"  <a target=\"_blank\" href=\"http://www.gdal.org/\">"
 		"  http://www.gdal.org</a>\n"
-		"\n"
-		"Following vector data formats are currently supported:\n"
-		"<table border=\"1\"><tr><th>Name</th><th>Description</th></tr>\n"
+	);
+
+	Description	+= CSG_String::Format("\nGDAL %s:%s\n\n", _TL("Version"), SG_Get_OGR_Drivers().Get_Version().c_str());
+
+	Description	+= _TL("Following raster formats are currently supported:");
+
+	Description	+= CSG_String::Format("\n<table border=\"1\"><tr><th>%s</th><th>%s</th><th>%s</th></tr>",
+		_TL("ID"), _TL("Name"), _TL("Extension")
 	);
 
 	for(int i=0; i<SG_Get_OGR_Drivers().Get_Count(); i++)
     {
-		if( SG_Get_OGR_Drivers().Can_Read(i) )
+		if( SG_Get_OGR_Drivers().is_Vector(i) && SG_Get_OGR_Drivers().Can_Read(i) )
 		{
-			Description	+= CSG_String::Format(SG_T("<tr><td>%s</td><td>%s</td></tr>\n"),
-				SG_Get_OGR_Drivers().Get_Name(i).c_str(),
-				SG_Get_OGR_Drivers().Get_Description(i).c_str()
-			);
+			CSG_String	ID		= SG_Get_OGR_Drivers().Get_Description(i).c_str();
+			CSG_String	Name	= SG_Get_OGR_Drivers().Get_Name       (i).c_str();
+			CSG_String	Ext		= SG_Get_OGR_Drivers().Get_Extension  (i).c_str();
+
+			Description	+= "<tr><td>" + ID + "</td><td>" + Name + "</td><td>" + Ext + "</td></tr>";
+
+			if( !Ext.is_Empty() )
+			{
+				Ext.Replace("/", ";");
+
+				Filter		+= Name + "|*." + Ext + "|";
+				Filter_All	+= (Filter_All.is_Empty() ? "*." : ";*.") + Ext;
+			}
 		}
     }
 
-	Description	+= SG_T("</table>");
+	Description	+= "</table>";
 
 	Set_Description(Description);
 
+	Filter.Prepend(CSG_String::Format("%s|%s|" , _TL("All Recognized Files"), Filter_All.c_str()));
+	Filter.Append (CSG_String::Format("%s|*.*" , _TL("All Files")));
+
 	//-----------------------------------------------------
 	Parameters.Add_Shapes_List(
-		NULL, "SHAPES"	, _TL("Shapes"),
+		NULL	, "SHAPES"	, _TL("Shapes"),
 		_TL(""),
 		PARAMETER_OUTPUT
 	);
 
 	Parameters.Add_FilePath(
-		NULL, "FILES"	, _TL("Files"),
+		NULL	, "FILES"	, _TL("Files"),
 		_TL(""),
-		NULL, NULL, false, false, true
+		Filter, NULL, false, false, true
 	);
 
 	CSG_String	sChoices;
 	for(int i=0; i<GEOM_TYPE_KEY_Count; i++)
 	{
-		sChoices += gSG_Geom_Type_Choice_Key_Name[i];
-		sChoices += SG_T("|");
+		sChoices += gSG_Geom_Type_Choice_Key_Name[i];	sChoices += "|";
 	}
 
 	Parameters.Add_Choice(
-		NULL, "GEOM_TYPE"	, _TL("Geometry Type"),
+		NULL	, "GEOM_TYPE"	, _TL("Geometry Type"),
 		_TL("Some OGR drivers are unable to determine the geometry type automatically, please choose the appropriate one in this case"),
 		sChoices,
 		0
@@ -137,8 +153,8 @@ COGR_Import::COGR_Import(void)
 //---------------------------------------------------------
 bool COGR_Import::On_Execute(void)
 {
-	CSG_Strings			Files;
-	CSG_OGR_DataSource	DataSource;
+	CSG_Strings		Files;
+	CSG_OGR_DataSet	DataSource;
 
 	//-----------------------------------------------------
 	if( !Parameters("FILES")->asFilePath()->Get_FilePaths(Files) )
@@ -170,6 +186,11 @@ bool COGR_Import::On_Execute(void)
 				if( pShapes )
 				{
 					Parameters("SHAPES")->asShapesList()->Add_Item(pShapes);
+
+					pShapes->Get_MetaData().Add_Child("GDAL_DRIVER", DataSource.Get_DriverID());
+					pShapes->Set_File_Name(Files[iFile]);
+					pShapes->Set_Name(SG_File_Get_Name(Files[iFile], false) + (DataSource.Get_Count() == 1 ? CSG_String("") : CSG_String::Format(" [%d]", 1 + iLayer)));
+					pShapes->Set_Description(DataSource.Get_Description(iLayer));
 				}
 			}
 		}
diff --git a/src/modules/io/io_gps/Makefile.in b/src/modules/io/io_gps/Makefile.in
index ce5b49c..7940b8a 100644
--- a/src/modules/io/io_gps/Makefile.in
+++ b/src/modules/io/io_gps/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_gps
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -211,6 +221,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -244,6 +255,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -262,6 +280,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -351,6 +370,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -394,7 +414,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_gps/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_gps/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -698,6 +717,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_grid/MLB_Interface.cpp b/src/modules/io/io_grid/MLB_Interface.cpp
index 53ea279..e6b59d7 100755
--- a/src/modules/io/io_grid/MLB_Interface.cpp
+++ b/src/modules/io/io_grid/MLB_Interface.cpp
@@ -108,7 +108,6 @@ CSG_String Get_Info(int i)
 #include "erdas_lan.h"
 #include "grid_table.h"
 #include "wrf.h"
-#include "citygml_import.h"
 #include "import_clip_resample.h"
 
 
@@ -134,7 +133,6 @@ CSG_Module *		Create_Module(int i)
 	case 12:	return( new CGrid_Table_Import );
 	case 13:	return( new CWRF_Import );
 	case 14:	return( new CWRF_Export );
-	case 15:	return( new CCityGML_Import );
 	case 16:	return( new CImport_Clip_Resample );
 
 	//-----------------------------------------------------
diff --git a/src/modules/io/io_grid/Makefile.am b/src/modules/io/io_grid/Makefile.am
index 54f6afb..6f71f8f 100755
--- a/src/modules/io/io_grid/Makefile.am
+++ b/src/modules/io/io_grid/Makefile.am
@@ -12,7 +12,6 @@ AM_LDFLAGS         = -fPIC -shared -avoid-version
 pkglib_LTLIBRARIES = libio_grid.la
 libio_grid_la_SOURCES =\
 bmp_export.cpp\
-citygml_import.cpp\
 erdas_lan.cpp\
 esri_arcinfo.cpp\
 grid_table.cpp\
@@ -26,7 +25,6 @@ usgs_srtm.cpp\
 wrf.cpp\
 xyz.cpp\
 bmp_export.h\
-citygml_import.h\
 erdas_lan.h\
 esri_arcinfo.h\
 grid_table.h\
diff --git a/src/modules/io/io_grid/Makefile.in b/src/modules/io/io_grid/Makefile.in
index ceb5b2d..b519576 100644
--- a/src/modules/io/io_grid/Makefile.in
+++ b/src/modules/io/io_grid/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_grid
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -127,10 +137,9 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libio_grid_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_grid_la_OBJECTS = bmp_export.lo citygml_import.lo \
-	erdas_lan.lo esri_arcinfo.lo grid_table.lo \
-	import_clip_resample.lo MLB_Interface.lo mola.lo raw.lo \
-	srtm30.lo surfer.lo usgs_srtm.lo wrf.lo xyz.lo
+am_libio_grid_la_OBJECTS = bmp_export.lo erdas_lan.lo esri_arcinfo.lo \
+	grid_table.lo import_clip_resample.lo MLB_Interface.lo mola.lo \
+	raw.lo srtm30.lo surfer.lo usgs_srtm.lo wrf.lo xyz.lo
 libio_grid_la_OBJECTS = $(am_libio_grid_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -214,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -374,7 +393,6 @@ AM_LDFLAGS = -fPIC -shared -avoid-version
 pkglib_LTLIBRARIES = libio_grid.la
 libio_grid_la_SOURCES = \
 bmp_export.cpp\
-citygml_import.cpp\
 erdas_lan.cpp\
 esri_arcinfo.cpp\
 grid_table.cpp\
@@ -388,7 +406,6 @@ usgs_srtm.cpp\
 wrf.cpp\
 xyz.cpp\
 bmp_export.h\
-citygml_import.h\
 erdas_lan.h\
 esri_arcinfo.h\
 grid_table.h\
@@ -419,7 +436,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_grid/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_grid/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -484,7 +500,6 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bmp_export.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/citygml_import.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/erdas_lan.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/esri_arcinfo.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_table.Plo at am__quote@
@@ -734,6 +749,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_grid_image/MLB_Interface.cpp b/src/modules/io/io_grid_image/MLB_Interface.cpp
index e7a9c6a..aaab346 100755
--- a/src/modules/io/io_grid_image/MLB_Interface.cpp
+++ b/src/modules/io/io_grid_image/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2542 2015-07-15 12:31:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_grid_image/MLB_Interface.h b/src/modules/io/io_grid_image/MLB_Interface.h
index f6e552d..20e4483 100755
--- a/src/modules/io/io_grid_image/MLB_Interface.h
+++ b/src/modules/io/io_grid_image/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 2089 2014-04-04 12:37:27Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_grid_image/Makefile.in b/src/modules/io/io_grid_image/Makefile.in
index ff1b2d1..ed1a9fc 100644
--- a/src/modules/io/io_grid_image/Makefile.in
+++ b/src/modules/io/io_grid_image/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_grid_image
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -212,6 +222,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +256,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +281,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +371,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -395,7 +415,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_grid_image/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_grid_image/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -700,6 +719,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_grid_image/grid_export.cpp b/src/modules/io/io_grid_image/grid_export.cpp
index 9aac83b..ccaa5f3 100755
--- a/src/modules/io/io_grid_image/grid_export.cpp
+++ b/src/modules/io/io_grid_image/grid_export.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_export.cpp 2542 2015-07-15 12:31:48Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_grid_image/grid_export.h b/src/modules/io/io_grid_image/grid_export.h
index 2e15806..0105663 100755
--- a/src/modules/io/io_grid_image/grid_export.h
+++ b/src/modules/io/io_grid_image/grid_export.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_export.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_grid_image/grid_import.cpp b/src/modules/io/io_grid_image/grid_import.cpp
index 9fea2c3..8cef219 100755
--- a/src/modules/io/io_grid_image/grid_import.cpp
+++ b/src/modules/io/io_grid_image/grid_import.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_import.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_grid_image/grid_import.h b/src/modules/io/io_grid_image/grid_import.h
index 9c0b765..14c4cd4 100755
--- a/src/modules/io/io_grid_image/grid_import.h
+++ b/src/modules/io/io_grid_image/grid_import.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_import.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_grid_image/grid_to_kml.cpp b/src/modules/io/io_grid_image/grid_to_kml.cpp
index 1e47604..a54d850 100755
--- a/src/modules/io/io_grid_image/grid_to_kml.cpp
+++ b/src/modules/io/io_grid_image/grid_to_kml.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_to_kml.cpp 2841 2016-03-05 11:25:04Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_grid_image/grid_to_kml.h b/src/modules/io/io_grid_image/grid_to_kml.h
index 37a3067..0bfc599 100755
--- a/src/modules/io/io_grid_image/grid_to_kml.h
+++ b/src/modules/io/io_grid_image/grid_to_kml.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_to_kml.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_shapes/MLB_Interface.cpp b/src/modules/io/io_shapes/MLB_Interface.cpp
index 7f18e4c..fe7d477 100755
--- a/src/modules/io/io_shapes/MLB_Interface.cpp
+++ b/src/modules/io/io_shapes/MLB_Interface.cpp
@@ -110,6 +110,7 @@ CSG_String Get_Info(int i)
 #include "svg.h"
 #include "pointcloud_to_text_file.h"
 #include "wktb.h"
+#include "citygml_import.h"
 
 
 //---------------------------------------------------------
@@ -140,6 +141,11 @@ CSG_Module *		Create_Module(int i)
 	case 18:	return( new CPointcloud_To_Text_File );
 	case 19:	return( new CWKT_Import );
 	case 20:	return( new CWKT_Export );
+	case 21:	return( new CCityGML_Import );
+
+	//-----------------------------------------------------
+	case 22:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
 	}
 
 	return( NULL );
diff --git a/src/modules/io/io_shapes/Makefile.am b/src/modules/io/io_shapes/Makefile.am
index bb06f5f..250e026 100755
--- a/src/modules/io/io_shapes/Makefile.am
+++ b/src/modules/io/io_shapes/Makefile.am
@@ -15,6 +15,7 @@ AM_LDFLAGS         = -fPIC -shared -avoid-version $(DEP_LFLG)
 pkglib_LTLIBRARIES = libio_shapes.la
 libio_shapes_la_SOURCES =\
 atlas_bna.cpp\
+citygml_import.cpp\
 generate.cpp\
 gpx.cpp\
 gstat.cpp\
@@ -29,6 +30,7 @@ wasp_map.cpp\
 wktb.cpp\
 xyz.cpp\
 atlas_bna.h\
+citygml_import.h\
 generate.h\
 gpx.h\
 gstat.h\
diff --git a/src/modules/io/io_shapes/Makefile.in b/src/modules/io/io_shapes/Makefile.in
index b7e7018..c94ae43 100644
--- a/src/modules/io/io_shapes/Makefile.in
+++ b/src/modules/io/io_shapes/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_shapes
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -127,10 +137,11 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libio_shapes_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libio_shapes_la_OBJECTS = atlas_bna.lo generate.lo gpx.lo gstat.lo \
-	MLB_Interface.lo pointcloud_from_file.lo \
-	pointcloud_from_text_file.lo pointcloud_to_text_file.lo stl.lo \
-	surfer_bln.lo svg.lo wasp_map.lo wktb.lo xyz.lo
+am_libio_shapes_la_OBJECTS = atlas_bna.lo citygml_import.lo \
+	generate.lo gpx.lo gstat.lo MLB_Interface.lo \
+	pointcloud_from_file.lo pointcloud_from_text_file.lo \
+	pointcloud_to_text_file.lo stl.lo surfer_bln.lo svg.lo \
+	wasp_map.lo wktb.lo xyz.lo
 libio_shapes_la_OBJECTS = $(am_libio_shapes_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -214,6 +225,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +259,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +284,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +374,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -376,6 +397,7 @@ AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LFLG)
 pkglib_LTLIBRARIES = libio_shapes.la
 libio_shapes_la_SOURCES = \
 atlas_bna.cpp\
+citygml_import.cpp\
 generate.cpp\
 gpx.cpp\
 gstat.cpp\
@@ -390,6 +412,7 @@ wasp_map.cpp\
 wktb.cpp\
 xyz.cpp\
 atlas_bna.h\
+citygml_import.h\
 generate.h\
 gpx.h\
 gstat.h\
@@ -421,7 +444,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_shapes/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_shapes/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -486,6 +508,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/atlas_bna.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/citygml_import.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/generate.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gpx.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gstat.Plo at am__quote@
@@ -736,6 +759,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_grid/citygml_import.cpp b/src/modules/io/io_shapes/citygml_import.cpp
similarity index 99%
rename from src/modules/io/io_grid/citygml_import.cpp
rename to src/modules/io/io_shapes/citygml_import.cpp
index bc9e681..8bd2f13 100755
--- a/src/modules/io/io_grid/citygml_import.cpp
+++ b/src/modules/io/io_shapes/citygml_import.cpp
@@ -9,7 +9,7 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                        io_grid                        //
+//                      io_shapes                        //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
diff --git a/src/modules/io/io_grid/citygml_import.h b/src/modules/io/io_shapes/citygml_import.h
similarity index 98%
rename from src/modules/io/io_grid/citygml_import.h
rename to src/modules/io/io_shapes/citygml_import.h
index 089360a..f2a39f8 100755
--- a/src/modules/io/io_grid/citygml_import.h
+++ b/src/modules/io/io_shapes/citygml_import.h
@@ -9,7 +9,7 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                        io_grid                        //
+//                      io_shapes                        //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
diff --git a/src/modules/io/io_shapes/pointcloud_from_text_file.cpp b/src/modules/io/io_shapes/pointcloud_from_text_file.cpp
index 4c82da7..4ff3168 100755
--- a/src/modules/io/io_shapes/pointcloud_from_text_file.cpp
+++ b/src/modules/io/io_shapes/pointcloud_from_text_file.cpp
@@ -206,6 +206,7 @@ bool CPointCloud_From_Text_File::On_Execute(void)
 	bool					bSkipHeader;
 	char					fieldSep;
 	std::vector<int>		vCol;
+	std::vector<int>		vTypes;
 	std::ifstream			tabStream;
     std::string				tabLine;
 	double					lines;
@@ -232,7 +233,6 @@ bool CPointCloud_From_Text_File::On_Execute(void)
     pPoints->Create();
     pPoints->Set_Name(SG_File_Get_Name(fileName, false));
     Parameters("POINTS")->Set_Value(pPoints);
-    DataObject_Add(pPoints);
 
 
     //-----------------------------------------------------
@@ -240,12 +240,13 @@ bool CPointCloud_From_Text_File::On_Execute(void)
     {
         nAttribs	= Parameters("ATTRIBS")		->asInt();
 
-        Types.Printf(SG_T("%s|%s|%s|%s|%s|"),
+        Types.Printf(SG_T("%s|%s|%s|%s|%s|%s|"),
             _TL("1 byte integer"),
             _TL("2 byte integer"),
             _TL("4 byte integer"),
             _TL("4 byte floating point"),
-            _TL("8 byte floating point")
+            _TL("8 byte floating point"),
+            _TL("string")
         );
 
         P.Set_Name(_TL("Attribute Field Properties"));
@@ -276,6 +277,7 @@ bool CPointCloud_From_Text_File::On_Execute(void)
                     Name		 = P(CSG_String::Format(SG_T("FIELD_%03d" ), iField + 1).c_str())->asString();
                     iType		 = P(CSG_String::Format(SG_T("TYPE_%03d"  ), iField + 1).c_str())->asInt();
                     vCol.push_back(P(CSG_String::Format(SG_T("COLUMN_%03d"), iField + 1).c_str())->asInt() - 1);
+                    vTypes.push_back(iType);
 
                     pPoints->Add_Field(Name, Get_Data_Type(iType));
                 }
@@ -289,8 +291,6 @@ bool CPointCloud_From_Text_File::On_Execute(void)
 		CSG_String		    sFields, sNames, sTypes;
 		CSG_String		    token;
 		int				    iValue;
-		std::vector<int>	vTypes;
-
 
 		sFields		= Parameters("FIELDS")->asString();
 		sNames		= Parameters("FIELDNAMES")->asString();
@@ -351,7 +351,7 @@ bool CPointCloud_From_Text_File::On_Execute(void)
 			if( token.Length() == 0 )
 				break;
 
-			pPoints->Add_Field(token, Get_Data_Type(vTypes.at(iter)));
+			pPoints->Add_Field(token, Get_Data_Type(vTypes[iter]));
 
 			iter++;
 		}
@@ -420,23 +420,23 @@ bool CPointCloud_From_Text_File::On_Execute(void)
         }
 
         //parse line tokens
-		std::vector<double> fieldValues;
-		fieldValues.resize(vCol.size());
-
 		x = strtod(tabCols[xField].c_str(), NULL);
         y = strtod(tabCols[yField].c_str(), NULL);
         z = strtod(tabCols[zField].c_str(), NULL);
 
-		for( int i=0; i<(int)vCol.size(); i++ )
-		{
-			fieldValues[i] = strtod(tabCols.at(vCol.at(i)).c_str(), NULL);
-		}
-
-		pPoints->Add_Point(x, y, z);
+        pPoints->Add_Point(x, y, z);
 
 		for( int i=0; i<(int)vCol.size(); i++ )
 		{
-			pPoints->Set_Attribute(i, fieldValues[i]);
+			switch( Get_Data_Type(vTypes[i]) )
+			{
+			case SG_DATATYPE_String:
+				pPoints->Set_Attribute(i, SG_STR_MBTOSG(tabCols[vCol[i]].c_str()));
+				break;
+			default:
+				pPoints->Set_Attribute(i, strtod(tabCols[vCol[i]].c_str(), NULL));
+				break;
+			}
 		}
     }
 
@@ -478,6 +478,7 @@ TSG_Data_Type CPointCloud_From_Text_File::Get_Data_Type(int iType)
     case 2:	return( SG_DATATYPE_Int );
     case 3:	return( SG_DATATYPE_Float );
     case 4:	return( SG_DATATYPE_Double );
+    case 5: return( SG_DATATYPE_String );
     }
 }
 
diff --git a/src/modules/io/io_shapes/pointcloud_to_text_file.cpp b/src/modules/io/io_shapes/pointcloud_to_text_file.cpp
index 2686a6e..bd2383f 100755
--- a/src/modules/io/io_shapes/pointcloud_to_text_file.cpp
+++ b/src/modules/io/io_shapes/pointcloud_to_text_file.cpp
@@ -323,12 +323,16 @@ bool CPointcloud_To_Text_File::On_Execute(void)
 
 	for(int iPoint=0; iPoint<pPoints->Get_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++)
 	{
-		CSG_String	sLine;
+		CSG_String	sLine, s;
 
 		for(size_t i=0; i<vCol.size(); i++)
 		{
 			switch (pPoints->Get_Field_Type(vCol.at(i)))
 			{
+			case SG_DATATYPE_String:
+				pPoints->Get_Value(iPoint, vCol.at(i), s);
+				sLine += s;
+				break;
 			case SG_DATATYPE_Double:
 			case SG_DATATYPE_Float:
 				sLine += SG_Get_String(pPoints->Get_Value(iPoint, vCol.at(i)), vPrecision.at(i), false);
diff --git a/src/modules/io/io_shapes_dxf/Makefile.am b/src/modules/io/io_shapes_dxf/Makefile.am
index 0097e30..db5c457 100755
--- a/src/modules/io/io_shapes_dxf/Makefile.am
+++ b/src/modules/io/io_shapes_dxf/Makefile.am
@@ -13,10 +13,15 @@ pkglib_LTLIBRARIES = libio_shapes_dxf.la
 libio_shapes_dxf_la_SOURCES =\
 dxf_import.cpp\
 MLB_Interface.cpp\
+dxf_import.h\
+MLB_Interface.h
+
+if SYSTEM_DXFLIB
+AM_LDFLAGS       += -ldxflib
+else
+libio_shapes_dxf_la_SOURCES +=\
 ./dxflib/dl_dxf.cpp\
 ./dxflib/dl_writer_ascii.cpp\
-dxf_import.h\
-MLB_Interface.h\
 ./dxflib/dl_attributes.h\
 ./dxflib/dl_codes.h\
 ./dxflib/dl_creationadapter.h\
@@ -29,4 +34,4 @@ MLB_Interface.h\
 ./dxflib/dl_writer_ascii.h
 
 libio_shapes_dxf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
-
+endif
diff --git a/src/modules/io/io_shapes_dxf/Makefile.in b/src/modules/io/io_shapes_dxf/Makefile.in
index ec47353..8f8aa6f 100644
--- a/src/modules/io/io_shapes_dxf/Makefile.in
+++ b/src/modules/io/io_shapes_dxf/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,11 +88,25 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
+ at SYSTEM_DXFLIB_TRUE@am__append_1 = -ldxflib
+ at SYSTEM_DXFLIB_FALSE@am__append_2 = \
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_dxf.cpp\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_writer_ascii.cpp\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_attributes.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_codes.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_creationadapter.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_creationinterface.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_dxf.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_entities.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_exception.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_extrusion.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_writer.h\
+ at SYSTEM_DXFLIB_FALSE@./dxflib/dl_writer_ascii.h
+
 subdir = src/modules/io/io_shapes_dxf
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -125,11 +150,20 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libio_shapes_dxf_la_DEPENDENCIES =  \
-	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+ at SYSTEM_DXFLIB_FALSE@libio_shapes_dxf_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+am__libio_shapes_dxf_la_SOURCES_DIST = dxf_import.cpp \
+	MLB_Interface.cpp dxf_import.h MLB_Interface.h \
+	./dxflib/dl_dxf.cpp ./dxflib/dl_writer_ascii.cpp \
+	./dxflib/dl_attributes.h ./dxflib/dl_codes.h \
+	./dxflib/dl_creationadapter.h ./dxflib/dl_creationinterface.h \
+	./dxflib/dl_dxf.h ./dxflib/dl_entities.h \
+	./dxflib/dl_exception.h ./dxflib/dl_extrusion.h \
+	./dxflib/dl_writer.h ./dxflib/dl_writer_ascii.h
 am__dirstamp = $(am__leading_dot)dirstamp
+ at SYSTEM_DXFLIB_FALSE@am__objects_1 = ./dxflib/dl_dxf.lo \
+ at SYSTEM_DXFLIB_FALSE@	./dxflib/dl_writer_ascii.lo
 am_libio_shapes_dxf_la_OBJECTS = dxf_import.lo MLB_Interface.lo \
-	./dxflib/dl_dxf.lo ./dxflib/dl_writer_ascii.lo
+	$(am__objects_1)
 libio_shapes_dxf_la_OBJECTS = $(am_libio_shapes_dxf_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -188,7 +222,7 @@ am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
 SOURCES = $(libio_shapes_dxf_la_SOURCES)
-DIST_SOURCES = $(libio_shapes_dxf_la_SOURCES)
+DIST_SOURCES = $(am__libio_shapes_dxf_la_SOURCES_DIST)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -213,6 +247,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +281,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +306,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +396,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -369,27 +413,11 @@ top_srcdir = @top_srcdir@
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
 CXX_INCS = -I$(top_srcdir)/src/saga_core
 AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version 
+AM_LDFLAGS = -fPIC -shared -avoid-version $(am__append_1)
 pkglib_LTLIBRARIES = libio_shapes_dxf.la
-libio_shapes_dxf_la_SOURCES = \
-dxf_import.cpp\
-MLB_Interface.cpp\
-./dxflib/dl_dxf.cpp\
-./dxflib/dl_writer_ascii.cpp\
-dxf_import.h\
-MLB_Interface.h\
-./dxflib/dl_attributes.h\
-./dxflib/dl_codes.h\
-./dxflib/dl_creationadapter.h\
-./dxflib/dl_creationinterface.h\
-./dxflib/dl_dxf.h\
-./dxflib/dl_entities.h\
-./dxflib/dl_exception.h\
-./dxflib/dl_extrusion.h\
-./dxflib/dl_writer.h\
-./dxflib/dl_writer_ascii.h
-
-libio_shapes_dxf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
+libio_shapes_dxf_la_SOURCES = dxf_import.cpp MLB_Interface.cpp \
+	dxf_import.h MLB_Interface.h $(am__append_2)
+ at SYSTEM_DXFLIB_FALSE@libio_shapes_dxf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS)
 all: all-am
 
 .SUFFIXES:
@@ -406,7 +434,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_shapes_dxf/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_shapes_dxf/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -726,6 +753,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_shapes_las/Makefile.in b/src/modules/io/io_shapes_las/Makefile.in
index 7b321a9..d6f9baa 100644
--- a/src/modules/io/io_shapes_las/Makefile.in
+++ b/src/modules/io/io_shapes_las/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_shapes_las
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -215,6 +225,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -248,6 +259,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -266,6 +284,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -355,6 +374,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -401,7 +421,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_shapes_las/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_shapes_las/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -706,6 +725,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_table/Makefile.in b/src/modules/io/io_table/Makefile.in
index e0bde96..1a2b524 100644
--- a/src/modules/io/io_table/Makefile.in
+++ b/src/modules/io/io_table/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_table
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -211,6 +221,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -244,6 +255,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -262,6 +280,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -351,6 +370,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -392,7 +412,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_table/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_table/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -695,6 +714,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_virtual/MLB_Interface.cpp b/src/modules/io/io_virtual/MLB_Interface.cpp
index ae1eb99..b60e3df 100755
--- a/src/modules/io/io_virtual/MLB_Interface.cpp
+++ b/src/modules/io/io_virtual/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2359 2014-12-27 12:46:46Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_virtual/MLB_Interface.h b/src/modules/io/io_virtual/MLB_Interface.h
index daa3913..c2cabb4 100755
--- a/src/modules/io/io_virtual/MLB_Interface.h
+++ b/src/modules/io/io_virtual/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1976 2014-02-09 15:05:12Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_virtual/Makefile.am b/src/modules/io/io_virtual/Makefile.am
index 4d1c9a6..b9d8395 100755
--- a/src/modules/io/io_virtual/Makefile.am
+++ b/src/modules/io/io_virtual/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/io/io_virtual/Makefile.in b/src/modules/io/io_virtual/Makefile.in
index 893735b..10b393c 100644
--- a/src/modules/io/io_virtual/Makefile.in
+++ b/src/modules/io/io_virtual/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/io/io_virtual
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -364,7 +384,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags`
@@ -405,7 +425,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/io/io_virtual/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/io/io_virtual/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -712,6 +731,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/io/io_virtual/pc_create_spcvf.cpp b/src/modules/io/io_virtual/pc_create_spcvf.cpp
index 31aecd4..4f8233f 100755
--- a/src/modules/io/io_virtual/pc_create_spcvf.cpp
+++ b/src/modules/io/io_virtual/pc_create_spcvf.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_create_spcvf.cpp 2405 2015-02-13 10:34:33Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -160,7 +160,7 @@ bool CPointCloud_Create_SPCVF::On_Execute(void)
 	int							iDatasetCount = 0;
 	double						dPointCount = 0.0;
 	double						dZMin = std::numeric_limits<double>::max();
-	double						dZMax = std::numeric_limits<double>::min();
+	double						dZMax = -std::numeric_limits<double>::max();
 
 	//-----------------------------------------------------
 	sFileName		= Parameters("FILENAME")->asString();
diff --git a/src/modules/io/io_virtual/pc_create_spcvf.h b/src/modules/io/io_virtual/pc_create_spcvf.h
index ad272a9..02006da 100755
--- a/src/modules/io/io_virtual/pc_create_spcvf.h
+++ b/src/modules/io/io_virtual/pc_create_spcvf.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_create_spcvf.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_virtual/pc_get_grid_spcvf.cpp b/src/modules/io/io_virtual/pc_get_grid_spcvf.cpp
index 5fdec45..8a02aaf 100755
--- a/src/modules/io/io_virtual/pc_get_grid_spcvf.cpp
+++ b/src/modules/io/io_virtual/pc_get_grid_spcvf.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_get_grid_spcvf.cpp 2739 2015-12-17 13:24:37Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_virtual/pc_get_grid_spcvf.h b/src/modules/io/io_virtual/pc_get_grid_spcvf.h
index d7b9527..981bc94 100755
--- a/src/modules/io/io_virtual/pc_get_grid_spcvf.h
+++ b/src/modules/io/io_virtual/pc_get_grid_spcvf.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_get_grid_spcvf.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_virtual/pc_get_subset_spcvf.cpp b/src/modules/io/io_virtual/pc_get_subset_spcvf.cpp
index f5b3a4a..f819594 100755
--- a/src/modules/io/io_virtual/pc_get_subset_spcvf.cpp
+++ b/src/modules/io/io_virtual/pc_get_subset_spcvf.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_get_subset_spcvf.cpp 2841 2016-03-05 11:25:04Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -424,19 +424,29 @@ bool CPointCloud_Get_Subset_SPCVF_Base::Get_Subset(bool bCopyAttr)
 
 					if( bCopyAttr )
 					{
-						for(int iField=0; iField<pPC->Get_Attribute_Count(); iField++)
+						for (int j=0; j<pPC->Get_Attribute_Count(); j++)
 						{
-							pPC_out->Set_Attribute(iField, pPC->Get_Attribute(iPoint, iField));
+							switch (pPC->Get_Attribute_Type(j))
+							{
+							default:					pPC_out->Set_Attribute(j, pPC->Get_Attribute(iPoint, j));		break;
+							case SG_DATATYPE_Date:
+							case SG_DATATYPE_String:	CSG_String sAttr; pPC->Get_Attribute(iPoint, j, sAttr); pPC_out->Set_Attribute(j, sAttr);		break;
+							}
 						}
 					}
 					else
 					{
-						for(int iField=0; iField<(int)m_vAttrMapper.size(); iField++)
+						for(int j=0; j<(int)m_vAttrMapper.size(); j++)
 						{
-							if( iField >= pPC->Get_Attribute_Count() )
+							if( j >= pPC->Get_Attribute_Count() )
 								continue;
 
-							pPC_out->Set_Attribute(iField, pPC->Get_Attribute(iPoint, m_vAttrMapper.at(iField)));
+							switch (pPC->Get_Attribute_Type(m_vAttrMapper.at(j)))
+							{
+							default:					pPC_out->Set_Attribute(j, pPC->Get_Attribute(iPoint, m_vAttrMapper.at(j)));		break;
+							case SG_DATATYPE_Date:
+							case SG_DATATYPE_String:	CSG_String sAttr; pPC->Get_Attribute(iPoint, m_vAttrMapper.at(j), sAttr); pPC_out->Set_Attribute(j, sAttr);		break;
+							}
 						}
 					}
 
diff --git a/src/modules/io/io_virtual/pc_get_subset_spcvf.h b/src/modules/io/io_virtual/pc_get_subset_spcvf.h
index 4469f5e..ce776ec 100755
--- a/src/modules/io/io_virtual/pc_get_subset_spcvf.h
+++ b/src/modules/io/io_virtual/pc_get_subset_spcvf.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_get_subset_spcvf.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_virtual/pc_remove_overlap_from_spcvf.cpp b/src/modules/io/io_virtual/pc_remove_overlap_from_spcvf.cpp
index 936e9a8..a9b9d41 100755
--- a/src/modules/io/io_virtual/pc_remove_overlap_from_spcvf.cpp
+++ b/src/modules/io/io_virtual/pc_remove_overlap_from_spcvf.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_remove_overlap_from_spcvf.cpp 2841 2016-03-05 11:25:04Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -202,9 +202,14 @@ bool CPointCloud_Remove_Overlap_From_SPCVF::On_Execute(void)
 			{
 				pPC_out->Add_Point(pPC->Get_X(iPoint), pPC->Get_Y(iPoint), pPC->Get_Z(iPoint));
 
-				for(int iField=0; iField<pPC->Get_Attribute_Count(); iField++)
+				for (int j=0; j<pPC->Get_Attribute_Count(); j++)
 				{
-					pPC_out->Set_Attribute(iField, pPC->Get_Attribute(iPoint, iField));
+					switch (pPC->Get_Attribute_Type(j))
+					{
+					default:					pPC_out->Set_Attribute(j, pPC->Get_Attribute(iPoint, j));		break;
+					case SG_DATATYPE_Date:
+					case SG_DATATYPE_String:	CSG_String sAttr; pPC->Get_Attribute(iPoint, j, sAttr); pPC_out->Set_Attribute(j, sAttr);		break;
+					}
 				}
 			}
 		}
diff --git a/src/modules/io/io_virtual/pc_remove_overlap_from_spcvf.h b/src/modules/io/io_virtual/pc_remove_overlap_from_spcvf.h
index 107a653..6065159 100755
--- a/src/modules/io/io_virtual/pc_remove_overlap_from_spcvf.h
+++ b/src/modules/io/io_virtual/pc_remove_overlap_from_spcvf.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_remove_overlap_from_spcvf.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_virtual/pc_tileshape_from_spcvf.cpp b/src/modules/io/io_virtual/pc_tileshape_from_spcvf.cpp
index 468a325..a7686fd 100755
--- a/src/modules/io/io_virtual/pc_tileshape_from_spcvf.cpp
+++ b/src/modules/io/io_virtual/pc_tileshape_from_spcvf.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_tileshape_from_spcvf.cpp 2841 2016-03-05 11:25:04Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/io/io_virtual/pc_tileshape_from_spcvf.h b/src/modules/io/io_virtual/pc_tileshape_from_spcvf.h
index 38ecbe3..ff99a26 100755
--- a/src/modules/io/io_virtual/pc_tileshape_from_spcvf.h
+++ b/src/modules/io/io_virtual/pc_tileshape_from_spcvf.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_tileshape_from_spcvf.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/Makefile.in b/src/modules/pointcloud/Makefile.in
index 88c6be2..d496d22 100644
--- a/src/modules/pointcloud/Makefile.in
+++ b/src/modules/pointcloud/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/pointcloud
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = pointcloud_tools pointcloud_viewer
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -339,7 +360,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/pointcloud/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/pointcloud/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -634,6 +654,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp b/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp
index ba16539..76019fd 100755
--- a/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2562 2015-08-30 10:50:30Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/MLB_Interface.h b/src/modules/pointcloud/pointcloud_tools/MLB_Interface.h
index eaa2d92..d7e93e2 100755
--- a/src/modules/pointcloud/pointcloud_tools/MLB_Interface.h
+++ b/src/modules/pointcloud/pointcloud_tools/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/Makefile.in b/src/modules/pointcloud/pointcloud_tools/Makefile.in
index 809356d..36f40b5 100644
--- a/src/modules/pointcloud/pointcloud_tools/Makefile.in
+++ b/src/modules/pointcloud/pointcloud_tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/pointcloud/pointcloud_tools
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -216,6 +226,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +260,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +285,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +375,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -419,7 +439,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/pointcloud/pointcloud_tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/pointcloud/pointcloud_tools/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -734,6 +753,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp b/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp
index b384c4a..3493cdb 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_attribute_calculator.cpp 2627 2015-10-01 09:29:25Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -156,27 +156,18 @@ CPC_Attribute_Calculator::~CPC_Attribute_Calculator(void)
 //														 //
 ///////////////////////////////////////////////////////////
 
-//---------------------------------------------------------
-bool CPC_Attribute_Calculator::On_Before_Execution(void)
-{
-	if( Parameters("PC_OUT")->asPointCloud() == Parameters("PC_IN")->asPointCloud() )
-		Parameters("PC_OUT")->Set_Value(DATAOBJECT_NOTSET);
-
-	return (true);
-}
-
 
 //---------------------------------------------------------
 bool CPC_Attribute_Calculator::On_Execute(void)
 {
-	CSG_PointCloud	*pInput, *pResult;
+	CSG_PointCloud	*pPC_in, *pPC_out, PC_out;
 	TSG_Data_Type	Type;
 	bool			bUseNoData;
 
 
 	//---------------------------------------------------------
-	pInput		= Parameters("PC_IN")->asPointCloud();
-	pResult		= Parameters("PC_OUT")->asPointCloud();
+	pPC_in		= Parameters("PC_IN")->asPointCloud();
+	pPC_out		= Parameters("PC_OUT")->asPointCloud();
 	bUseNoData	= Parameters("USE_NODATA")->asBool();
 
 	switch( Parameters("TYPE")->asInt() )
@@ -194,21 +185,20 @@ bool CPC_Attribute_Calculator::On_Execute(void)
 
 
 	//-----------------------------------------------------
-	if( !pInput->is_Valid() || pInput->Get_Field_Count() <= 0 || pInput->Get_Record_Count() <= 0 )
+	if( !pPC_in->is_Valid() || pPC_in->Get_Field_Count() <= 0 || pPC_in->Get_Record_Count() <= 0 )
 	{
 		Error_Set(_TL("invalid point cloud"));
 
 		return( false );
 	}
 
-
 	//-----------------------------------------------------
 	CSG_Formula	Formula;
 
-	int		nFields		= pInput->Get_Field_Count();
+	int		nFields		= pPC_in->Get_Field_Count();
 	int		*pFields	= new int[nFields];
 
-	if( !Formula.Set_Formula(Get_Formula(Parameters("FORMULA")->asString(), pInput, pFields, nFields)) )
+	if( !Formula.Set_Formula(Get_Formula(Parameters("FORMULA")->asString(), pPC_in, pFields, nFields)) )
 	{
 		CSG_String	Message;
 
@@ -228,43 +218,42 @@ bool CPC_Attribute_Calculator::On_Execute(void)
 		return( false );
 	}
 
-	//-----------------------------------------------------
-	CSG_String		sName;
-	CSG_MetaData	History;
 
-	if (!pResult || pResult == pInput)
+	//-----------------------------------------------------
+	if (!pPC_out || pPC_out == pPC_in)
 	{
-		sName = pInput->Get_Name();
-		pResult = SG_Create_PointCloud(pInput);
-		History = pInput->Get_History();
+		pPC_out = &PC_out;
 	}
-	else
-	{
-		pResult->Create(pInput);
 
-		pResult->Set_Name(CSG_String::Format(SG_T("%s_%s"), pInput->Get_Name(), Parameters("NAME")->asString()));
-	}
+	pPC_out->Create(pPC_in);
 
-	pResult->Add_Field(Parameters("NAME")->asString(), Type);
+	pPC_out->Add_Field(Parameters("NAME")->asString(), Type);
 
 
 	//---------------------------------------------------------
 	CSG_Vector	Values(nFields);
 
-	for( int i=0; i<pInput->Get_Point_Count() && Set_Progress(i, pInput->Get_Point_Count()); i++ )
+	for( int i=0; i<pPC_in->Get_Point_Count() && Set_Progress(i, pPC_in->Get_Point_Count()); i++ )
 	{
 		bool	bOkay	= true;
 
-		pResult->Add_Point(pInput->Get_X(i), pInput->Get_Y(i), pInput->Get_Z(i));
+		pPC_out->Add_Point(pPC_in->Get_X(i), pPC_in->Get_Y(i), pPC_in->Get_Z(i));
 
-		for( int iField=2; iField<pInput->Get_Field_Count(); iField++ )
-			pResult->Set_Value(i, iField, pInput->Get_Value(i, iField));
+		for (int j=0; j<pPC_in->Get_Attribute_Count(); j++)
+		{
+			switch (pPC_in->Get_Attribute_Type(j))
+			{
+			default:					pPC_out->Set_Attribute(i, j, pPC_in->Get_Attribute(i, j));		break;
+			case SG_DATATYPE_Date:
+			case SG_DATATYPE_String:	CSG_String sAttr; pPC_in->Get_Attribute(i, j, sAttr); pPC_out->Set_Attribute(i, j, sAttr);		break;
+			}
+		}
 
 		for( int iField=0; iField<nFields && bOkay; iField++ )
 		{
-			if( !pInput->is_NoData(i, pFields[iField]) || bUseNoData )
+			if( !pPC_in->is_NoData(i, pFields[iField]) || bUseNoData )
 			{
-				Values[iField]	= pInput->Get_Value(i, pFields[iField]);
+				Values[iField]	= pPC_in->Get_Value(i, pFields[iField]);
 			}
 			else
 			{
@@ -274,33 +263,36 @@ bool CPC_Attribute_Calculator::On_Execute(void)
 
 		if( bOkay )
 		{
-			pResult->Set_Value(i, pInput->Get_Field_Count(), Formula.Get_Value(Values.Get_Data(), nFields));
+			pPC_out->Set_Value(i, pPC_in->Get_Field_Count(), Formula.Get_Value(Values.Get_Data(), nFields));
 		}
 		else
 		{
-			pResult->Set_NoData(i, pInput->Get_Field_Count());
+			pPC_out->Set_NoData(i, pPC_in->Get_Field_Count());
 		}
 	}
 
 
 	delete[](pFields);
 
+
 	//-----------------------------------------------------
-	if (!Parameters("PC_OUT")->asPointCloud() || Parameters("PC_OUT")->asPointCloud() == pInput)
+	if (pPC_out == &PC_out)
 	{
-		pInput->Assign(pResult);
-		pInput->Get_History() = History;
-		pInput->Set_Name(sName);
-		Parameters("PC_OUT")->Set_Value(pInput);
+		CSG_MetaData	History	= pPC_in->Get_History();
+		CSG_String		sName	= pPC_in->Get_Name();
 
-		delete(pResult);
+		pPC_in->Assign(pPC_out);
+
+		pPC_in->Get_History() = History;
+		pPC_in->Set_Name(sName);
+
+		Parameters("PC_OUT")->Set_Value(pPC_in);
 	}
 	else
 	{
-		DataObject_Update(pResult);
+		pPC_out->Set_Name(CSG_String::Format(SG_T("%s_%s"), pPC_in->Get_Name(), Parameters("NAME")->asString()));
 	}
 
-
 	return (true);
 
 }
@@ -357,3 +349,30 @@ int CPC_Attribute_Calculator::On_Parameter_Changed(CSG_Parameters *pParameters,
     return (true);
 
 }
+
+//---------------------------------------------------------
+bool CPC_Attribute_Calculator::On_After_Execution(void)
+{
+	CSG_PointCloud	*pPC_out	= Parameters("PC_OUT")->asPointCloud();
+
+	if (pPC_out == NULL)
+	{
+		pPC_out = Parameters("PC_IN")->asPointCloud();
+	}
+
+	DataObject_Set_Parameter(pPC_out, "DISPLAY_VALUE_AGGREGATE", 3);
+	DataObject_Set_Parameter(pPC_out, "COLORS_TYPE", 2);
+	DataObject_Set_Parameter(pPC_out, "METRIC_ATTRIB", 2);
+	DataObject_Set_Parameter(pPC_out, "METRIC_ZRANGE", pPC_out->Get_Minimum(2), pPC_out->Get_Maximum(2));
+
+	CSG_Colors	Colors;
+	Colors.Set_Default(255);
+	DataObject_Set_Colors(pPC_out, Colors);
+
+	if (pPC_out == Parameters("PC_IN")->asPointCloud())
+	{
+		Parameters("PC_OUT")->Set_Value(DATAOBJECT_NOTSET);
+	}
+
+	return (true);
+}
\ No newline at end of file
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.h b/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.h
index 33a3d0c..b50f40c 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_attribute_calculator.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -92,7 +92,6 @@ public:
 
 protected:
 
-	virtual bool				On_Before_Execution		(void);
 	virtual bool				On_Execute				(void);
 	virtual int					On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 
@@ -100,6 +99,8 @@ protected:
 private:
 
 	CSG_String					Get_Formula(CSG_String sFormula, CSG_Table *pTable, int *Fields, int &nFields);
+	
+	virtual bool				On_After_Execution(void);
 
 };
 
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp b/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp
index 89af8b4..42ab687 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_cluster_analysis.cpp 2295 2014-10-17 15:35:10Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -85,12 +85,12 @@ CPC_Cluster_Analysis::CPC_Cluster_Analysis(void)
 	Set_Author		(SG_T("Volker Wichmann (c) 2010, LASERDATA GmbH"));
 
 	Set_Description	(_TW(		
-		"Cluster Analysis for Point Clouds.\n\n"
+		"Cluster analysis for point clouds.\n\n"
 		
 		"References:\n\n"
 
-		"This module is a port of the 'Cluster Analysis for Grids' "
-		"module from the 'Imagery - Classification' module library, "
+		"This tool is a port of the 'Cluster Analysis for Grids' "
+		"module from the 'Imagery - Classification' tool library, "
 		"Copyright (C) 2003 by Olaf Conrad.\n\n"
 
 		"Iterative Minimum Distance:\n"
@@ -122,7 +122,7 @@ CPC_Cluster_Analysis::CPC_Cluster_Analysis(void)
 	Parameters.Add_PointCloud(
 		NULL	, "PC_OUT"		,_TL("Result"),
 		_TL("Output"),
-		PARAMETER_OUTPUT
+		PARAMETER_OUTPUT_OPTIONAL
 	);
 
 	Parameters.Add_Table(
@@ -156,15 +156,6 @@ CPC_Cluster_Analysis::CPC_Cluster_Analysis(void)
 		_TL("Automatically normalise attributes by standard deviation before clustering."),
 		PARAMETER_TYPE_Bool, true
 	);
-
-	if (SG_UI_Get_Window_Main())
-	{
-		Parameters.Add_Value(
-			NULL	, "UPDATEVIEW"	, _TL("Update View"),
-			_TL("Update cluster view while clustering."),
-			PARAMETER_TYPE_Bool, true
-		);
-	}
 }
 
 
@@ -180,17 +171,11 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 	int				nCluster;
 	long			nElements;
 	double			SP;
-	CSG_Parameters Parms;
-
-	m_bUpdateView = false;
 
 	//-----------------------------------------------------
 	nCluster	= Parameters("NCLUSTER")->asInt();
-	pInput		= Parameters("PC_IN")	->asPointCloud();
-	pResult		= Parameters("PC_OUT")	->asPointCloud();
-
-	if( SG_UI_Get_Window_Main() )
-		m_bUpdateView = Parameters("UPDATEVIEW")->asBool();
+	pPC_in		= Parameters("PC_IN")	->asPointCloud();
+	pPC_out		= Parameters("PC_OUT")	->asPointCloud();
 
 	//-------------------------------------------------
 	m_Features	= (int *)Parameters("FIELDS")->asPointer();
@@ -205,14 +190,18 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 
 
 	//-----------------------------------------------------
-	pResult->Create(pInput);
-	pResult->Set_Name(CSG_String::Format(SG_T("%s_cluster"), pInput->Get_Name()));
-	pResult->Add_Field(SG_T("CLUSTER"), SG_DATATYPE_Int);
-	DataObject_Update(pResult);
+	if (!pPC_out || pPC_out == pPC_in)
+	{
+		pPC_out = &PC_out;
+	}
 
-	pResult->Set_NoData_Value(-1.0);
-	clustField	= pResult->Get_Field_Count() - 1;
+	pPC_out->Create(pPC_in);
 
+	pPC_out->Add_Field(SG_T("CLUSTER"), SG_DATATYPE_Int);
+	clustField	= pPC_out->Get_Field_Count() - 1;
+
+	pPC_out->Set_NoData_Value(-1.0);
+	
 
 	//-----------------------------------------------------
 	Process_Set_Text(_TL("Initializing ..."));
@@ -220,20 +209,27 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 	for( int i=0; i<m_nFeatures; i++ )
 		vValues.push_back( std::vector<double>() );
 
-	for( int i=0; i<pInput->Get_Record_Count() && SG_UI_Process_Set_Progress(i, pInput->Get_Record_Count()); i++ )
+	for( int i=0; i<pPC_in->Get_Record_Count() && SG_UI_Process_Set_Progress(i, pPC_in->Get_Record_Count()); i++ )
 	{
-		pResult->Add_Point(pInput->Get_X(i), pInput->Get_Y(i), pInput->Get_Z(i));
+		pPC_out->Add_Point(pPC_in->Get_X(i), pPC_in->Get_Y(i), pPC_in->Get_Z(i));
 
-		for( int j=0; j<pInput->Get_Attribute_Count(); j++ )
-			pResult->Set_Attribute(i, j, pInput->Get_Attribute(i, j));
+		for (int j=0; j<pPC_in->Get_Attribute_Count(); j++)
+		{
+			switch (pPC_in->Get_Attribute_Type(j))
+			{
+			default:					pPC_out->Set_Attribute(i, j, pPC_in->Get_Attribute(i, j));		break;
+			case SG_DATATYPE_Date:
+			case SG_DATATYPE_String:	CSG_String sAttr; pPC_in->Get_Attribute(i, j, sAttr); pPC_out->Set_Attribute(i, j, sAttr);		break;
+			}
+		}
 
-		pResult->Set_NoData(i, clustField);
+		pPC_out->Set_NoData(i, clustField);
 		
 		bool bNoData = false;
 
 		for( int j=0; j<m_nFeatures; j++)
 		{
-			if( pInput->is_NoData(i, m_Features[j]) )
+			if( pPC_in->is_NoData(i, m_Features[j]) )
 			{
 				bNoData = true;
 				break;
@@ -245,35 +241,21 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 			for( int j=0; j<m_nFeatures; j++ )
 			{
 				if( Parameters("NORMALISE")->asBool() )
-					vValues.at(j).push_back( (pInput->Get_Value(i, m_Features[j]) - pInput->Get_Mean(m_Features[j])) / pInput->Get_StdDev(m_Features[j]) );
+					vValues.at(j).push_back( (pPC_in->Get_Value(i, m_Features[j]) - pPC_in->Get_Mean(m_Features[j])) / pPC_in->Get_StdDev(m_Features[j]) );
 				else
-					vValues.at(j).push_back(pInput->Get_Value(i, m_Features[j]));
+					vValues.at(j).push_back(pPC_in->Get_Value(i, m_Features[j]));
 			}
 		}
 		else
 		{
 			for( int j=0; j<m_nFeatures; j++ )
 			{
-				vValues.at(j).push_back(pInput->Get_NoData_Value());
+				vValues.at(j).push_back(pPC_in->Get_NoData_Value());
 			}
 		}
 	}
 
 
-	if( m_bUpdateView )
-	{
-		if( DataObject_Get_Parameters(pResult, Parms) && Parms("COLORS_TYPE") && Parms("METRIC_ATTRIB") && Parms("METRIC_COLORS") && Parms("METRIC_ZRANGE") )
-		{
-			Parms("COLORS_TYPE")					->Set_Value(2);			// graduated color
-			Parms("METRIC_COLORS")->asColors()		->Set_Count(nCluster);
-			Parms("METRIC_ATTRIB")					->Set_Value(clustField);
-			Parms("METRIC_ZRANGE")->asRange()		->Set_Range(0, nCluster);
-		}
-		DataObject_Set_Parameters(pResult, Parms);
-		DataObject_Update(pResult, SG_UI_DATAOBJECT_SHOW_LAST_MAP);
-	}
-
-
 	nMembers	= (int     *)SG_Malloc(nCluster * sizeof(int));
 	Variances	= (double  *)SG_Malloc(nCluster * sizeof(double));
 	Centroids	= (double **)SG_Malloc(nCluster * sizeof(double *));
@@ -284,7 +266,7 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 	}
 
 	//-------------------------------------------------
-	nElements	= pInput->Get_Point_Count();
+	nElements	= pPC_in->Get_Point_Count();
 
 	switch( Parameters("METHOD")->asInt() )
 	{
@@ -299,7 +281,7 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 	case 2:
 		SP	= MinimumDistance	(nElements, nCluster);
 
-		nElements	= pInput->Get_Point_Count();	// may have been diminished because of no data values...
+		nElements	= pPC_in->Get_Point_Count();	// may have been diminished because of no data values...
 
 		SP	= HillClimbing		(nElements, nCluster);
 		break;
@@ -314,7 +296,7 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 		{
 			for( int j=0; j<nCluster; j++ )
 			{
-				Centroids[j][iv]	= sqrt(pInput->Get_Variance(m_Features[i])) * Centroids[j][iv] + pInput->Get_Mean(m_Features[i]);
+				Centroids[j][iv]	= sqrt(pPC_in->Get_Variance(m_Features[i])) * Centroids[j][iv] + pPC_in->Get_Mean(m_Features[i]);
 			}
 
 			iv++;
@@ -324,37 +306,6 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 	Write_Result(Parameters("STATISTICS")->asTable(), nElements, nCluster, SP);
 
 	//-------------------------------------------------
-	if( DataObject_Get_Parameters(pResult, Parms) && Parms("COLORS_TYPE") && Parms("LUT") && Parms("LUT_ATTRIB") )
-	{
-		CSG_Table_Record	*pClass;
-		CSG_Table			*pLUT	= Parms("LUT")->asTable();
-
-		for( int i=0; i<nCluster; i++ )
-		{
-			if( (pClass = pLUT->Get_Record(i)) == NULL )
-			{
-				pClass	= pLUT->Add_Record();
-				pClass->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX));
-			}
-
-			pClass->Set_Value(1, CSG_String::Format(SG_T("%s %d"), _TL("Class"), i));
-			pClass->Set_Value(2, CSG_String::Format(SG_T("%s %d"), _TL("Class"), i));
-			pClass->Set_Value(3, i);
-			pClass->Set_Value(4, i);
-		}
-
-		while( pLUT->Get_Record_Count() > nCluster )
-		{
-			pLUT->Del_Record(pLUT->Get_Record_Count() - 1);
-		}
-
-		Parms("COLORS_TYPE")	->Set_Value(1);	// Color Classification Type: Lookup Table
-		Parms("LUT_ATTRIB")		->Set_Value(clustField);
-
-		DataObject_Set_Parameters(pResult, Parms);
-	}
-
-	//-------------------------------------------------
 	for( int i=0; i<nCluster; i++ )
 	{
 		SG_Free(Centroids[i]);
@@ -366,6 +317,25 @@ bool CPC_Cluster_Analysis::On_Execute(void)
 
 	vValues.clear();
 
+	//-----------------------------------------------------
+	if (pPC_out == &PC_out)
+	{
+		CSG_MetaData	History	= pPC_in->Get_History();
+		CSG_String		sName	= pPC_in->Get_Name();
+
+		pPC_in->Assign(pPC_out);
+
+		pPC_in->Get_History() = History;
+		pPC_in->Set_Name(sName);
+
+		Parameters("PC_OUT")->Set_Value(pPC_in);
+	}
+	else
+	{
+		pPC_out->Set_Name(CSG_String::Format(SG_T("%s_cluster"), pPC_in->Get_Name()));
+	}
+	
+
 	return( true );
 }
 
@@ -384,7 +354,7 @@ void CPC_Cluster_Analysis::Write_Result(CSG_Table *pTable, long nElements, int n
 
 	pTable->Destroy();
 	s	= CSG_String::Format(_TL("Cluster Analysis PC"));
-	s	+= CSG_String::Format(SG_T("_%s"), pInput->Get_Name());
+	s	+= CSG_String::Format(SG_T("_%s"), pPC_in->Get_Name());
 	pTable->Set_Name(s);
 
 	pTable->Add_Field(_TL("ClusterID")	, SG_DATATYPE_Int);
@@ -402,8 +372,8 @@ void CPC_Cluster_Analysis::Write_Result(CSG_Table *pTable, long nElements, int n
 
 	for( int j=0; j<m_nFeatures; j++ )
 	{
-		s.Append(CSG_String::Format(SG_T("\t%02d_%s"), j + 1, pInput->Get_Field_Name(m_Features[j])));
-		pTable->Add_Field(pInput->Get_Field_Name(m_Features[j]), SG_DATATYPE_Double);
+		s.Append(CSG_String::Format(SG_T("\t%02d_%s"), j + 1, pPC_in->Get_Field_Name(m_Features[j])));
+		pTable->Add_Field(pPC_in->Get_Field_Name(m_Features[j]), SG_DATATYPE_Double);
 	}
 
 	Message_Add(s);
@@ -454,33 +424,12 @@ double CPC_Cluster_Analysis::MinimumDistance(long &nElements, int nCluster)
 
 	for( iElement=0, nClusterElements=0; iElement<nElements; iElement++ )
 	{
-		/*for( iField=0, bContinue=true; iField<nFields && bContinue; iField++)
-		{
-			if( Grids[iGrid]->is_NoData(iElement) )
-			{
-				bContinue	= false;
-			}
-		}*/
-		bContinue	= true;
-
-		if( bContinue )
-		{
-			if( pResult->Get_Value(iElement, clustField) < 0 || pResult->Get_Value(iElement, clustField) >= nCluster )
-			{
-				pResult->Set_Value(iElement, clustField, iElement % nCluster);
-			}
-
-			nClusterElements++;
-		}
-		else
+		if( pPC_out->Get_Value(iElement, clustField) < 0 || pPC_out->Get_Value(iElement, clustField) >= nCluster )
 		{
-			pResult->Set_Value(iElement, clustField, -1);
+			pPC_out->Set_Value(iElement, clustField, iElement % nCluster);
 		}
-	}
 
-	if( m_bUpdateView )
-	{
-		DataObject_Update(pResult);
+		nClusterElements++;
 	}
 
 
@@ -504,9 +453,9 @@ double CPC_Cluster_Analysis::MinimumDistance(long &nElements, int nCluster)
 		//-------------------------------------------------
 		for( iElement=0; iElement<nElements; iElement++ )
 		{
-			if( pResult->Get_Value(iElement, clustField) >= 0 )
+			if( pPC_out->Get_Value(iElement, clustField) >= 0 )
 			{
-				iCluster	= (int)pResult->Get_Value(iElement, clustField);
+				iCluster	= (int)pPC_out->Get_Value(iElement, clustField);
 				nMembers[iCluster]++;
 
 				for( iField=0; iField<m_nFeatures; iField++ )
@@ -541,7 +490,7 @@ double CPC_Cluster_Analysis::MinimumDistance(long &nElements, int nCluster)
 				bContinue	= false;
 			}
 
-			if( pResult->Get_Value(iElement, clustField) >= 0 )
+			if( pPC_out->Get_Value(iElement, clustField) >= 0 )
 			{
 				minVariance	= -1;
 
@@ -562,9 +511,9 @@ double CPC_Cluster_Analysis::MinimumDistance(long &nElements, int nCluster)
 					}
 				}
 
-				if( pResult->Get_Value(iElement, clustField) != minCluster )
+				if( pPC_out->Get_Value(iElement, clustField) != minCluster )
 				{
-					pResult->Set_Value(iElement, clustField, minCluster);
+					pPC_out->Set_Value(iElement, clustField, minCluster);
 					nShifts++;
 				}
 
@@ -587,11 +536,6 @@ double CPC_Cluster_Analysis::MinimumDistance(long &nElements, int nCluster)
 		));
 
 		SP_Last		= SP;
-
-		if( m_bUpdateView )
-		{
-			DataObject_Update(pResult);
-		}
 	}
 
 	nElements	= nClusterElements;
@@ -636,43 +580,27 @@ double CPC_Cluster_Analysis::HillClimbing(long &nElements, int nCluster)
 
 	for( iElement=0, nClusterElements=0; iElement<nElements; iElement++ )
 	{
-		/*for( iField=0, bContinue=true; iField<nFields && bContinue; iField++)
-		{
-			if( Grids[iGrid]->is_NoData(iElement) )
-			{
-				bContinue	= false;
-			}
-		}*/
-		bContinue	= true;
-
-		if( bContinue )
+		if( pPC_out->Get_Value(iElement, clustField) < 0 || pPC_out->Get_Value(iElement, clustField) >= nCluster )
 		{
-			if( pResult->Get_Value(iElement, clustField) < 0 || pResult->Get_Value(iElement, clustField) >= nCluster )
-			{
-				pResult->Set_Value(iElement, clustField, iElement % nCluster);
-			}
+			pPC_out->Set_Value(iElement, clustField, iElement % nCluster);
+		}
 
-			nClusterElements++;
+		nClusterElements++;
 		
-			iCluster	= (int)pResult->Get_Value(iElement, clustField);
+		iCluster	= (int)pPC_out->Get_Value(iElement, clustField);
 
-			nMembers[iCluster]++;
+		nMembers[iCluster]++;
 
-			V			= 0.0;
+		V			= 0.0;
 
-			for( iField=0; iField<m_nFeatures; iField++)
-			{
-				d							 = vValues.at(iField).at(iElement);
-				Centroids[iCluster][iField]	+= d;
-				V							+= d * d;
-			}
-
-			Variances[iCluster]	+= V;
-		}
-		else
+		for( iField=0; iField<m_nFeatures; iField++)
 		{
-			pResult->Set_Value(iElement, clustField, -1);
+			d							 = vValues.at(iField).at(iElement);
+			Centroids[iCluster][iField]	+= d;
+			V							+= d * d;
 		}
+
+		Variances[iCluster]	+= V;
 	}
 
 
@@ -696,11 +624,6 @@ double CPC_Cluster_Analysis::HillClimbing(long &nElements, int nCluster)
 		SP					+= Variances[iCluster];
 	}
 
-	if( m_bUpdateView )
-	{
-		DataObject_Update(pResult);
-	}
-
 
 	//-----------------------------------------------------
 	// Hauptschleife der Iteration
@@ -717,7 +640,7 @@ double CPC_Cluster_Analysis::HillClimbing(long &nElements, int nCluster)
 				bContinue	= false;
 			}
 
-			if( pResult->Get_Value(iElement, clustField) >= 0 )
+			if( pPC_out->Get_Value(iElement, clustField) >= 0 )
 			{
 				if( noShift++ >= nElements )
 				{
@@ -727,7 +650,7 @@ double CPC_Cluster_Analysis::HillClimbing(long &nElements, int nCluster)
 				{
 
 					//---------------------------------------------
-					iCluster	= (int)pResult->Get_Value(iElement, clustField);
+					iCluster	= (int)pPC_out->Get_Value(iElement, clustField);
 
 					if( nMembers[iCluster] > 1 )
 					{
@@ -790,7 +713,7 @@ double CPC_Cluster_Analysis::HillClimbing(long &nElements, int nCluster)
 								Centroids[kCluster][iField]	= (n_jK * Centroids[kCluster][iField] + d) * V2;
 							}
 
-							pResult->Set_Value(iElement, clustField, kCluster);
+							pPC_out->Set_Value(iElement, clustField, kCluster);
 
 							nMembers[iCluster]--;
 							nMembers[kCluster]++;
@@ -806,11 +729,6 @@ double CPC_Cluster_Analysis::HillClimbing(long &nElements, int nCluster)
 		));
 
 		SP_Last		= SP;
-
-		if( m_bUpdateView )
-		{
-			DataObject_Update(pResult);
-		}
 	}
 
 	nElements	= nClusterElements;
@@ -818,6 +736,56 @@ double CPC_Cluster_Analysis::HillClimbing(long &nElements, int nCluster)
 	return( SP );
 }
 
+//---------------------------------------------------------
+bool CPC_Cluster_Analysis::On_After_Execution(void)
+{
+	CSG_PointCloud	*pPC_out	= Parameters("PC_OUT")->asPointCloud();
+
+	if (pPC_out == NULL)
+	{
+		pPC_out = Parameters("PC_IN")->asPointCloud();
+	}
+
+	CSG_Parameters	Parms;
+
+	if( DataObject_Get_Parameters(pPC_out, Parms) && Parms("COLORS_TYPE") && Parms("LUT") && Parms("LUT_ATTRIB") )
+	{
+		CSG_Table_Record	*pClass;
+		CSG_Table			*pLUT	= Parms("LUT")->asTable();
+
+		for( int i=0; i<=pPC_out->Get_Maximum(pPC_out->Get_Field_Count()-1); i++ )
+		{
+			if( (pClass = pLUT->Get_Record(i)) == NULL )
+			{
+				pClass	= pLUT->Add_Record();
+				pClass->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX));
+			}
+
+			pClass->Set_Value(1, CSG_String::Format(SG_T("%s %d"), _TL("Class"), i));
+			pClass->Set_Value(2, CSG_String::Format(SG_T("%s %d"), _TL("Class"), i));
+			pClass->Set_Value(3, i);
+			pClass->Set_Value(4, i);
+		}
+
+		while( pLUT->Get_Record_Count() > (pPC_out->Get_Maximum(pPC_out->Get_Field_Count()-1) + 1) )
+		{
+			pLUT->Del_Record(pLUT->Get_Record_Count() - 1);
+		}
+
+		Parms("COLORS_TYPE")	->Set_Value(1);	// Color Classification Type: Lookup Table
+		Parms("LUT_ATTRIB")		->Set_Value(clustField);
+
+		DataObject_Set_Parameters(pPC_out, Parms);
+	}
+
+
+	if (pPC_out == Parameters("PC_IN")->asPointCloud())
+	{
+		Parameters("PC_OUT")->Set_Value(DATAOBJECT_NOTSET);
+	}
+
+	return (true);
+}
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.h b/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.h
index e1338ef..3940282 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_cluster_analysis.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -96,13 +96,11 @@ protected:
 
 private:
 
-	bool					m_bUpdateView;
-
 	int						*m_Features, m_nFeatures, clustField, *nMembers;
 
 	double					**Centroids, *Variances;
 
-	CSG_PointCloud			*pInput, *pResult;
+	CSG_PointCloud			*pPC_in, *pPC_out, PC_out;
 
 	std::vector< std::vector<double> >	vValues;	
 
@@ -111,6 +109,8 @@ private:
 	double					MinimumDistance	(long &nElements, int nCluster);
 	double					HillClimbing	(long &nElements, int nCluster);
 
+	virtual bool			On_After_Execution(void);
+
 };
 
 #endif // #ifndef HEADER_INCLUDED__PC_Cluster_Analysis_H
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp b/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp
index fa42eb9..61a8a8e 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_cut.cpp 2427 2015-02-26 16:24:53Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -80,7 +80,7 @@ CPC_Cut::CPC_Cut(void)
 	Set_Author		(SG_T("O. Conrad, V. Wichmann (c) 2009-15"));
 
 	Set_Description	(_TW(
-		"This modules allows one to extract subsets from one or several "
+		"This tool allows one to extract subsets from one or several "
 		"point cloud datasets. The area-of-interest "
 		"is defined either by bounding box coordinates, the extent of a grid system or "
 		"a shapes layer, or by polygons of a shapes layer. Note that the latter "
@@ -255,9 +255,14 @@ bool CPC_Cut::Get_Cut(CSG_Parameter_PointCloud_List *pPointsList, CSG_Parameter_
 					{
 						pCut->Add_Point(pPoints->Get_X(), pPoints->Get_Y(), pPoints->Get_Z());
 
-						for(int j=0; j<pPoints->Get_Field_Count() - 3; j++)
+						for (int j=0; j<pPoints->Get_Attribute_Count(); j++)
 						{
-							pCut->Set_Attribute(j, pPoints->Get_Attribute(j));
+							switch (pPoints->Get_Attribute_Type(j))
+							{
+							default:					pCut->Set_Attribute(j, pPoints->Get_Attribute(i, j));		break;
+							case SG_DATATYPE_Date:
+							case SG_DATATYPE_String:	CSG_String sAttr; pPoints->Get_Attribute(i, j, sAttr); pCut->Set_Attribute(j, sAttr);		break;
+							}
 						}
 					}
 				}
@@ -306,9 +311,14 @@ bool CPC_Cut::Get_Cut(CSG_Parameter_PointCloud_List *pPointsList, CSG_Parameter_
 					{
 						pCut->Add_Point(pPoints->Get_X(), pPoints->Get_Y(), pPoints->Get_Z());
 
-						for(int j=0; j<pPoints->Get_Field_Count() - 3; j++)
+						for (int j=0; j<pPoints->Get_Attribute_Count(); j++)
 						{
-							pCut->Set_Attribute(j, pPoints->Get_Attribute(j));
+							switch (pPoints->Get_Attribute_Type(j))
+							{
+							default:					pCut->Set_Attribute(j, pPoints->Get_Attribute(i, j));		break;
+							case SG_DATATYPE_Date:
+							case SG_DATATYPE_String:	CSG_String sAttr; pPoints->Get_Attribute(i, j, sAttr); pCut->Set_Attribute(j, sAttr);		break;
+							}
 						}
 					}
 				}
@@ -367,10 +377,10 @@ CPC_Cut_Interactive::CPC_Cut_Interactive(void)
 	Set_Author		(SG_T("O. Conrad, V. Wichmann (c) 2009-15"));
 
 	Set_Description	(_TW(
-		"This modules allows one to extract subsets from one or several "
+		"This tool allows one to extract subsets from one or several "
 		"point cloud datasets. The area-of-interest "
 		"is interactively defined either by dragging a box or by digitizing a polygon.\n"
-		"Best practice is to display the Point Cloud in a new Map View first and then "
+		"Best practice is to display the point cloud in a new Map View first and then "
 		"execute the module. Use the Action tool to define the AOI.\n\n"
 	));
 
@@ -442,8 +452,10 @@ bool CPC_Cut_Interactive::On_Execute(void)
 			DataObject_Add(m_pAOI, true);
 		}
 		else if( m_pAOI->Get_Field_Count() < 1)
+		{
+			m_pAOI->Destroy();
 			m_pAOI->Add_Field("ID", SG_DATATYPE_Int);
-
+		}
 
 		CSG_Parameters	sParms;
 		if( DataObject_Get_Parameters(m_pAOI, sParms) && sParms("DISPLAY_BRUSH") && sParms("OUTLINE_COLOR"))
@@ -455,8 +467,20 @@ bool CPC_Cut_Interactive::On_Execute(void)
 		}
 	}
 	else
+	{
+		if( m_pAOI != NULL )
+		{
+			m_pAOI->Destroy();
+			m_pAOI->Add_Field("ID", SG_DATATYPE_Int);
+		}
+
 		Set_Drag_Mode(MODULE_INTERACTIVE_DRAG_BOX);
+	}
 
+	if( m_pAOI != NULL )
+	{
+		m_pAOI->Set_Name(_TL("AOI_Cutter"));
+	}
 
 	//-----------------------------------------------------
 	return( true );
@@ -513,6 +537,18 @@ bool CPC_Cut_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Inte
 				);
 
 				CPC_Cut::Get_Cut(m_pPointsList, m_pCutList, r, m_bInverse);
+
+				if( m_pAOI != NULL )
+				{
+					m_pAOI	->Del_Records();
+					m_pAOI	->Add_Shape();
+
+					m_pAOI->Get_Shape(0)->Add_Point(r.Get_XMin(), r.Get_YMin());
+					m_pAOI->Get_Shape(0)->Add_Point(r.Get_XMin(), r.Get_YMax());
+					m_pAOI->Get_Shape(0)->Add_Point(r.Get_XMax(), r.Get_YMax());
+					m_pAOI->Get_Shape(0)->Add_Point(r.Get_XMax(), r.Get_YMin());
+					m_pAOI->Get_Shape(0)->Add_Point(r.Get_XMin(), r.Get_YMin());
+				}
 			}
 
 			return( true );
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_cut.h b/src/modules/pointcloud/pointcloud_tools/pc_cut.h
index 4d58b02..be08184 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_cut.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_cut.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_cut.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp b/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp
index ead1b0f..474195b 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_drop_attribute.cpp 2891 2016-04-13 12:33:23Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -167,7 +167,12 @@ bool CPC_Drop_Attribute::On_Execute(void)
 				continue;
 			}
 
-			pOutput->Set_Attribute(k, pInput->Get_Attribute(i, j));
+			switch (pInput->Get_Attribute_Type(j))
+			{
+			default:					pOutput->Set_Attribute(k, pInput->Get_Attribute(i, j));		break;
+			case SG_DATATYPE_Date:
+			case SG_DATATYPE_String:	CSG_String sAttr; pInput->Get_Attribute(i, j, sAttr); pOutput->Set_Attribute(k, sAttr);		break;
+			}
 		}
 	}
 
@@ -181,6 +186,8 @@ bool CPC_Drop_Attribute::On_Execute(void)
 
 		pInput->Get_History() = History;
 		pInput->Set_Name(Name);
+
+		Parameters("OUTPUT")->Set_Value(pInput);
 	}
 	else
 	{
@@ -210,10 +217,18 @@ bool CPC_Drop_Attribute::On_After_Execution(void)
 	DataObject_Set_Parameter(pOutput, "METRIC_COLORS"          , 12);	// number of colors
 	DataObject_Set_Parameter(pOutput, "COLORS_TYPE"            ,  3);	// graduated color
 	DataObject_Set_Parameter(pOutput, "METRIC_ATTRIB"          ,  2);	// z attrib
-	DataObject_Set_Parameter(pOutput, "METRIC_ZRANGE", 100, 300);
+	DataObject_Set_Parameter(pOutput, "METRIC_ZRANGE",
+		pOutput->Get_Mean(2) - 2.0 * pOutput->Get_StdDev(2),
+		pOutput->Get_Mean(2) + 2.0 * pOutput->Get_StdDev(2)
+	);
 
 	DataObject_Set_Colors(pOutput, 11, SG_COLORS_RAINBOW);
 
+	if( pOutput == Parameters("INPUT")->asPointCloud() )
+	{
+		Parameters("OUTPUT")->Set_Value(DATAOBJECT_NOTSET);
+	}
+
 	return( true );
 }
 
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h b/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h
index f2bd135..8196a80 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_drop_attribute.h 2891 2016-04-13 12:33:23Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_grid.cpp b/src/modules/pointcloud/pointcloud_tools/pc_from_grid.cpp
index 8850a94..c7f0278 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_grid.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_grid.h b/src/modules/pointcloud/pointcloud_tools/pc_from_grid.h
index 9d47d05..a6f29b8 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_grid.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_grid.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp b/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp
index 39320a4..88be5fa 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_shapes.cpp 2570 2015-09-03 10:16:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h b/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
index c97777d..6f5d539 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_shapes.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_table.cpp b/src/modules/pointcloud/pointcloud_tools/pc_from_table.cpp
index d94e725..abde9f7 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_table.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_table.cpp 2570 2015-09-03 10:16:20Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_table.h b/src/modules/pointcloud/pointcloud_tools/pc_from_table.h
index 2f2157c..e4bd69f 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_table.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_table.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_merge.cpp b/src/modules/pointcloud/pointcloud_tools/pc_merge.cpp
index 8d2c112..b2fdc6a 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_merge.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_merge.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_merge.cpp 2608 2015-09-27 12:54:38Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -76,7 +76,7 @@ CPC_Merge::CPC_Merge(void)
 
 	Set_Author		(SG_T("Magnus Bremer (c) 2012"));
 
-	Set_Description	(_TW("The module can be used to merge Point Clouds.\n"
+	Set_Description	(_TW("The module can be used to merge point clouds.\n"
 						 "The attribute fields of the merged point cloud resemble those "
 						 "of the main point cloud. In order to merge the attributes of the "
 						 "additional point cloud layers, these must be consistent "
@@ -166,7 +166,12 @@ bool CPC_Merge::On_Execute(void)
 
 		for(int iField=0; iField<pMain->Get_Attribute_Count(); iField++)
 		{
-			pResult->Set_Attribute(iAccept, iField, pMain->Get_Attribute(i, iField));
+			switch (pMain->Get_Attribute_Type(iField))
+			{
+			default:					pResult->Set_Attribute(iAccept, iField, pMain->Get_Attribute(i, iField));		break;
+			case SG_DATATYPE_Date:
+			case SG_DATATYPE_String:	CSG_String sAttr; pMain->Get_Attribute(i, iField, sAttr); pResult->Set_Attribute(iAccept, iField, sAttr);		break;
+			}
 		}
 
 		if( bID )
@@ -213,7 +218,14 @@ bool CPC_Merge::On_Execute(void)
 						for(int iField=0; iField<pMain->Get_Attribute_Count(); iField++)
 						{
 							if( FieldMapping[iField] > -1 )
-								pResult->Set_Attribute(iAccept, iField, pAdd->Get_Attribute(i, FieldMapping[iField]));
+							{
+								switch (pAdd->Get_Attribute_Type(iField))
+								{
+								default:					pResult->Set_Attribute(iAccept, iField, pAdd->Get_Attribute(i, FieldMapping[iField]));		break;
+								case SG_DATATYPE_Date:
+								case SG_DATATYPE_String:	CSG_String sAttr; pAdd->Get_Attribute(i, FieldMapping[iField], sAttr); pResult->Set_Attribute(iAccept, iField, sAttr);		break;
+								}
+							}
 							else
 								pResult->Set_Attribute(iAccept, iField, pMain->Get_NoData_Value());
 						}
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_merge.h b/src/modules/pointcloud/pointcloud_tools/pc_merge.h
index b631c58..3151c71 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_merge.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_merge.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_merge.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp b/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp
index 5316cd6..51e1717 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_reclass_extract.cpp 2561 2015-08-27 08:10:41Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -668,7 +668,14 @@ void CPC_Reclass_Extract::Set_Value(int i, double value)
 	m_pResult->Add_Point(m_pInput->Get_X(i), m_pInput->Get_Y(i), m_pInput->Get_Z(i));
 
 	for (int j=0; j<m_pInput->Get_Attribute_Count(); j++)
-		m_pResult->Set_Attribute(j, m_pInput->Get_Attribute(i, j));
+	{
+		switch (m_pInput->Get_Attribute_Type(j))
+		{
+		default:					m_pResult->Set_Attribute(j, m_pInput->Get_Attribute(i, j));		break;
+		case SG_DATATYPE_Date:
+		case SG_DATATYPE_String:	CSG_String sAttr; m_pInput->Get_Attribute(i, j, sAttr); m_pResult->Set_Attribute(j, sAttr);		break;
+		}
+	}
 
 	if (!m_bExtract)
 	{
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h b/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h
index 41ab7cd..04a8299 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_reclass_extract.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.cpp b/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.cpp
index 3568bb2..783d1f4 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_thinning_simple.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -127,8 +127,8 @@ bool CPC_Thinning_Simple::On_Execute(void)
 
 
 	pResult->Create(pInput);
-	pResult->Set_Name(CSG_String::Format(SG_T("%s_thinned"), pInput->Get_Name()));
 	pResult->Assign(pInput);
+	pResult->Set_Name(CSG_String::Format(SG_T("%s_thinned"), pInput->Get_Name()));
 
 	for (int i=step; i<pInput->Get_Point_Count() && Set_Progress(i, pInput->Get_Point_Count()); i+=step)
 	{
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.h b/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.h
index b26216e..d499b00 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_thinning_simple.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_to_grid.cpp b/src/modules/pointcloud/pointcloud_tools/pc_to_grid.cpp
index c1f120a..65adf4b 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_to_grid.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_to_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_to_grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_to_grid.h b/src/modules/pointcloud/pointcloud_tools/pc_to_grid.h
index 8e323fc..e63fede 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_to_grid.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_to_grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_to_grid.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.cpp b/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.cpp
index 2b08f52..6a4047b 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_to_shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -132,7 +132,12 @@ bool CPC_To_Shapes::On_Execute(void)
 
 		for(iField=2; iField<pPoints->Get_Field_Count(); iField++)
 		{
-			pShape->Set_Value(iField - 2, pPoints->Get_Value(iField));
+			switch (pPoints->Get_Field_Type(iField))
+			{
+			default:					pShape->Set_Value(iField - 2, pPoints->Get_Value(iField));		break;
+			case SG_DATATYPE_Date:
+			case SG_DATATYPE_String:	CSG_String sAttr; pPoints->Get_Value(iField, sAttr); pShape->Set_Value(iField - 2, sAttr);		break;
+			}
 		}
 	}
 
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.h b/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.h
index e1fbadf..df9a45c 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_to_shapes.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_transform.cpp b/src/modules/pointcloud/pointcloud_tools/pc_transform.cpp
index a061093..cdadbf3 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_transform.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_transform.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_transform.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -283,8 +283,15 @@ bool CPC_Transform::On_Execute(void)
 
 		pOut->Add_Point(Q.x, Q.y, Q.z);
 
-		for (int iField=0; iField<pIn->Get_Attribute_Count(); iField++)
-			pOut->Set_Attribute(iPoint, iField, pIn->Get_Attribute(iPoint, iField));
+		for (int j=0; j<pIn->Get_Attribute_Count(); j++)
+		{
+			switch (pIn->Get_Attribute_Type(j))
+			{
+			default:					pOut->Set_Attribute(iPoint, j, pIn->Get_Attribute(iPoint, j));		break;
+			case SG_DATATYPE_Date:
+			case SG_DATATYPE_String:	CSG_String sAttr; pIn->Get_Attribute(iPoint, j, sAttr); pOut->Set_Attribute(iPoint, j, sAttr);		break;
+			}
+		}
 	}
 
 	//-----------------------------------------------------
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_transform.h b/src/modules/pointcloud/pointcloud_tools/pc_transform.h
index 8cdb179..19f494c 100755
--- a/src/modules/pointcloud/pointcloud_tools/pc_transform.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_transform.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_transform.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.cpp b/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.cpp
index b2b7a6d..094194a 100755
--- a/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.cpp
+++ b/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2289 2014-10-16 13:45:05Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.h b/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.h
index 7d7996e..6624798 100755
--- a/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.h
+++ b/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/Makefile.in b/src/modules/pointcloud/pointcloud_viewer/Makefile.in
index ddb0024..763c1ac 100644
--- a/src/modules/pointcloud/pointcloud_viewer/Makefile.in
+++ b/src/modules/pointcloud/pointcloud_viewer/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/pointcloud/pointcloud_viewer
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -215,6 +225,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -248,6 +259,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -266,6 +284,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -355,6 +374,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -400,7 +420,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/pointcloud/pointcloud_viewer/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/pointcloud/pointcloud_viewer/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -706,6 +725,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp b/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp
index 4885fa6..68a1522 100755
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_control.cpp 2052 2014-03-12 14:47:06Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_control.h b/src/modules/pointcloud/pointcloud_viewer/points_view_control.h
index 1b12407..4eff1bd 100755
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_control.h
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_control.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp b/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp
index 7179b97..ad34839 100755
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_dialog.cpp 1928 2014-01-10 12:10:05Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.h b/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.h
index c0874cf..d4ccb4b 100755
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.h
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_dialog.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_extent.cpp b/src/modules/pointcloud/pointcloud_viewer/points_view_extent.cpp
index 4d682fe..6403bdd 100755
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_extent.cpp
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_extent.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_extent.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_extent.h b/src/modules/pointcloud/pointcloud_viewer/points_view_extent.h
index 457b42d..d5de304 100755
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_extent.h
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_extent.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_extent.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_module.cpp b/src/modules/pointcloud/pointcloud_viewer/points_view_module.cpp
index dbc6338..4879419 100755
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_module.cpp
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_module.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_module.cpp 2289 2014-10-16 13:45:05Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_viewer/points_view_module.h b/src/modules/pointcloud/pointcloud_viewer/points_view_module.h
index 86d5ce3..662ed9a 100755
--- a/src/modules/pointcloud/pointcloud_viewer/points_view_module.h
+++ b/src/modules/pointcloud/pointcloud_viewer/points_view_module.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: points_view_module.h 2158 2014-06-12 12:30:42Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/Makefile.in b/src/modules/projection/Makefile.in
index 143194d..80f19c1 100644
--- a/src/modules/projection/Makefile.in
+++ b/src/modules/projection/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/projection
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/projection/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/projection/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/projection/pj_georeference/Makefile.in b/src/modules/projection/pj_georeference/Makefile.in
index c996f6b..b8615bf 100644
--- a/src/modules/projection/pj_georeference/Makefile.in
+++ b/src/modules/projection/pj_georeference/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/projection/pj_georeference
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -407,7 +427,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/projection/pj_georeference/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/projection/pj_georeference/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -716,6 +735,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/projection/pj_georeference/set_grid_georeference.cpp b/src/modules/projection/pj_georeference/set_grid_georeference.cpp
index ac81286..f9692e9 100755
--- a/src/modules/projection/pj_georeference/set_grid_georeference.cpp
+++ b/src/modules/projection/pj_georeference/set_grid_georeference.cpp
@@ -74,7 +74,7 @@ CSet_Grid_Georeference::CSet_Grid_Georeference(void)
 	//-----------------------------------------------------
 	Set_Name		(_TL("Define Georeference for Grids"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2013"));
+	Set_Author		("O.Conrad (c) 2013");
 
 	Set_Description	(_TW(
 		"This tool simply allows definition of grid's cellsize and position. "
@@ -97,76 +97,84 @@ CSet_Grid_Georeference::CSet_Grid_Georeference(void)
 	);
 
 	//-----------------------------------------------------
+	CSG_Parameter	*pNode;
+
 	Parameters.Add_Choice(
-		NULL	, "DEFINITION"	,_TL("Definition"),
+		NULL	, "DEFINITION"	, _TL("Definition"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"),
-			_TL("cellsize and lower left center coordinates"),
-			_TL("cellsize and lower left corner coordinates"),
-			_TL("cellsize and upper left center coordinates"),
-			_TL("cellsize and upper left corner coordinates"),
-			_TL("lower left and upper right center coordinates"),
-			_TL("lower left and upper right corner coordinates")
+		CSG_String::Format("%s|%s|%s|%s|",
+			_TL("cellsize and lower left cell coordinates"),
+			_TL("cellsize and upper left cell coordinates"),
+			_TL("lower left cell coordinates and left to right range"),
+			_TL("lower left cell coordinates and lower to upper range")
 		), 0
 	);
 
-	Parameters.Add_Value(
-		NULL	, "SIZE"		, _TL("Cellsize"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	Parameters.Add_Value(
-		NULL	, "XMIN"		, _TL("Left"),
-		_TL(""),
-		PARAMETER_TYPE_Double
+	pNode	= Parameters.Add_Grid_System(
+		NULL	, "SYSTEM"		, _TL("Grid System"),
+		_TL("")
 	);
 
-	Parameters.Add_Value(
-		NULL	, "YMIN"		, _TL("Lower"),
-		_TL(""),
-		PARAMETER_TYPE_Double
-	);
+	Parameters.Add_Double(pNode, "SIZE", _TL("Cellsize"), _TL(""), 1.0, 0.0, true);
 
-	Parameters.Add_Value(
-		NULL	, "XMAX"		, _TL("Right"),
-		_TL(""),
-		PARAMETER_TYPE_Double
-	);
+	Parameters.Add_Double(pNode, "XMIN", _TL("Left"    ), _TL(""));
+	Parameters.Add_Double(pNode, "XMAX", _TL("Right"   ), _TL(""));
+	Parameters.Add_Double(pNode, "YMIN", _TL("Lower"   ), _TL(""));
+	Parameters.Add_Double(pNode, "YMAX", _TL("Upper"   ), _TL(""));
 
-	Parameters.Add_Value(
-		NULL	, "YMAX"		, _TL("Upper"),
+	Parameters.Add_Choice(
+		pNode	, "CELL_REF"	, _TL("Cell Reference"),
 		_TL(""),
-		PARAMETER_TYPE_Double
+		CSG_String::Format("%s|%s|",
+			_TL("center"),
+			_TL("corner")
+		), 0
 	);
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+int CSet_Grid_Georeference::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	return( CSG_Module_Grid::On_Parameter_Changed(pParameters, pParameter) );
+}
+
+//---------------------------------------------------------
 int CSet_Grid_Georeference::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
 {
-	if( !SG_STR_CMP(pParameter->Get_Identifier(), "DEFINITION") )
+	CSG_Grid_System	System	= *pParameters->Get_Parameter("SYSTEM")->asGrid_System();
+
+	if( System.is_Valid() )
+	{
+		pParameters->Set_Enabled("SIZE"    , false);
+		pParameters->Set_Enabled("XMIN"    , false);
+		pParameters->Set_Enabled("YMIN"    , false);
+		pParameters->Set_Enabled("XMAX"    , false);
+		pParameters->Set_Enabled("YMAX"    , false);
+		pParameters->Set_Enabled("CELL_REF", false);
+	}
+	else
 	{
-		pParameters->Get_Parameter("SIZE")->Set_Enabled(pParameter->asInt()  < 4);
-		pParameters->Get_Parameter("XMAX")->Set_Enabled(pParameter->asInt() >= 4);
-		pParameters->Get_Parameter("YMAX")->Set_Enabled(pParameter->asInt() >= 2);
-		pParameters->Get_Parameter("YMIN")->Set_Enabled(pParameter->asInt() >= 4 || pParameter->asInt() < 2);
+		int	Definition	= pParameters->Get_Parameter("DEFINITION")->asInt();
+
+		pParameters->Set_Enabled("SIZE"    , Definition <  2);
+		pParameters->Set_Enabled("XMIN"    , true);
+		pParameters->Set_Enabled("YMIN"    , Definition == 0 || Definition >= 2);
+		pParameters->Set_Enabled("XMAX"    , Definition == 2);
+		pParameters->Set_Enabled("YMAX"    , Definition == 1 || Definition == 3);
+		pParameters->Set_Enabled("CELL_REF", true);
 	}
 
-	return( 1 );
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -181,50 +189,42 @@ bool CSet_Grid_Georeference::On_Execute(void)
 	}
 
 	//-----------------------------------------------------
-	double	xMin, yMin, size;
+	CSG_Grid_System	System	= *Parameters("SYSTEM")->asGrid_System();
 
-	switch( Parameters("DEFINITION")->asInt() )
-	{
-	case 0:	// cellsize and lower left center coordinates
-		size	= Parameters("SIZE")->asDouble();
-		xMin	= Parameters("XMIN")->asDouble();
-		yMin	= Parameters("YMIN")->asDouble();
-		break;
+	double	size	= System.is_Valid() ? System.Get_Cellsize() : Parameters("SIZE")->asDouble();
+	double	xMin	= System.is_Valid() ? System.Get_XMin    () : Parameters("XMIN")->asDouble();
+	double	yMin	= System.is_Valid() ? System.Get_YMin    () : Parameters("YMIN")->asDouble();
+	double	xMax	= System.is_Valid() ? System.Get_XMax    () : Parameters("XMAX")->asDouble();
+	double	yMax	= System.is_Valid() ? System.Get_YMax    () : Parameters("YMAX")->asDouble();
 
-	case 1:	// cellsize and lower left corner coordinates
-		size	= Parameters("SIZE")->asDouble();
-		xMin	= Parameters("XMIN")->asDouble() + size * 0.5;
-		yMin	= Parameters("YMIN")->asDouble() + size * 0.5;
-		break;
+	if( !System.is_Valid() && Parameters("CELL_REF")->asInt() == 1 )	// corner to center coordinates
+	{
+		xMin	+= 0.5 * size;
+		yMin	+= 0.5 * size;
+		xMax	-= 0.5 * size;
+		yMax	-= 0.5 * size;
+	}
 
-	case 2:	// cellsize and upper left center coordinates
-		size	= Parameters("SIZE")->asDouble();
-		xMin	= Parameters("XMIN")->asDouble();
-		yMin	= Parameters("YMAX")->asDouble() - size * Get_NY();
+	//-----------------------------------------------------
+	switch( Parameters("DEFINITION")->asInt() )
+	{
+	case 0:	// cellsize and lower left cell coordinates
 		break;
 
-	case 3:	// cellsize and upper left corner coordinates
-		size	= Parameters("SIZE")->asDouble();
-		xMin	= Parameters("XMIN")->asDouble() + size * 0.5;
-		yMin	= Parameters("YMAX")->asDouble() - size * (0.5 + Get_NY());
+	case 1:	// cellsize and upper left cell coordinates
+		yMin	= yMax - size * Get_NY();
 		break;
 
-	case 4:	// lower left and upper right center coordinates
-		size	= (Parameters("XMAX")->asDouble() - Parameters("XMIN")->asDouble()) / Get_NX();
-		xMin	= Parameters("XMIN")->asDouble();
-		yMin	= Parameters("YMIN")->asDouble();
+	case 2:	// lower left cell coordinates and left to right range
+		size	= (xMax - xMin) / Get_NX();
 		break;
 
-	case 5:	// lower left and upper right corner coordinates
-		size	= (Parameters("XMAX")->asDouble() - Parameters("XMIN")->asDouble()) / (Get_NX() + 1);
-		xMin	= Parameters("XMIN")->asDouble() + size * 0.5;
-		yMin	= Parameters("YMIN")->asDouble() + size * 0.5;
+	case 3:	// lower left cell coordinates and lower to upper range
+		size	= (yMax - yMin) / Get_NY();
 		break;
 	}
 
 	//-----------------------------------------------------
-	CSG_Grid_System	System;
-
 	if( !System.Assign(size, xMin, yMin, Get_NX(), Get_NY()) )
 	{
 		return( false );
diff --git a/src/modules/projection/pj_georeference/set_grid_georeference.h b/src/modules/projection/pj_georeference/set_grid_georeference.h
index 5aa71d1..deec4a3 100755
--- a/src/modules/projection/pj_georeference/set_grid_georeference.h
+++ b/src/modules/projection/pj_georeference/set_grid_georeference.h
@@ -88,6 +88,7 @@ public:
 
 protected:
 
+	virtual int			On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 	virtual int			On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 
 	virtual bool		On_Execute				(void);
diff --git a/src/modules/projection/pj_proj4/MLB_Interface.cpp b/src/modules/projection/pj_proj4/MLB_Interface.cpp
index 280991a..b04ea2f 100755
--- a/src/modules/projection/pj_proj4/MLB_Interface.cpp
+++ b/src/modules/projection/pj_proj4/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2462 2015-03-27 16:29:25Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/MLB_Interface.h b/src/modules/projection/pj_proj4/MLB_Interface.h
index 3b92815..5b492be 100755
--- a/src/modules/projection/pj_proj4/MLB_Interface.h
+++ b/src/modules/projection/pj_proj4/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/Makefile.am b/src/modules/projection/pj_proj4/Makefile.am
index 13c40ac..e44f3a3 100755
--- a/src/modules/projection/pj_proj4/Makefile.am
+++ b/src/modules/projection/pj_proj4/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 DEP_LIBS = -lproj
 if DEBUG
diff --git a/src/modules/projection/pj_proj4/Makefile.in b/src/modules/projection/pj_proj4/Makefile.in
index 705f767..7dea6b4 100644
--- a/src/modules/projection/pj_proj4/Makefile.in
+++ b/src/modules/projection/pj_proj4/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/projection/pj_proj4
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -216,6 +226,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +260,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +285,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +375,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -366,7 +386,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 DEP_LIBS = -lproj
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
@@ -424,7 +444,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/projection/pj_proj4/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/projection/pj_proj4/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -740,6 +759,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/projection/pj_proj4/PROJ4_Base.cpp b/src/modules/projection/pj_proj4/PROJ4_Base.cpp
index f6f556d..e900969 100755
--- a/src/modules/projection/pj_proj4/PROJ4_Base.cpp
+++ b/src/modules/projection/pj_proj4/PROJ4_Base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: PROJ4_Base.cpp 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/PROJ4_Base.h b/src/modules/projection/pj_proj4/PROJ4_Base.h
index 9130b48..1cf7e51 100755
--- a/src/modules/projection/pj_proj4/PROJ4_Base.h
+++ b/src/modules/projection/pj_proj4/PROJ4_Base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: PROJ4_Base.h 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/PROJ4_Grid.cpp b/src/modules/projection/pj_proj4/PROJ4_Grid.cpp
index f47cc1c..ef2f505 100755
--- a/src/modules/projection/pj_proj4/PROJ4_Grid.cpp
+++ b/src/modules/projection/pj_proj4/PROJ4_Grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: PROJ4_Grid.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/PROJ4_Grid.h b/src/modules/projection/pj_proj4/PROJ4_Grid.h
index d42d54d..94ec65b 100755
--- a/src/modules/projection/pj_proj4/PROJ4_Grid.h
+++ b/src/modules/projection/pj_proj4/PROJ4_Grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: PROJ4_Grid.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/PROJ4_Shapes.cpp b/src/modules/projection/pj_proj4/PROJ4_Shapes.cpp
index f23a3ed..31a59e2 100755
--- a/src/modules/projection/pj_proj4/PROJ4_Shapes.cpp
+++ b/src/modules/projection/pj_proj4/PROJ4_Shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: PROJ4_Shapes.cpp 2289 2014-10-16 13:45:05Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/PROJ4_Shapes.h b/src/modules/projection/pj_proj4/PROJ4_Shapes.h
index 2fb31fc..4de6a67 100755
--- a/src/modules/projection/pj_proj4/PROJ4_Shapes.h
+++ b/src/modules/projection/pj_proj4/PROJ4_Shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: PROJ4_Shapes.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_assign.cpp b/src/modules/projection/pj_proj4/crs_assign.cpp
index 197d5c5..a65beed 100755
--- a/src/modules/projection/pj_proj4/crs_assign.cpp
+++ b/src/modules/projection/pj_proj4/crs_assign.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_assign.cpp 2322 2014-11-03 21:29:57Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_assign.h b/src/modules/projection/pj_proj4/crs_assign.h
index 13303e6..8129b88 100755
--- a/src/modules/projection/pj_proj4/crs_assign.h
+++ b/src/modules/projection/pj_proj4/crs_assign.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_assign.h 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_base.cpp b/src/modules/projection/pj_proj4/crs_base.cpp
index ec8e447..99f9433 100755
--- a/src/modules/projection/pj_proj4/crs_base.cpp
+++ b/src/modules/projection/pj_proj4/crs_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_base.cpp 2881 2016-04-01 20:24:07Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_base.h b/src/modules/projection/pj_proj4/crs_base.h
index b1b5295..5903e83 100755
--- a/src/modules/projection/pj_proj4/crs_base.h
+++ b/src/modules/projection/pj_proj4/crs_base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_base.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_grid_geogcoords.cpp b/src/modules/projection/pj_proj4/crs_grid_geogcoords.cpp
index 8585ffc..d7ff961 100755
--- a/src/modules/projection/pj_proj4/crs_grid_geogcoords.cpp
+++ b/src/modules/projection/pj_proj4/crs_grid_geogcoords.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_grid_geogcoords.cpp 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_grid_geogcoords.h b/src/modules/projection/pj_proj4/crs_grid_geogcoords.h
index 897d16a..0aa6a85 100755
--- a/src/modules/projection/pj_proj4/crs_grid_geogcoords.h
+++ b/src/modules/projection/pj_proj4/crs_grid_geogcoords.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_grid_geogcoords.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_indicatrix.cpp b/src/modules/projection/pj_proj4/crs_indicatrix.cpp
index d12e8b7..aecbadb 100755
--- a/src/modules/projection/pj_proj4/crs_indicatrix.cpp
+++ b/src/modules/projection/pj_proj4/crs_indicatrix.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_indicatrix.cpp 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_indicatrix.h b/src/modules/projection/pj_proj4/crs_indicatrix.h
index 920f8a0..b3bd2b9 100755
--- a/src/modules/projection/pj_proj4/crs_indicatrix.h
+++ b/src/modules/projection/pj_proj4/crs_indicatrix.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_indicatrix.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_transform.cpp b/src/modules/projection/pj_proj4/crs_transform.cpp
index cfb341c..34ed722 100755
--- a/src/modules/projection/pj_proj4/crs_transform.cpp
+++ b/src/modules/projection/pj_proj4/crs_transform.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_transform.cpp 2147 2014-06-10 12:57:19Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_transform.h b/src/modules/projection/pj_proj4/crs_transform.h
index 03106e1..89f18f3 100755
--- a/src/modules/projection/pj_proj4/crs_transform.h
+++ b/src/modules/projection/pj_proj4/crs_transform.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_transform.h 2147 2014-06-10 12:57:19Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_transform_grid.cpp b/src/modules/projection/pj_proj4/crs_transform_grid.cpp
index 08c7ba9..fca5297 100755
--- a/src/modules/projection/pj_proj4/crs_transform_grid.cpp
+++ b/src/modules/projection/pj_proj4/crs_transform_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_transform_grid.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_transform_grid.h b/src/modules/projection/pj_proj4/crs_transform_grid.h
index 862885c..9f3f655 100755
--- a/src/modules/projection/pj_proj4/crs_transform_grid.h
+++ b/src/modules/projection/pj_proj4/crs_transform_grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_transform_grid.h 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_transform_pointcloud.cpp b/src/modules/projection/pj_proj4/crs_transform_pointcloud.cpp
index ab2419e..e1c34ed 100755
--- a/src/modules/projection/pj_proj4/crs_transform_pointcloud.cpp
+++ b/src/modules/projection/pj_proj4/crs_transform_pointcloud.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_transform_pointcloud.cpp 2147 2014-06-10 12:57:19Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_transform_pointcloud.h b/src/modules/projection/pj_proj4/crs_transform_pointcloud.h
index 2823392..4c86f40 100755
--- a/src/modules/projection/pj_proj4/crs_transform_pointcloud.h
+++ b/src/modules/projection/pj_proj4/crs_transform_pointcloud.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_transform_pointcloud.h 2147 2014-06-10 12:57:19Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_transform_shapes.cpp b/src/modules/projection/pj_proj4/crs_transform_shapes.cpp
index 01f6612..c10336e 100755
--- a/src/modules/projection/pj_proj4/crs_transform_shapes.cpp
+++ b/src/modules/projection/pj_proj4/crs_transform_shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_transform_shapes.cpp 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/crs_transform_shapes.h b/src/modules/projection/pj_proj4/crs_transform_shapes.h
index d144ce4..1ca20de 100755
--- a/src/modules/projection/pj_proj4/crs_transform_shapes.h
+++ b/src/modules/projection/pj_proj4/crs_transform_shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: crs_transform_shapes.h 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/gcs_graticule.cpp b/src/modules/projection/pj_proj4/gcs_graticule.cpp
index 24e684e..de85700 100755
--- a/src/modules/projection/pj_proj4/gcs_graticule.cpp
+++ b/src/modules/projection/pj_proj4/gcs_graticule.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: gcs_graticule.cpp 2148 2014-06-10 12:59:52Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/gcs_graticule.h b/src/modules/projection/pj_proj4/gcs_graticule.h
index 7521171..ab82703 100755
--- a/src/modules/projection/pj_proj4/gcs_graticule.h
+++ b/src/modules/projection/pj_proj4/gcs_graticule.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: gcs_graticule.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/gcs_lon_range.cpp b/src/modules/projection/pj_proj4/gcs_lon_range.cpp
index b278987..e666800 100755
--- a/src/modules/projection/pj_proj4/gcs_lon_range.cpp
+++ b/src/modules/projection/pj_proj4/gcs_lon_range.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: gcs_lon_range.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/projection/pj_proj4/gcs_lon_range.h b/src/modules/projection/pj_proj4/gcs_lon_range.h
index ec524d8..9593cd3 100755
--- a/src/modules/projection/pj_proj4/gcs_lon_range.h
+++ b/src/modules/projection/pj_proj4/gcs_lon_range.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: gcs_lon_range.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/Makefile.in b/src/modules/shapes/Makefile.in
index 8edac25..d86fad9 100644
--- a/src/modules/shapes/Makefile.in
+++ b/src/modules/shapes/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/shapes/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/shapes/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp b/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp
index 726d071..2d0c815 100755
--- a/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Classes_To_Shapes.cpp 2241 2014-09-22 11:04:27Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -76,13 +76,12 @@ CGrid_Classes_To_Shapes::CGrid_Classes_To_Shapes(void)
 	//-----------------------------------------------------
 	Set_Name		(_TL("Vectorising Grid Classes"));
 
-	Set_Author		(SG_T("(c) 2008 by O.Conrad"));
+	Set_Author		("O.Conrad (c) 2008");
 
 	Set_Description	(_TW(
 		"Vectorising grid classes."
 	));
 
-
 	//-----------------------------------------------------
 	Parameters.Add_Grid(
 		NULL	, "GRID"		, _TL("Grid"),
@@ -96,19 +95,19 @@ CGrid_Classes_To_Shapes::CGrid_Classes_To_Shapes(void)
 		PARAMETER_OUTPUT, SHAPE_TYPE_Polygon
 	);
 
-	Parameters.Add_Choice(
+	CSG_Parameter	*pNode	= Parameters.Add_Choice(
 		NULL	, "CLASS_ALL"	, _TL("Class Selection"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
+		CSG_String::Format("%s|%s|",
 			_TL("one single class specified by class identifier"),
 			_TL("all classes")
 		), 1
 	);
 
-	Parameters.Add_Value(
-		NULL	, "CLASS_ID"	, _TL("Class Identifier"),
+	Parameters.Add_Double(
+		pNode	, "CLASS_ID"	, _TL("Class Identifier"),
 		_TL(""),
-		PARAMETER_TYPE_Double, 1
+		1.0
 	);
 
 	Parameters.Add_Choice(
@@ -130,7 +129,21 @@ CGrid_Classes_To_Shapes::CGrid_Classes_To_Shapes(void)
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CGrid_Classes_To_Shapes::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "CLASS_ALL") )
+	{
+		pParameters->Set_Enabled("CLASS_ID", pParameter->asInt() == 0);
+	}
+
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
 //														 //
 ///////////////////////////////////////////////////////////
 
@@ -159,42 +172,51 @@ bool CGrid_Classes_To_Shapes::On_Execute(void)
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
 bool CGrid_Classes_To_Shapes::Get_Classes(void)
 {
-	sLong		i;
-	int			id, x, y;
-	double		Value;
-	CSG_Grid	*pGrid;
-
 	//-----------------------------------------------------
-	pGrid		= Parameters("GRID")		->asGrid();
+	CSG_Grid	*pGrid	= Parameters("GRID")->asGrid();
 
-	m_pPolygons	= Parameters("POLYGONS")	->asShapes();
+	m_pPolygons	= Parameters("POLYGONS")->asShapes();
 
 	m_pPolygons->Create(SHAPE_TYPE_Polygon);
 
-	m_pPolygons->Add_Field(pGrid->Get_Name(), SG_DATATYPE_Double);
-	m_pPolygons->Add_Field(SG_T("ID")		, SG_DATATYPE_Int);
-	m_pPolygons->Add_Field(SG_T("NAME")		, SG_DATATYPE_String);
+	m_pPolygons->Add_Field("ID"   , SG_DATATYPE_Int   );
+	m_pPolygons->Add_Field("VALUE", pGrid->Get_Type ());
+	m_pPolygons->Add_Field("NAME" , SG_DATATYPE_String);
 
-	DataObject_Set_Parameter(m_pPolygons, DataObject_Get_Parameter(pGrid, "LUT"));			// Lookup Table
 	DataObject_Set_Parameter(m_pPolygons, DataObject_Get_Parameter(pGrid, "COLORS_TYPE"));	// Color Classification Type: Lookup Table
-	DataObject_Set_Parameter(m_pPolygons, "LUT_ATTRIB", 0);								// Color Attribute
+	DataObject_Set_Parameter(m_pPolygons, DataObject_Get_Parameter(pGrid, "LUT"        ));	// Lookup Table
+	DataObject_Set_Parameter(m_pPolygons, "LUT_ATTRIB", 1);
 
 	m_pPolygons->Set_Name(pGrid->Get_Name());
 
 	//-----------------------------------------------------
+	CSG_Table	*pLUT	= NULL;
+
+	if( DataObject_Get_Parameter(pGrid, "COLORS_TYPE") )
+	{
+		if( DataObject_Get_Parameter(pGrid, "COLORS_TYPE")->asInt() == 1 )	// Color Classification Type: Lookup Table == 1
+		{
+			if( DataObject_Get_Parameter(pGrid, "LUT") )
+			{
+				pLUT	= DataObject_Get_Parameter(pGrid, "LUT")->asTable();
+			}
+		}
+	}
+
+	//-----------------------------------------------------
 	Process_Set_Text(_TL("class identification"));
 
 	m_Classes.Create(pGrid->Get_System(), SG_DATATYPE_Int);
 	m_Classes.Set_NoData_Value(-1);
 	m_Classes.Assign_NoData();
 
+	double	Value	= 0.0;
+
 	//-----------------------------------------------------
 	if( Parameters("CLASS_ALL")->asInt() == 1 )
 	{
@@ -205,7 +227,9 @@ bool CGrid_Classes_To_Shapes::Get_Classes(void)
 			return( false );
 		}
 
-		for(i=0, id=-1; i<Get_NCells() && Set_Progress_NCells(i); i++)
+		int	x, y, id	= -1;
+
+		for(sLong i=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
 		{
 			if( pGrid->Get_Sorted(i, x, y, false) )
 			{
@@ -213,9 +237,9 @@ bool CGrid_Classes_To_Shapes::Get_Classes(void)
 				{
 					CSG_Shape	*pPolygon	= m_pPolygons->Add_Shape();
 
-					pPolygon->Set_Value(0, Value = pGrid->asDouble(x, y));
-					pPolygon->Set_Value(1, 1 + id++);
-					pPolygon->Set_Value(2, CSG_String::Format(SG_T("%d"), m_pPolygons->Get_Count()));
+					pPolygon->Set_Value(0, 1 + id++);
+					pPolygon->Set_Value(1, Value = pGrid->asDouble(x, y));
+					pPolygon->Set_Value(2, Get_Class_Name(Value, pLUT));
 				}
 
 				m_Classes.Set_Value(x, y, id);
@@ -228,13 +252,13 @@ bool CGrid_Classes_To_Shapes::Get_Classes(void)
 	{
 		CSG_Shape	*pPolygon	= m_pPolygons->Add_Shape();
 
-		pPolygon->Set_Value(0, Value = Parameters("CLASS_ID")->asDouble());
-		pPolygon->Set_Value(1, m_pPolygons->Get_Count());
-		pPolygon->Set_Value(2, CSG_String::Format(SG_T("%d"), m_pPolygons->Get_Count()));
+		pPolygon->Set_Value(0, m_pPolygons->Get_Count());
+		pPolygon->Set_Value(1, Value = Parameters("CLASS_ID")->asDouble());
+		pPolygon->Set_Value(2, Get_Class_Name(Value, pLUT));
 
-		for(y=0; y<Get_NY() && Set_Progress(y); y++)
+		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
 		{
-			for(x=0; x<Get_NX(); x++)
+			for(int x=0; x<Get_NX(); x++)
 			{
 				if( pGrid->asDouble(x, y) == Value )
 				{
@@ -248,11 +272,33 @@ bool CGrid_Classes_To_Shapes::Get_Classes(void)
 	return( m_pPolygons->Get_Count() > 0 );
 }
 
+//---------------------------------------------------------
+#define LUT_NAM 1
+#define LUT_MIN	3
+#define LUT_MAX	4
+
+CSG_String CGrid_Classes_To_Shapes::Get_Class_Name(double Value, CSG_Table *pLUT)
+{
+	if( pLUT )	// using LUT ?
+	{
+		for(int i=0; i<pLUT->Get_Count(); i++)
+		{
+			CSG_Table_Record	*pClass	= pLUT->Get_Record(i);
+
+			if( Value >= pClass->asDouble(LUT_MIN)
+			&&  Value <= pClass->asDouble(LUT_MAX) )
+			{
+				return( pClass->asString(LUT_NAM) );
+			}
+		}
+	}
+
+	return( SG_Get_String(Value, -2) );
+}
+
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -427,8 +473,6 @@ bool CGrid_Classes_To_Shapes::Get_Edge(int x, int y, int i, int Class)
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -534,8 +578,6 @@ public:
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h b/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h
index 6afc4be..f35278c 100755
--- a/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h
+++ b/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Classes_To_Shapes.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -80,12 +80,14 @@ class CGrid_Classes_To_Shapes : public CSG_Module_Grid
 public:
 	CGrid_Classes_To_Shapes(void);
 
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Vectorization") );	}
+	virtual CSG_String		Get_MenuPath			(void)	{	return( _TL("Vectorization") );	}
 
 
 protected:
 
-	virtual bool			On_Execute		(void);
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool			On_Execute				(void);
 
 
 private:
@@ -97,12 +99,13 @@ private:
 	CSG_Shapes				*m_pPolygons;
 
 
-	bool					Get_Classes		(void);
+	bool					Get_Classes				(void);
+	CSG_String				Get_Class_Name			(double Value, CSG_Table *pLUT);
 
-	bool					Get_Edges		(void);
-	bool					Get_Edge		(int x, int y, int i, int Class);
+	bool					Get_Edges				(void);
+	bool					Get_Edge				(int x, int y, int i, int Class);
 
-	bool					Split_Polygons	(void);
+	bool					Split_Polygons			(void);
 
 };
 
diff --git a/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp b/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp
index 4b5faa0..cf815ef 100755
--- a/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Polygon_Clip.cpp 2346 2014-11-28 11:39:34Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h b/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h
index c2184b4..42163a8 100755
--- a/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h
+++ b/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Polygon_Clip.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp b/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp
index 3398f2e..994e8a0 100755
--- a/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Statistics_AddTo_Polygon.cpp 2803 2016-02-19 16:34:27Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h b/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h
index c9d93c4..73d51cb 100755
--- a/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h
+++ b/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Statistics_AddTo_Polygon.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_To_Contour.cpp b/src/modules/shapes/shapes_grid/Grid_To_Contour.cpp
index e5a51b0..033b3ba 100755
--- a/src/modules/shapes/shapes_grid/Grid_To_Contour.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_To_Contour.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_To_Contour.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_To_Contour.h b/src/modules/shapes/shapes_grid/Grid_To_Contour.h
index 9e9c1f0..c8c401b 100755
--- a/src/modules/shapes/shapes_grid/Grid_To_Contour.h
+++ b/src/modules/shapes/shapes_grid/Grid_To_Contour.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_To_Contour.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_To_Gradient.cpp b/src/modules/shapes/shapes_grid/Grid_To_Gradient.cpp
index cb77867..21c278a 100755
--- a/src/modules/shapes/shapes_grid/Grid_To_Gradient.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_To_Gradient.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_To_Gradient.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_To_Gradient.h b/src/modules/shapes/shapes_grid/Grid_To_Gradient.h
index 0ff46f0..078cc2d 100755
--- a/src/modules/shapes/shapes_grid/Grid_To_Gradient.h
+++ b/src/modules/shapes/shapes_grid/Grid_To_Gradient.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_To_Gradient.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_To_Points.cpp b/src/modules/shapes/shapes_grid/Grid_To_Points.cpp
index 14a534c..38c1137 100755
--- a/src/modules/shapes/shapes_grid/Grid_To_Points.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_To_Points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_To_Points.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_To_Points.h b/src/modules/shapes/shapes_grid/Grid_To_Points.h
index cab80ec..c29675b 100755
--- a/src/modules/shapes/shapes_grid/Grid_To_Points.h
+++ b/src/modules/shapes/shapes_grid/Grid_To_Points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_To_Points.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_To_Points_Random.cpp b/src/modules/shapes/shapes_grid/Grid_To_Points_Random.cpp
index 61a3022..cd3c023 100755
--- a/src/modules/shapes/shapes_grid/Grid_To_Points_Random.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_To_Points_Random.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_To_Points_Random.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_To_Points_Random.h b/src/modules/shapes/shapes_grid/Grid_To_Points_Random.h
index ee70ff3..68daffa 100755
--- a/src/modules/shapes/shapes_grid/Grid_To_Points_Random.h
+++ b/src/modules/shapes/shapes_grid/Grid_To_Points_Random.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_To_Points_Random.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.cpp b/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.cpp
index fc20613..47165d6 100755
--- a/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Values_AddTo_Points.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h b/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h
index 219ff78..41f837e 100755
--- a/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h
+++ b/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Values_AddTo_Points.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.cpp b/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.cpp
index af51272..a2a1b93 100755
--- a/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.cpp
+++ b/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Values_AddTo_Shapes.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h b/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h
index fa647f9..1a08350 100755
--- a/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h
+++ b/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Values_AddTo_Shapes.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/MLB_Interface.cpp b/src/modules/shapes/shapes_grid/MLB_Interface.cpp
index f08e1f7..b58000c 100755
--- a/src/modules/shapes/shapes_grid/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_grid/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2443 2015-03-18 19:52:26Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/MLB_Interface.h b/src/modules/shapes/shapes_grid/MLB_Interface.h
index 63e32d7..97c6626 100755
--- a/src/modules/shapes/shapes_grid/MLB_Interface.h
+++ b/src/modules/shapes/shapes_grid/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/Makefile.am b/src/modules/shapes/shapes_grid/Makefile.am
index be1c65b..58ea4e1 100755
--- a/src/modules/shapes/shapes_grid/Makefile.am
+++ b/src/modules/shapes/shapes_grid/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/shapes/shapes_grid/Makefile.in b/src/modules/shapes/shapes_grid/Makefile.in
index 11b1d06..cc44c06 100644
--- a/src/modules/shapes/shapes_grid/Makefile.in
+++ b/src/modules/shapes/shapes_grid/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_grid
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -217,6 +227,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -250,6 +261,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -268,6 +286,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -357,6 +376,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -367,7 +387,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -422,7 +442,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/shapes/shapes_grid/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/shapes/shapes_grid/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -737,6 +756,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.cpp b/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.cpp
index 833975d..7bb2185 100755
--- a/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.cpp
+++ b/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_local_extremes_to_points.cpp 2185 2014-07-14 11:49:08Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h b/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h
index 78aedee..e3aac02 100755
--- a/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h
+++ b/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_local_extremes_to_points.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/grid_rectangle_clip.cpp b/src/modules/shapes/shapes_grid/grid_rectangle_clip.cpp
index ef0eab8..c34030a 100755
--- a/src/modules/shapes/shapes_grid/grid_rectangle_clip.cpp
+++ b/src/modules/shapes/shapes_grid/grid_rectangle_clip.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_rectangle_clip.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_grid/grid_rectangle_clip.h b/src/modules/shapes/shapes_grid/grid_rectangle_clip.h
index 56e7955..65845fd 100755
--- a/src/modules/shapes/shapes_grid/grid_rectangle_clip.h
+++ b/src/modules/shapes/shapes_grid/grid_rectangle_clip.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_rectangle_clip.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/Lines_From_Points.cpp b/src/modules/shapes/shapes_lines/Lines_From_Points.cpp
index 5d10f4f..393f006 100755
--- a/src/modules/shapes/shapes_lines/Lines_From_Points.cpp
+++ b/src/modules/shapes/shapes_lines/Lines_From_Points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Lines_From_Points.cpp 2176 2014-06-25 13:48:50Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/Lines_From_Points.h b/src/modules/shapes/shapes_lines/Lines_From_Points.h
index 778fdf7..061aa60 100755
--- a/src/modules/shapes/shapes_lines/Lines_From_Points.h
+++ b/src/modules/shapes/shapes_lines/Lines_From_Points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Lines_From_Points.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/Lines_From_Polygons.cpp b/src/modules/shapes/shapes_lines/Lines_From_Polygons.cpp
index cb2ed95..05b301d 100755
--- a/src/modules/shapes/shapes_lines/Lines_From_Polygons.cpp
+++ b/src/modules/shapes/shapes_lines/Lines_From_Polygons.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Lines_From_Polygons.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/Lines_From_Polygons.h b/src/modules/shapes/shapes_lines/Lines_From_Polygons.h
index a8f52a3..845b857 100755
--- a/src/modules/shapes/shapes_lines/Lines_From_Polygons.h
+++ b/src/modules/shapes/shapes_lines/Lines_From_Polygons.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Lines_From_Polygons.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/MLB_Interface.cpp b/src/modules/shapes/shapes_lines/MLB_Interface.cpp
index 4093768..d05584a 100755
--- a/src/modules/shapes/shapes_lines/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_lines/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2573 2015-09-04 12:25:29Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/MLB_Interface.h b/src/modules/shapes/shapes_lines/MLB_Interface.h
index 927bd9d..7326510 100755
--- a/src/modules/shapes/shapes_lines/MLB_Interface.h
+++ b/src/modules/shapes/shapes_lines/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/Makefile.in b/src/modules/shapes/shapes_lines/Makefile.in
index 101ef84..53d7f35 100644
--- a/src/modules/shapes/shapes_lines/Makefile.in
+++ b/src/modules/shapes/shapes_lines/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_lines
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -409,7 +429,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/shapes/shapes_lines/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/shapes/shapes_lines/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -719,6 +738,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/shapes/shapes_lines/line_dissolve.h b/src/modules/shapes/shapes_lines/line_dissolve.h
index ef0312e..e4efa58 100755
--- a/src/modules/shapes/shapes_lines/line_dissolve.h
+++ b/src/modules/shapes/shapes_lines/line_dissolve.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_dissolve.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/line_polygon_intersection.cpp b/src/modules/shapes/shapes_lines/line_polygon_intersection.cpp
index 7f7fe73..5cebb96 100755
--- a/src/modules/shapes/shapes_lines/line_polygon_intersection.cpp
+++ b/src/modules/shapes/shapes_lines/line_polygon_intersection.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_polygon_intersection.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/line_polygon_intersection.h b/src/modules/shapes/shapes_lines/line_polygon_intersection.h
index 7a69e69..21af935 100755
--- a/src/modules/shapes/shapes_lines/line_polygon_intersection.h
+++ b/src/modules/shapes/shapes_lines/line_polygon_intersection.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_polygon_intersection.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/line_properties.cpp b/src/modules/shapes/shapes_lines/line_properties.cpp
index c88d89c..87d89c5 100755
--- a/src/modules/shapes/shapes_lines/line_properties.cpp
+++ b/src/modules/shapes/shapes_lines/line_properties.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_properties.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/line_properties.h b/src/modules/shapes/shapes_lines/line_properties.h
index 8c87058..a817af6 100755
--- a/src/modules/shapes/shapes_lines/line_properties.h
+++ b/src/modules/shapes/shapes_lines/line_properties.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_properties.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/line_simplification.cpp b/src/modules/shapes/shapes_lines/line_simplification.cpp
index 7823dec..2159c9a 100755
--- a/src/modules/shapes/shapes_lines/line_simplification.cpp
+++ b/src/modules/shapes/shapes_lines/line_simplification.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_simplification.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/line_simplification.h b/src/modules/shapes/shapes_lines/line_simplification.h
index cc3e40c..5cf29b7 100755
--- a/src/modules/shapes/shapes_lines/line_simplification.h
+++ b/src/modules/shapes/shapes_lines/line_simplification.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_simplification.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/line_smoothing.cpp b/src/modules/shapes/shapes_lines/line_smoothing.cpp
index 547fa03..d25d230 100755
--- a/src/modules/shapes/shapes_lines/line_smoothing.cpp
+++ b/src/modules/shapes/shapes_lines/line_smoothing.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_smoothing.cpp 2347 2014-12-04 10:37:10Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_lines/line_smoothing.h b/src/modules/shapes/shapes_lines/line_smoothing.h
index 41672ed..9917abc 100755
--- a/src/modules/shapes/shapes_lines/line_smoothing.h
+++ b/src/modules/shapes/shapes_lines/line_smoothing.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_smoothing.h 2347 2014-12-04 10:37:10Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/AddCoordinates.cpp b/src/modules/shapes/shapes_points/AddCoordinates.cpp
index 1eb0c7d..ad64465 100755
--- a/src/modules/shapes/shapes_points/AddCoordinates.cpp
+++ b/src/modules/shapes/shapes_points/AddCoordinates.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: AddCoordinates.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     AddCoordinates.cpp
diff --git a/src/modules/shapes/shapes_points/AddCoordinates.h b/src/modules/shapes/shapes_points/AddCoordinates.h
index 192c9f7..058abb7 100755
--- a/src/modules/shapes/shapes_points/AddCoordinates.h
+++ b/src/modules/shapes/shapes_points/AddCoordinates.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: AddCoordinates.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     AddCoordinates.h
diff --git a/src/modules/shapes/shapes_points/Clip_Points.cpp b/src/modules/shapes/shapes_points/Clip_Points.cpp
index b47cdab..fcb4af9 100755
--- a/src/modules/shapes/shapes_points/Clip_Points.cpp
+++ b/src/modules/shapes/shapes_points/Clip_Points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Clip_Points.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/Clip_Points.h b/src/modules/shapes/shapes_points/Clip_Points.h
index be7cd01..36ade23 100755
--- a/src/modules/shapes/shapes_points/Clip_Points.h
+++ b/src/modules/shapes/shapes_points/Clip_Points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Clip_Points.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/CountPoints.cpp b/src/modules/shapes/shapes_points/CountPoints.cpp
index 0810744..6c6d946 100755
--- a/src/modules/shapes/shapes_points/CountPoints.cpp
+++ b/src/modules/shapes/shapes_points/CountPoints.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CountPoints.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CountPoints.cpp
diff --git a/src/modules/shapes/shapes_points/CountPoints.h b/src/modules/shapes/shapes_points/CountPoints.h
index c2a86ff..7d16c92 100755
--- a/src/modules/shapes/shapes_points/CountPoints.h
+++ b/src/modules/shapes/shapes_points/CountPoints.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CountPoints.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CountPoints.cpp
diff --git a/src/modules/shapes/shapes_points/CreatePointGrid.cpp b/src/modules/shapes/shapes_points/CreatePointGrid.cpp
index 317abd4..769bfef 100755
--- a/src/modules/shapes/shapes_points/CreatePointGrid.cpp
+++ b/src/modules/shapes/shapes_points/CreatePointGrid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreatePointGrid.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CreatePointGrid.cpp
diff --git a/src/modules/shapes/shapes_points/CreatePointGrid.h b/src/modules/shapes/shapes_points/CreatePointGrid.h
index 765731a..356e02e 100755
--- a/src/modules/shapes/shapes_points/CreatePointGrid.h
+++ b/src/modules/shapes/shapes_points/CreatePointGrid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreatePointGrid.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CreatePointGrid.cpp
diff --git a/src/modules/shapes/shapes_points/DistanceMatrix.cpp b/src/modules/shapes/shapes_points/DistanceMatrix.cpp
index 4262426..15c85f2 100755
--- a/src/modules/shapes/shapes_points/DistanceMatrix.cpp
+++ b/src/modules/shapes/shapes_points/DistanceMatrix.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: DistanceMatrix.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     DistanceMatrix.cpp
diff --git a/src/modules/shapes/shapes_points/DistanceMatrix.h b/src/modules/shapes/shapes_points/DistanceMatrix.h
index 289664f..0cb7013 100755
--- a/src/modules/shapes/shapes_points/DistanceMatrix.h
+++ b/src/modules/shapes/shapes_points/DistanceMatrix.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: DistanceMatrix.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     DistanceMatrix.h
diff --git a/src/modules/shapes/shapes_points/FitNPointsToShape.cpp b/src/modules/shapes/shapes_points/FitNPointsToShape.cpp
index b9f0ef1..a22adf0 100755
--- a/src/modules/shapes/shapes_points/FitNPointsToShape.cpp
+++ b/src/modules/shapes/shapes_points/FitNPointsToShape.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FitNPointsToShape.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     FitNPointsToShape.cpp
diff --git a/src/modules/shapes/shapes_points/FitNPointsToShape.h b/src/modules/shapes/shapes_points/FitNPointsToShape.h
index 4d6cc99..a1ed6ca 100755
--- a/src/modules/shapes/shapes_points/FitNPointsToShape.h
+++ b/src/modules/shapes/shapes_points/FitNPointsToShape.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: FitNPointsToShape.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     FitNPointsToShape.cpp
diff --git a/src/modules/shapes/shapes_points/MLB_Interface.cpp b/src/modules/shapes/shapes_points/MLB_Interface.cpp
index 2c406af..2d867b9 100755
--- a/src/modules/shapes/shapes_points/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_points/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/MLB_Interface.h b/src/modules/shapes/shapes_points/MLB_Interface.h
index 982617c..0caee65 100755
--- a/src/modules/shapes/shapes_points/MLB_Interface.h
+++ b/src/modules/shapes/shapes_points/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/Makefile.am b/src/modules/shapes/shapes_points/Makefile.am
index 39290f2..4264d43 100755
--- a/src/modules/shapes/shapes_points/Makefile.am
+++ b/src/modules/shapes/shapes_points/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/shapes/shapes_points/Makefile.in b/src/modules/shapes/shapes_points/Makefile.in
index 582a5e5..f8b4440 100644
--- a/src/modules/shapes/shapes_points/Makefile.in
+++ b/src/modules/shapes/shapes_points/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_points
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -218,6 +228,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -251,6 +262,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -269,6 +287,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -358,6 +377,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -368,7 +388,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -435,7 +455,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/shapes/shapes_points/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/shapes/shapes_points/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -756,6 +775,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/shapes/shapes_points/Points_From_Lines.cpp b/src/modules/shapes/shapes_points/Points_From_Lines.cpp
index a37277e..319b1ee 100755
--- a/src/modules/shapes/shapes_points/Points_From_Lines.cpp
+++ b/src/modules/shapes/shapes_points/Points_From_Lines.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Points_From_Lines.cpp 2756 2016-01-21 14:07:36Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 /*******************************************************************************
diff --git a/src/modules/shapes/shapes_points/Points_From_Lines.h b/src/modules/shapes/shapes_points/Points_From_Lines.h
index 1f2955c..a43fffe 100755
--- a/src/modules/shapes/shapes_points/Points_From_Lines.h
+++ b/src/modules/shapes/shapes_points/Points_From_Lines.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Points_From_Lines.h 2545 2015-07-28 07:46:45Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 /*******************************************************************************
diff --git a/src/modules/shapes/shapes_points/Points_From_Table.cpp b/src/modules/shapes/shapes_points/Points_From_Table.cpp
index c995ab4..67b33e5 100755
--- a/src/modules/shapes/shapes_points/Points_From_Table.cpp
+++ b/src/modules/shapes/shapes_points/Points_From_Table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Points_From_Table.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 /*******************************************************************************
diff --git a/src/modules/shapes/shapes_points/Points_From_Table.h b/src/modules/shapes/shapes_points/Points_From_Table.h
index d10332f..0216251 100755
--- a/src/modules/shapes/shapes_points/Points_From_Table.h
+++ b/src/modules/shapes/shapes_points/Points_From_Table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Points_From_Table.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 /*******************************************************************************
diff --git a/src/modules/shapes/shapes_points/add_polygon_attributes.cpp b/src/modules/shapes/shapes_points/add_polygon_attributes.cpp
index da2d818..82d8dbb 100755
--- a/src/modules/shapes/shapes_points/add_polygon_attributes.cpp
+++ b/src/modules/shapes/shapes_points/add_polygon_attributes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: add_polygon_attributes.cpp 1959 2014-02-03 12:41:37Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/add_polygon_attributes.h b/src/modules/shapes/shapes_points/add_polygon_attributes.h
index 541a61f..b5fa4d5 100755
--- a/src/modules/shapes/shapes_points/add_polygon_attributes.h
+++ b/src/modules/shapes/shapes_points/add_polygon_attributes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: add_polygon_attributes.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/remove_duplicates.cpp b/src/modules/shapes/shapes_points/remove_duplicates.cpp
index 5a44da0..5b7967a 100755
--- a/src/modules/shapes/shapes_points/remove_duplicates.cpp
+++ b/src/modules/shapes/shapes_points/remove_duplicates.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: remove_duplicates.cpp 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/remove_duplicates.h b/src/modules/shapes/shapes_points/remove_duplicates.h
index 950862c..371a7d3 100755
--- a/src/modules/shapes/shapes_points/remove_duplicates.h
+++ b/src/modules/shapes/shapes_points/remove_duplicates.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: remove_duplicates.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/separate_by_direction.cpp b/src/modules/shapes/shapes_points/separate_by_direction.cpp
index ea720ba..dad8e4b 100755
--- a/src/modules/shapes/shapes_points/separate_by_direction.cpp
+++ b/src/modules/shapes/shapes_points/separate_by_direction.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: separate_by_direction.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/separate_by_direction.h b/src/modules/shapes/shapes_points/separate_by_direction.h
index b9832ef..10be060 100755
--- a/src/modules/shapes/shapes_points/separate_by_direction.h
+++ b/src/modules/shapes/shapes_points/separate_by_direction.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: separate_by_direction.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/MLB_Interface.cpp b/src/modules/shapes/shapes_polygons/MLB_Interface.cpp
index 3b0643d..cccb5c1 100755
--- a/src/modules/shapes/shapes_polygons/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_polygons/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/MLB_Interface.h b/src/modules/shapes/shapes_polygons/MLB_Interface.h
index 20ab899..64efae6 100755
--- a/src/modules/shapes/shapes_polygons/MLB_Interface.h
+++ b/src/modules/shapes/shapes_polygons/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Makefile.am b/src/modules/shapes/shapes_polygons/Makefile.am
index 87df6db..bce98a2 100755
--- a/src/modules/shapes/shapes_polygons/Makefile.am
+++ b/src/modules/shapes/shapes_polygons/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/shapes/shapes_polygons/Makefile.in b/src/modules/shapes/shapes_polygons/Makefile.in
index 034491a..0817ec1 100644
--- a/src/modules/shapes/shapes_polygons/Makefile.in
+++ b/src/modules/shapes/shapes_polygons/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_polygons
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -218,6 +228,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -251,6 +262,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -269,6 +287,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -358,6 +377,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -368,7 +388,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -429,7 +449,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/shapes/shapes_polygons/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/shapes/shapes_polygons/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -747,6 +766,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Centroids.cpp b/src/modules/shapes/shapes_polygons/Polygon_Centroids.cpp
index 19fa989..bbbc87e 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_Centroids.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygon_Centroids.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Centroids.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Centroids.h b/src/modules/shapes/shapes_polygons/Polygon_Centroids.h
index caed8cb..91759fb 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_Centroids.h
+++ b/src/modules/shapes/shapes_polygons/Polygon_Centroids.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Centroids.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp b/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp
index 9581293..aa31575 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Geometrics.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Polygon_Geometrics.cpp
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h b/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h
index 65fed4b..845b1f3 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h
+++ b/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Geometrics.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Polygon_Geometrics.h
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Intersection.cpp b/src/modules/shapes/shapes_polygons/Polygon_Intersection.cpp
index 5b1ef15..543a26f 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_Intersection.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygon_Intersection.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Intersection.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Intersection.h b/src/modules/shapes/shapes_polygons/Polygon_Intersection.h
index 312325e..1838739 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_Intersection.h
+++ b/src/modules/shapes/shapes_polygons/Polygon_Intersection.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Intersection.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp b/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp
index acedd4a..0b3f674 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_StatisticsFromPoints.cpp 2689 2015-11-16 12:56:48Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CPolygonStatisticsFromPoints.cpp
diff --git a/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h b/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h
index b1f18bc..f5d2252 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h
+++ b/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_StatisticsFromPoints.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     PolygonStatisticsFromPoints.h
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Union.cpp b/src/modules/shapes/shapes_polygons/Polygon_Union.cpp
index 58e2729..91bf107 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_Union.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygon_Union.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Union.cpp 1982 2014-02-10 16:52:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygon_Union.h b/src/modules/shapes/shapes_polygons/Polygon_Union.h
index f7293e6..082c2c2 100755
--- a/src/modules/shapes/shapes_polygons/Polygon_Union.h
+++ b/src/modules/shapes/shapes_polygons/Polygon_Union.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Union.h 1982 2014-02-10 16:52:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp b/src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp
index 959a20a..6cb9f96 100755
--- a/src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp
+++ b/src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygons_From_Lines.cpp 2175 2014-06-24 15:42:15Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/Polygons_From_Lines.h b/src/modules/shapes/shapes_polygons/Polygons_From_Lines.h
index 1a2293f..745150d 100755
--- a/src/modules/shapes/shapes_polygons/Polygons_From_Lines.h
+++ b/src/modules/shapes/shapes_polygons/Polygons_From_Lines.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygons_From_Lines.h 2174 2014-06-24 14:43:45Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/add_point_attributes.cpp b/src/modules/shapes/shapes_polygons/add_point_attributes.cpp
index c4bdf9e..bba382a 100755
--- a/src/modules/shapes/shapes_polygons/add_point_attributes.cpp
+++ b/src/modules/shapes/shapes_polygons/add_point_attributes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: add_point_attributes.cpp 2322 2014-11-03 21:29:57Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/add_point_attributes.h b/src/modules/shapes/shapes_polygons/add_point_attributes.h
index 0370582..bd684e5 100755
--- a/src/modules/shapes/shapes_polygons/add_point_attributes.h
+++ b/src/modules/shapes/shapes_polygons/add_point_attributes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: add_point_attributes.h 1958 2014-02-03 12:40:27Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/polygon_to_points.cpp b/src/modules/shapes/shapes_polygons/polygon_to_points.cpp
index f630043..fd44751 100755
--- a/src/modules/shapes/shapes_polygons/polygon_to_points.cpp
+++ b/src/modules/shapes/shapes_polygons/polygon_to_points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: polygon_to_points.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/polygon_to_points.h b/src/modules/shapes/shapes_polygons/polygon_to_points.h
index 9d12d80..307f289 100755
--- a/src/modules/shapes/shapes_polygons/polygon_to_points.h
+++ b/src/modules/shapes/shapes_polygons/polygon_to_points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: polygon_to_points.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/shape_index.cpp b/src/modules/shapes/shapes_polygons/shape_index.cpp
index 87a1259..35d2211 100755
--- a/src/modules/shapes/shapes_polygons/shape_index.cpp
+++ b/src/modules/shapes/shapes_polygons/shape_index.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape_index.cpp 2099 2014-04-16 09:04:19Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_polygons/shape_index.h b/src/modules/shapes/shapes_polygons/shape_index.h
index 419a97b..4c1ce70 100755
--- a/src/modules/shapes/shapes_polygons/shape_index.h
+++ b/src/modules/shapes/shapes_polygons/shape_index.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape_index.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/CreateChartLayer.cpp b/src/modules/shapes/shapes_tools/CreateChartLayer.cpp
index 93b3603..75d73e0 100755
--- a/src/modules/shapes/shapes_tools/CreateChartLayer.cpp
+++ b/src/modules/shapes/shapes_tools/CreateChartLayer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreateChartLayer.cpp 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CCreateChartLayer.cpp
diff --git a/src/modules/shapes/shapes_tools/CreateChartLayer.h b/src/modules/shapes/shapes_tools/CreateChartLayer.h
index 77f4c03..51362ba 100755
--- a/src/modules/shapes/shapes_tools/CreateChartLayer.h
+++ b/src/modules/shapes/shapes_tools/CreateChartLayer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: CreateChartLayer.h 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     CreateChartLayer.cpp
diff --git a/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp b/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp
index 51cd1f6..cb6356b 100755
--- a/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp
+++ b/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: GraticuleBuilder.cpp 2661 2015-10-28 09:40:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     GraticuleBuilder.cpp
diff --git a/src/modules/shapes/shapes_tools/GraticuleBuilder.h b/src/modules/shapes/shapes_tools/GraticuleBuilder.h
index bd2e8ce..66d7894 100755
--- a/src/modules/shapes/shapes_tools/GraticuleBuilder.h
+++ b/src/modules/shapes/shapes_tools/GraticuleBuilder.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: GraticuleBuilder.h 2661 2015-10-28 09:40:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     GraticuleBuilder.cpp
diff --git a/src/modules/shapes/shapes_tools/MLB_Interface.cpp b/src/modules/shapes/shapes_tools/MLB_Interface.cpp
index c1fc124..74da99a 100755
--- a/src/modules/shapes/shapes_tools/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_tools/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2417 2015-02-19 15:14:52Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/MLB_Interface.h b/src/modules/shapes/shapes_tools/MLB_Interface.h
index 73af6c4..597a976 100755
--- a/src/modules/shapes/shapes_tools/MLB_Interface.h
+++ b/src/modules/shapes/shapes_tools/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/Makefile.am b/src/modules/shapes/shapes_tools/Makefile.am
index 4e4bc3c..1c645b3 100755
--- a/src/modules/shapes/shapes_tools/Makefile.am
+++ b/src/modules/shapes/shapes_tools/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/shapes/shapes_tools/Makefile.in b/src/modules/shapes/shapes_tools/Makefile.in
index e1c60d8..720786f 100644
--- a/src/modules/shapes/shapes_tools/Makefile.in
+++ b/src/modules/shapes/shapes_tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_tools
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -220,6 +230,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -253,6 +264,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -271,6 +289,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -360,6 +379,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -370,7 +390,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -443,7 +463,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/shapes/shapes_tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/shapes/shapes_tools/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -767,6 +786,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 #install-exec-hook:
 #	pushd .; cd $(pkglibdir); ln -s libshapes_tools.so shapes_tools.so; popd
diff --git a/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp b/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp
index f87288f..0eb8681 100755
--- a/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp
+++ b/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: NewLayerFromSelectedShapes.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     NewLayerFromSelectedShapes.cpp
diff --git a/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h b/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h
index 772709c..8db826a 100755
--- a/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h
+++ b/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: NewLayerFromSelectedShapes.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     NewLayerFromSelectedShapes.h
diff --git a/src/modules/shapes/shapes_tools/QueryBuilder.cpp b/src/modules/shapes/shapes_tools/QueryBuilder.cpp
index c99583c..035bca4 100755
--- a/src/modules/shapes/shapes_tools/QueryBuilder.cpp
+++ b/src/modules/shapes/shapes_tools/QueryBuilder.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: QueryBuilder.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     QueryBuilder.cpp
diff --git a/src/modules/shapes/shapes_tools/QueryBuilder.h b/src/modules/shapes/shapes_tools/QueryBuilder.h
index 2599b71..cbe6e41 100755
--- a/src/modules/shapes/shapes_tools/QueryBuilder.h
+++ b/src/modules/shapes/shapes_tools/QueryBuilder.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: QueryBuilder.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     QueryBuilder.h
diff --git a/src/modules/shapes/shapes_tools/SearchInTable.cpp b/src/modules/shapes/shapes_tools/SearchInTable.cpp
index 1afec94..6bf9422 100755
--- a/src/modules/shapes/shapes_tools/SearchInTable.cpp
+++ b/src/modules/shapes/shapes_tools/SearchInTable.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SearchInTable.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     SearchInTable.cpp
diff --git a/src/modules/shapes/shapes_tools/SearchInTable.h b/src/modules/shapes/shapes_tools/SearchInTable.h
index 0a30c55..9c64263 100755
--- a/src/modules/shapes/shapes_tools/SearchInTable.h
+++ b/src/modules/shapes/shapes_tools/SearchInTable.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SearchInTable.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     SearchInTable.h
diff --git a/src/modules/shapes/shapes_tools/SelectByTheme.cpp b/src/modules/shapes/shapes_tools/SelectByTheme.cpp
index 403ad3c..73098c9 100755
--- a/src/modules/shapes/shapes_tools/SelectByTheme.cpp
+++ b/src/modules/shapes/shapes_tools/SelectByTheme.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SelectByTheme.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     SelectByTheme.cpp
diff --git a/src/modules/shapes/shapes_tools/SelectByTheme.h b/src/modules/shapes/shapes_tools/SelectByTheme.h
index e439471..f9bf576 100755
--- a/src/modules/shapes/shapes_tools/SelectByTheme.h
+++ b/src/modules/shapes/shapes_tools/SelectByTheme.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SelectByTheme.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     SelectByTheme.h
diff --git a/src/modules/shapes/shapes_tools/SeparateShapes.cpp b/src/modules/shapes/shapes_tools/SeparateShapes.cpp
index 81d67b8..34a01bf 100755
--- a/src/modules/shapes/shapes_tools/SeparateShapes.cpp
+++ b/src/modules/shapes/shapes_tools/SeparateShapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SeparateShapes.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     SeparateShapes.cpp
diff --git a/src/modules/shapes/shapes_tools/SeparateShapes.h b/src/modules/shapes/shapes_tools/SeparateShapes.h
index 675294a..be16e79 100755
--- a/src/modules/shapes/shapes_tools/SeparateShapes.h
+++ b/src/modules/shapes/shapes_tools/SeparateShapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SeparateShapes.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     SeparateShapes.h
diff --git a/src/modules/shapes/shapes_tools/Shapes_Create_Empty.cpp b/src/modules/shapes/shapes_tools/Shapes_Create_Empty.cpp
index 6e0302b..6052586 100755
--- a/src/modules/shapes/shapes_tools/Shapes_Create_Empty.cpp
+++ b/src/modules/shapes/shapes_tools/Shapes_Create_Empty.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes_Create_Empty.cpp 2355 2014-12-19 09:55:41Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/Shapes_Create_Empty.h b/src/modules/shapes/shapes_tools/Shapes_Create_Empty.h
index 5ad82d4..0735f9c 100755
--- a/src/modules/shapes/shapes_tools/Shapes_Create_Empty.h
+++ b/src/modules/shapes/shapes_tools/Shapes_Create_Empty.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes_Create_Empty.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/Shapes_Merge.cpp b/src/modules/shapes/shapes_tools/Shapes_Merge.cpp
index 59761dc..1732f20 100755
--- a/src/modules/shapes/shapes_tools/Shapes_Merge.cpp
+++ b/src/modules/shapes/shapes_tools/Shapes_Merge.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes_Merge.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Shapes_Merge.cpp
diff --git a/src/modules/shapes/shapes_tools/Shapes_Merge.h b/src/modules/shapes/shapes_tools/Shapes_Merge.h
index 4cf8acf..5303e23 100755
--- a/src/modules/shapes/shapes_tools/Shapes_Merge.h
+++ b/src/modules/shapes/shapes_tools/Shapes_Merge.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes_Merge.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Shapes_Merge.h
diff --git a/src/modules/shapes/shapes_tools/TransformShapes.cpp b/src/modules/shapes/shapes_tools/TransformShapes.cpp
index 1af64be..cbd7a53 100755
--- a/src/modules/shapes/shapes_tools/TransformShapes.cpp
+++ b/src/modules/shapes/shapes_tools/TransformShapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TransformShapes.cpp 2339 2014-11-17 16:15:58Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     TransformShapes.cpp
diff --git a/src/modules/shapes/shapes_tools/TransformShapes.h b/src/modules/shapes/shapes_tools/TransformShapes.h
index 8f82081..a7fec6f 100755
--- a/src/modules/shapes/shapes_tools/TransformShapes.h
+++ b/src/modules/shapes/shapes_tools/TransformShapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TransformShapes.h 2339 2014-11-17 16:15:58Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     TransformShapes.h
diff --git a/src/modules/shapes/shapes_tools/quadtree_structure.cpp b/src/modules/shapes/shapes_tools/quadtree_structure.cpp
index a5b7709..b60e574 100755
--- a/src/modules/shapes/shapes_tools/quadtree_structure.cpp
+++ b/src/modules/shapes/shapes_tools/quadtree_structure.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: quadtree_structure.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/quadtree_structure.h b/src/modules/shapes/shapes_tools/quadtree_structure.h
index 2c6b6c0..9434f21 100755
--- a/src/modules/shapes/shapes_tools/quadtree_structure.h
+++ b/src/modules/shapes/shapes_tools/quadtree_structure.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: quadtree_structure.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_buffer.cpp b/src/modules/shapes/shapes_tools/shapes_buffer.cpp
index 65fc222..36e1ea7 100755
--- a/src/modules/shapes/shapes_tools/shapes_buffer.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_buffer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_buffer.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_buffer.h b/src/modules/shapes/shapes_tools/shapes_buffer.h
index 97773a9..c834a88 100755
--- a/src/modules/shapes/shapes_tools/shapes_buffer.h
+++ b/src/modules/shapes/shapes_tools/shapes_buffer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_buffer.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_convert_vertex_type.cpp b/src/modules/shapes/shapes_tools/shapes_convert_vertex_type.cpp
index 6006633..33623bb 100755
--- a/src/modules/shapes/shapes_tools/shapes_convert_vertex_type.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_convert_vertex_type.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_convert_vertex_type.cpp 2813 2016-02-22 21:30:40Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_convert_vertex_type.h b/src/modules/shapes/shapes_tools/shapes_convert_vertex_type.h
index 18276e6..6552da6 100755
--- a/src/modules/shapes/shapes_tools/shapes_convert_vertex_type.h
+++ b/src/modules/shapes/shapes_tools/shapes_convert_vertex_type.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_convert_vertex_type.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_cut.cpp b/src/modules/shapes/shapes_tools/shapes_cut.cpp
index 859689b..bb8e60f 100755
--- a/src/modules/shapes/shapes_tools/shapes_cut.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_cut.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_cut.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -58,8 +58,6 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include <string.h>
-
 #include "shapes_cut.h"
 
 
@@ -70,149 +68,132 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool Cut_Shapes(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut)
+bool Cut_Shapes(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut, double Overlap)
 {
-	if( pCut && pShapes && pShapes->is_Valid() && pPolygons && pPolygons->is_Valid() && pPolygons->Get_Extent().Intersects(pShapes->Get_Extent()) )
+	if( !pCut || !pShapes || !pShapes->is_Valid() || !pPolygons || !pPolygons->is_Valid() || !pPolygons->Get_Extent().Intersects(pShapes->Get_Extent()) || pPolygons->Get_Type() != SHAPE_TYPE_Polygon )
 	{
-		pCut->Create(
-			pShapes->Get_Type(),
-			CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Cut")),
-			pShapes
-		);
+		return( false );
+	}
 
-		for(int iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
-		{
-			bool		bAdd;
-			CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
+	pCut->Create(pShapes->Get_Type(), CSG_String::Format("%s [%s]", pShapes->Get_Name(), _TL("Cut")), pShapes, pShapes->Get_Vertex_Type());
 
-			if( Method == 2 )		// center
-			{
-				bAdd	= false;
+	//-----------------------------------------------------
+	CSG_Shapes	Intersect(SHAPE_TYPE_Polygon);
+	CSG_Shape_Polygon	*pIntersect = Overlap > 0.0 && pShapes->Get_Type() == SHAPE_TYPE_Polygon
+		? (CSG_Shape_Polygon *)Intersect.Add_Shape() : NULL;
+
+	//-----------------------------------------------------
+	for(int iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
 
-				TSG_Point	Center;
+		bool	bAdd	= false;
 
-				if( pShapes->Get_Type() == SHAPE_TYPE_Polygon )
-					Center	= ((CSG_Shape_Polygon *)pShape)->Get_Centroid();
-				else
-					Center	= pShape->Get_Extent().Get_Center();
+		for(int iPolygon=0; !bAdd && iPolygon<pPolygons->Get_Count(); iPolygon++)
+		{
+			CSG_Shape_Polygon	*pPolygon	= (CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon);
 
-				if( pPolygons->Select(Center) )
-				{
-					bAdd	= true;
-				}
-			}
-			else if( Method == 1 )	// intersects
+			switch( Method )
 			{
-				bAdd	= false;
+			case  2:	// center
+				bAdd	= pPolygon->Contains(pShapes->Get_Type() == SHAPE_TYPE_Polygon
+					? ((CSG_Shape_Polygon *)pShape)->Get_Centroid() : (TSG_Point)pShape->Get_Extent().Get_Center()
+				);
+				break;
 
-				for(int iPart=0; iPart<pShape->Get_Part_Count() && !bAdd; iPart++)
-				{
-					for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart) && !bAdd; iPoint++)
-					{
-						if( pPolygons->Select(pShape->Get_Point(iPoint, iPart)) )
-						{
-							bAdd	= true;
-						}
-					}
-				}
-			}
-			else					// completely contained
-			{
-				bAdd	= true;
+			case  1:	// intersects
+				bAdd	= pPolygon->Intersects(pShape) != INTERSECTION_None;
 
-				for(int iPart=0; iPart<pShape->Get_Part_Count() && bAdd; iPart++)
+				if( bAdd && pIntersect )
 				{
-					for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart) && bAdd; iPoint++)
-					{
-						if( pPolygons->Select(pShape->Get_Point(iPoint, iPart)) == false )
-						{
-							bAdd	= false;
-						}
-					}
+					bAdd	= SG_Polygon_Intersection(pPolygon, pShape, pIntersect)
+						&& Overlap <= pIntersect->Get_Area() / ((CSG_Shape_Polygon *)pShape)->Get_Area();
 				}
-			}
+				break;
 
-			if( bAdd )
-			{
-				pCut->Add_Shape(pShape);
+			default:	// completely contained
+				bAdd	= pPolygon->Intersects(pShape) == INTERSECTION_Contains;
+				break;
 			}
 		}
 
-		return( pCut->Get_Count() > 0 );
+		//-------------------------------------------------
+		if( bAdd )
+		{
+			pCut->Add_Shape(pShape);
+		}
 	}
 
-	return( false );
+	//-----------------------------------------------------
+	return( pCut->Get_Count() > 0 );
 }
 
 //---------------------------------------------------------
-bool Cut_Shapes(CSG_Rect Extent, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut)
+CSG_Shapes * Cut_Shapes(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes, double Overlap)
 {
-	if( pCut && pShapes && pShapes->is_Valid() && Extent.Intersects(pShapes->Get_Extent()) )
-	{
-		pCut->Create(
-			pShapes->Get_Type(),
-			CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Cut")),
-			pShapes
-		);
+	CSG_Shapes	*pCut	= SG_Create_Shapes();
 
-		for(int iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
-		{
-			bool		bAdd;
-			CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
+	if( Cut_Shapes(pPolygons, Method, pShapes, pCut, Overlap) )
+	{
+		return( pCut );
+	}
 
-			if( Method == 2 )	// center
-			{
-				bAdd	= pShapes->Get_Type() == SHAPE_TYPE_Polygon
-						? Extent.Contains(((CSG_Shape_Polygon *)pShape)->Get_Centroid())
-						: Extent.Contains(pShape->Get_Extent().Get_Center());
-			}
-			else				// completely contained, intersects
-			{
-				switch( pShape->Intersects(Extent) )
-				{
-				case INTERSECTION_Identical:
-				case INTERSECTION_Contained:
-					bAdd	= true;
-					break;
-
-				case INTERSECTION_Overlaps:
-				case INTERSECTION_Contains:
-					bAdd	= Method == 1;
-					break;
-
-				default:
-					bAdd	= false;
-					break;
-				}
-			}
+	delete(pCut);
 
-			if( bAdd )
-			{
-				pCut->Add_Shape(pShape);
-			}
-		}
+	return( NULL );
+}
 
-		return( pCut->Get_Count() > 0 );
-	}
 
-	return( false );
-}
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CSG_Shapes * Cut_Shapes(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes)
+bool Cut_Shapes(CSG_Rect Extent, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut)
 {
-	CSG_Shapes	*pCut	= SG_Create_Shapes();
-
-	if( Cut_Shapes(pPolygons, Method, pShapes, pCut) )
+	if( !pCut || !pShapes || !pShapes->is_Valid() || !Extent.Intersects(pShapes->Get_Extent()) )
 	{
-		return( pCut );
+		return( false );
 	}
 
-	delete(pCut);
+	pCut->Create(pShapes->Get_Type(), CSG_String::Format("%s [%s]", pShapes->Get_Name(), _TL("Cut")), pShapes, pShapes->Get_Vertex_Type());
 
-	return( NULL );
+	//-----------------------------------------------------
+	for(int iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+	{
+		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
+
+		bool	bAdd;
+
+		switch( Method )
+		{
+		case  2:	// center
+			bAdd	= Extent.Contains(pShapes->Get_Type() == SHAPE_TYPE_Polygon
+				? ((CSG_Shape_Polygon *)pShape)->Get_Centroid() : (TSG_Point)pShape->Get_Extent().Get_Center()
+			);
+			break;
+
+		case  1:	// intersects
+			bAdd	= pShape->Intersects(Extent) != INTERSECTION_None;
+			break;
+
+		default:	// completely contained
+			bAdd	= pShape->Intersects(Extent) == INTERSECTION_Contained;
+			break;
+		}
+
+		//-------------------------------------------------
+		if( bAdd )
+		{
+			pCut->Add_Shape(pShape);
+		}
+	}
+
+	//-----------------------------------------------------
+	return( pCut->Get_Count() > 0 );
 }
 
+//---------------------------------------------------------
 CSG_Shapes * Cut_Shapes(CSG_Rect Extent, int Method, CSG_Shapes *pShapes)
 {
 	CSG_Shapes	*pCut	= SG_Create_Shapes();
@@ -227,14 +208,19 @@ CSG_Shapes * Cut_Shapes(CSG_Rect Extent, int Method, CSG_Shapes *pShapes)
 	return( NULL );
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 CSG_String Cut_Methods_Str(void)
 {
-	return( CSG_String::Format(SG_T("%s|%s|%s|"),
+	return( CSG_String::Format("%s|%s|%s|",
 		_TL("completely contained"),
 		_TL("intersects"),
-		_TL("center"))
-	);
+		_TL("center")
+	));
 }
 
 //---------------------------------------------------------
@@ -252,7 +238,7 @@ bool Cut_Set_Extent(CSG_Rect Extent, CSG_Shapes *pExtent, bool bClear)
 		{
 			CSG_Shape	*pShape	= pExtent->Add_Shape();
 
-			pShape->Set_Value(SG_T("ID"), pExtent->Get_Count());
+			pShape->Set_Value("ID", pExtent->Get_Count());
 
 			pShape->Add_Point(Extent.Get_XMin(), Extent.Get_YMin());
 			pShape->Add_Point(Extent.Get_XMin(), Extent.Get_YMax());
@@ -277,9 +263,9 @@ bool Cut_Set_Extent(CSG_Rect Extent, CSG_Shapes *pExtent, bool bClear)
 //---------------------------------------------------------
 CShapes_Cut::CShapes_Cut(void)
 {
-	Set_Name		(_TL("Cut Shapes Layer"));
+	Set_Name		(_TL("Copy Selected Shapes"));
 
-	Set_Author		(SG_T("O. Conrad (c) 2006"));
+	Set_Author		("O.Conrad (c) 2006");
 
 	Set_Description	(_TW(
 		""
@@ -293,28 +279,21 @@ CShapes_Cut::CShapes_Cut(void)
 	);
 
 	Parameters.Add_Shapes_List(
-		NULL	, "CUT"			, _TL("Cut"),
+		NULL	, "CUT"			, _TL("Selection"),
 		_TL(""),
 		PARAMETER_OUTPUT
 	);
 
-	Parameters.Add_Shapes(
-		NULL	, "EXTENT"		, _TL("Extent"),
-		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon
-	);
-
 	Parameters.Add_Choice(
 		NULL	, "METHOD"		, _TL("Method"),
 		_TL(""),
-		Cut_Methods_Str(), 0
+		Cut_Methods_Str(), 1
 	);
 
 	Parameters.Add_Choice(
-		NULL	, "TARGET"		, _TL("Extent"),
+		NULL	, "EXTENT"		, _TL("Extent"),
 		_TL(""),
-
-		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+		CSG_String::Format("%s|%s|%s|%s|",
 			_TL("user defined"),
 			_TL("grid project"),
 			_TL("shapes layer extent"),
@@ -323,235 +302,222 @@ CShapes_Cut::CShapes_Cut(void)
 	);
 
 	//-----------------------------------------------------
-	CSG_Parameters	*pParameters;
-
-	pParameters	= Add_Parameters("CUT", _TL("Extent"), _TL(""));
-
-	pParameters->Add_Value(
-		NULL, "AX"	, _TL("Left")				, _TL(""), PARAMETER_TYPE_Double
+	Parameters.Add_Double(NULL, "AX", _TL("Left"            ), _TL(""), 0.0);
+	Parameters.Add_Double(NULL, "BX", _TL("Right"           ), _TL(""), 1.0);
+	Parameters.Add_Double(NULL, "AY", _TL("Bottom"          ), _TL(""), 0.0);
+	Parameters.Add_Double(NULL, "BY", _TL("Top"             ), _TL(""), 1.0);
+	Parameters.Add_Double(NULL, "DX", _TL("Horizontal Range"), _TL(""), 1.0, 0.0, true);
+	Parameters.Add_Double(NULL, "DY", _TL("Vertical Range"  ), _TL(""), 1.0, 0.0, true);
+
+	Parameters.Add_Grid_System(
+		NULL	, "GRID_SYS"	, _TL("Grid System"),
+		_TL("")
 	);
 
-	pParameters->Add_Value(
-		NULL, "BX"	, _TL("Right")				, _TL(""), PARAMETER_TYPE_Double
-	);
-
-	pParameters->Add_Value(
-		NULL, "AY"	, _TL("Bottom")				, _TL(""), PARAMETER_TYPE_Double
-	);
-
-	pParameters->Add_Value(
-		NULL, "BY"	, _TL("Top")				, _TL(""), PARAMETER_TYPE_Double
-	);
-
-	pParameters->Add_Value(
-		NULL, "DX"	, _TL("Horizontal Range")	, _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	pParameters->Add_Value(
-		NULL, "DY"	, _TL("Vertical Range")		, _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-
-	pParameters	= Add_Parameters("GRID", _TL("Extent"), _TL(""));
-
-	pParameters->Add_Grid_System(
-		NULL, "GRID", _TL("Grid Project")		, _TL("")
-	);
-
-	pParameters	= Add_Parameters("SHAPES", _TL("Extent"), _TL(""));
-
-	pParameters->Add_Shapes(
-		NULL, "SHAPES", _TL("Shapes")			, _TL(""), PARAMETER_INPUT
+	Parameters.Add_Shapes(
+		NULL	, "SHAPES_EXT"	, _TL("Shapes"),
+		_TL(""),
+		PARAMETER_INPUT
 	);
 
-	pParameters	= Add_Parameters("POLYGONS", _TL("Polygons"), _TL(""));
-
-	pParameters->Add_Shapes(
-		NULL, "POLYGONS", _TL("Polygons")		, _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon
+	Parameters.Add_Shapes(
+		NULL	, "POLYGONS"	, _TL("Polygons"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Polygon
 	);
+
+	Parameters.Add_Double(
+		NULL	, "OVERLAP"		, _TL("Minimum Overlap"),
+		_TL("minimum overlapping area as percentage of the total size of the input shape. applies to polygon layers only."),
+		50.0, 0.0, true, 100.0, true
+	);
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CShapes_Cut::On_Execute(void)
+int CShapes_Cut::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
 {
-	int							Method;
-	CSG_Shapes					*pExtent, *pCut;
-	CSG_Parameter_Shapes_List	*pShapes, *pCuts;
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "SHAPES") )
+	{
+		if( pParameter->asShapesList()->Get_Count() > 0 )
+		{
+			CSG_Rect	Extent(pParameter->asShapesList()->asShapes(0)->Get_Extent());
 
-	//-----------------------------------------------------
-	pShapes	= Parameters("SHAPES")	->asShapesList();
-	pCuts	= Parameters("CUT")		->asShapesList();
-	pExtent	= Parameters("EXTENT")	->asShapes();
-	Method	= Parameters("METHOD")	->asInt();
+			for(int i=1; i<pParameter->asShapesList()->Get_Count(); i++)
+			{
+				Extent.Union(pParameter->asShapesList()->asShapes(i)->Get_Extent());
+			}
 
-	//-----------------------------------------------------
-	if( pShapes->Get_Count() > 0 )
+			pParameters->Set_Parameter("AX", Extent.Get_XMin  ());
+			pParameters->Set_Parameter("AY", Extent.Get_YMin  ());
+			pParameters->Set_Parameter("BX", Extent.Get_XMax  ());
+			pParameters->Set_Parameter("BY", Extent.Get_YMax  ());
+			pParameters->Set_Parameter("DX", Extent.Get_XRange());
+			pParameters->Set_Parameter("DY", Extent.Get_YRange());
+		}
+	}
+
+	else if( pParameters->Get_Parameter("EXTENT")->asInt() == 0 )
 	{
-		int			iLayer;
-		CSG_Rect	r(pShapes->asShapes(0)->Get_Extent());
+		double	ax	= pParameters->Get_Parameter("AX")->asDouble();
+		double	ay	= pParameters->Get_Parameter("AY")->asDouble();
+		double	bx	= pParameters->Get_Parameter("BX")->asDouble();
+		double	by	= pParameters->Get_Parameter("BY")->asDouble();
+		double	dx	= pParameters->Get_Parameter("DX")->asDouble();
+		double	dy	= pParameters->Get_Parameter("DY")->asDouble();
+
+		if( ax > bx )	{	double	d	= ax;	ax	= bx;	bx	= d;	}
+		if( ay > by )	{	double	d	= ay;	ay	= by;	by	= d;	}
 
-		for(iLayer=1; iLayer<pShapes->Get_Count(); iLayer++)
+		if     ( !SG_STR_CMP(pParameter->Get_Identifier(), "DX") )
 		{
-			r.Union(pShapes->asShapes(iLayer)->Get_Extent());
+			bx	= ax + dx;
+		}
+		else if( !SG_STR_CMP(pParameter->Get_Identifier(), "AX")
+			||   !SG_STR_CMP(pParameter->Get_Identifier(), "BX") )
+		{
+			dx	= bx - ax;
+		}
+		else if( !SG_STR_CMP(pParameter->Get_Identifier(), "DY") )
+		{
+			by	= ay + dy;
 		}
+		else if( !SG_STR_CMP(pParameter->Get_Identifier(), "AY")
+			||   !SG_STR_CMP(pParameter->Get_Identifier(), "BY") )
+		{
+			dy	= by - ay;
+		}
+
+		pParameters->Set_Parameter("AX", ax);
+		pParameters->Set_Parameter("AY", ay);
+		pParameters->Set_Parameter("BX", bx);
+		pParameters->Set_Parameter("BY", by);
+		pParameters->Set_Parameter("DX", dx);
+		pParameters->Set_Parameter("DY", dy);
+	}
+
+	return( CSG_Module::On_Parameter_Changed(pParameters, pParameter) );
+}
 
-		if( Get_Extent(r) )
+//---------------------------------------------------------
+int CShapes_Cut::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "EXTENT") )
+	{
+		pParameters->Set_Enabled("AX"        , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("AY"        , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("BX"        , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("BY"        , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("DX"        , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("DY"        , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("GRID_SYS"  , pParameter->asInt() == 1);
+		pParameters->Set_Enabled("SHAPES_EXT", pParameter->asInt() == 2);
+		pParameters->Set_Enabled("POLYGONS"  , pParameter->asInt() == 3);
+	}
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "SHAPES")
+	||  !SG_STR_CMP(pParameter->Get_Identifier(), "METHOD") )
+	{
+		bool	bEnable	= pParameters->Get_Parameter("METHOD")->asInt() == 1;	// intersects
+
+		if( bEnable )
 		{
-			pCuts->Del_Items();
+			CSG_Parameter_Shapes_List	*pShapes	= pParameters->Get_Parameter("SHAPES")->asShapesList();
 
-			Cut_Set_Extent(r, pExtent, true);
+			bEnable	= false;
 
-			for(iLayer=0; iLayer<pShapes->Get_Count(); iLayer++)
+			for(int i=0; !bEnable && i<pShapes->Get_Count(); i++)
 			{
-				if( m_pPolygons )
-				{
-					if( Cut_Shapes(m_pPolygons, Method, pShapes->asShapes(iLayer), pCut = SG_Create_Shapes()) )
-						pCuts->Add_Item(pCut);
-					else
-						delete(pCut);
-				}
-				else
-				{
-					if( Cut_Shapes(r, Method, pShapes->asShapes(iLayer), pCut = SG_Create_Shapes()) )
-						pCuts->Add_Item(pCut);
-					else
-						delete(pCut);
-				}
+				bEnable	= pShapes->asShapes(i)->Get_Type() == SHAPE_TYPE_Polygon;
 			}
-
-			return( pCuts->Get_Count() > 0 );
 		}
+
+		pParameters->Set_Enabled("OVERLAP"   , bEnable);
 	}
 
-	return( false );
+	return( CSG_Module::On_Parameter_Changed(pParameters, pParameter) );
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CShapes_Cut::Get_Extent(CSG_Rect &r)
+bool CShapes_Cut::On_Execute(void)
 {
-	m_pPolygons	= NULL;
+	CSG_Parameter_Shapes_List	*pShapes	= Parameters("SHAPES")->asShapesList();
 
-	switch( Parameters("TARGET")->asInt() )
+	if( pShapes->Get_Count() < 1 )
 	{
+		return( false );
+	}
+
 	//-----------------------------------------------------
-	case 0:	// user defined
-		Get_Parameters("CUT")->Get_Parameter("AX")->Set_Value(r.Get_XMin());
-		Get_Parameters("CUT")->Get_Parameter("AY")->Set_Value(r.Get_YMin());
-		Get_Parameters("CUT")->Get_Parameter("BX")->Set_Value(r.Get_XMax());
-		Get_Parameters("CUT")->Get_Parameter("BY")->Set_Value(r.Get_YMax());
-		Get_Parameters("CUT")->Get_Parameter("DX")->Set_Value(r.Get_XRange());
-		Get_Parameters("CUT")->Get_Parameter("DY")->Set_Value(r.Get_YRange());
-
-		if( Dlg_Parameters("CUT") )
-		{
-			r.Assign(
-				Get_Parameters("CUT")->Get_Parameter("AX")->asDouble(),
-				Get_Parameters("CUT")->Get_Parameter("AY")->asDouble(),
-				Get_Parameters("CUT")->Get_Parameter("BX")->asDouble(),
-				Get_Parameters("CUT")->Get_Parameter("BY")->asDouble()
-			);
+	CSG_Rect	Extent;
+	CSG_Shapes	Polygons(SHAPE_TYPE_Polygon), *pPolygons	= NULL;
 
-			return( true );
-		}
+	switch( Parameters("EXTENT")->asInt() )
+	{
+	case 0:	// user defined
+		Extent.Assign(
+			Parameters("AX")->asDouble(),
+			Parameters("AY")->asDouble(),
+			Parameters("BX")->asDouble(),
+			Parameters("BY")->asDouble()
+		);
 		break;
 
-	//-----------------------------------------------------
 	case 1:	// grid project
-		if( Dlg_Parameters("GRID") )
-		{
-			r.Assign(Get_Parameters("GRID")->Get_Parameter("GRID")->asGrid_System()->Get_Extent());
-
-			return( true );
-		}
+		Extent.Assign(Parameters("GRID_SYS")->asGrid_System()->Get_Extent());
 		break;
 
-	//-----------------------------------------------------
 	case 2:	// shapes extent
-		if( Dlg_Parameters("SHAPES") )
-		{
-			r.Assign(Get_Parameters("SHAPES")->Get_Parameter("SHAPES")->asShapes()->Get_Extent());
-
-			return( true );
-		}
+		Extent.Assign(Parameters("SHAPES_EXT")->asShapes()->Get_Extent());
 		break;
 
-	//-----------------------------------------------------
 	case 3:	// polygons
-		if( Dlg_Parameters("POLYGONS") )
-		{
-			r.Assign(Get_Parameters("POLYGONS")->Get_Parameter("POLYGONS")->asShapes()->Get_Extent());
+		pPolygons	= Parameters("POLYGONS")->asShapes();
+		break;
+	}
 
-			m_pPolygons	= Get_Parameters("POLYGONS")->Get_Parameter("POLYGONS")->asShapes();
+	if( !pPolygons )
+	{
+		CSG_Shape	*pPolygon	= Polygons.Add_Shape();
 
-			return( true );
-		}
-		break;
+		pPolygon->Add_Point(Extent.Get_XMin(), Extent.Get_YMin());
+		pPolygon->Add_Point(Extent.Get_XMin(), Extent.Get_YMax());
+		pPolygon->Add_Point(Extent.Get_XMax(), Extent.Get_YMax());
+		pPolygon->Add_Point(Extent.Get_XMax(), Extent.Get_YMin());
+
+		pPolygons	= &Polygons;
 	}
 
-	return( false );
-}
+	//-----------------------------------------------------
+	CSG_Parameter_Shapes_List	*pCuts	= Parameters("CUT")->asShapesList();
 
-//---------------------------------------------------------
-int CShapes_Cut::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameters->Get_Identifier(), SG_T("CUT")) )
-	{
-		double	ax, ay, bx, by, dx, dy, d;
+	pCuts->Del_Items();
 
-		ax	= pParameters->Get_Parameter("AX")->asDouble();
-		ay	= pParameters->Get_Parameter("AY")->asDouble();
-		bx	= pParameters->Get_Parameter("BX")->asDouble();
-		by	= pParameters->Get_Parameter("BY")->asDouble();
-		dx	= pParameters->Get_Parameter("DX")->asDouble();
-		dy	= pParameters->Get_Parameter("DY")->asDouble();
+	int	Method	= Parameters("METHOD")->asInt();
 
-		if( ax > bx )	{	d	= ax;	ax	= bx;	bx	= d;	}
-		if( ay > by )	{	d	= ay;	ay	= by;	by	= d;	}
+	double	Overlap	= Parameters("OVERLAP")->asDouble() / 100.0;
 
-		if     ( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DX")) )
-		{
-			bx	= ax + dx;
-		}
-		else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AX"))
-			||	 !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BX")) )
-		{
-			dx	= bx - ax;
-		}
+	for(int i=0; i<pShapes->Get_Count(); i++)
+	{
+		CSG_Shapes	*pCut	= Cut_Shapes(pPolygons, Method, pShapes->asShapes(i), Overlap);
 
-		else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DY")) )
-		{
-			by	= ay + dy;
-		}
-		else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AY"))
-			||	 !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BY")) )
+		if( pCut )
 		{
-			dy	= by - ay;
+			pCuts->Add_Item(pCut);
 		}
-
-		pParameters->Get_Parameter("AX")->Set_Value(ax);
-		pParameters->Get_Parameter("AY")->Set_Value(ay);
-		pParameters->Get_Parameter("BX")->Set_Value(bx);
-		pParameters->Get_Parameter("BY")->Set_Value(by);
-		pParameters->Get_Parameter("DX")->Set_Value(dx);
-		pParameters->Get_Parameter("DY")->Set_Value(dy);
-
-		return( true );
 	}
 
-	return( false );
+	//-----------------------------------------------------
+	return( pCuts->Get_Count() > 0 );
 }
 
 
diff --git a/src/modules/shapes/shapes_tools/shapes_cut.h b/src/modules/shapes/shapes_tools/shapes_cut.h
index 40dcafc..e0e76d7 100755
--- a/src/modules/shapes/shapes_tools/shapes_cut.h
+++ b/src/modules/shapes/shapes_tools/shapes_cut.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_cut.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,9 +72,10 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CSG_Shapes *	Cut_Shapes		(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes);
+CSG_Shapes *	Cut_Shapes		(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes                  , double Overlap = 0.0);
+bool			Cut_Shapes		(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut, double Overlap = 0.0);
+
 CSG_Shapes *	Cut_Shapes		(CSG_Rect    Extent   , int Method, CSG_Shapes *pShapes);
-bool			Cut_Shapes		(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut);
 bool			Cut_Shapes		(CSG_Rect    Extent   , int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut);
 
 CSG_String		Cut_Methods_Str	(void);
@@ -84,8 +85,6 @@ bool			Cut_Set_Extent	(CSG_Rect Extent, CSG_Shapes *pExtent, bool bClear);
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -100,17 +99,10 @@ public:
 protected:
 
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 
 	virtual bool				On_Execute				(void);
 
-
-private:
-
-	CSG_Shapes					*m_pPolygons;
-
-
-	bool						Get_Extent				(CSG_Rect &r);
-
 };
 
 
diff --git a/src/modules/shapes/shapes_tools/shapes_cut_interactive.cpp b/src/modules/shapes/shapes_tools/shapes_cut_interactive.cpp
index 2360379..631c592 100755
--- a/src/modules/shapes/shapes_tools/shapes_cut_interactive.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_cut_interactive.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_cut_interactive.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -58,8 +58,6 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include <string.h>
-
 #include "shapes_cut_interactive.h"
 
 
@@ -72,9 +70,9 @@
 //---------------------------------------------------------
 CShapes_Cut_Interactive::CShapes_Cut_Interactive(void)
 {
-	Set_Name		(_TL("Cut Shapes Layer"));
+	Set_Name		(_TL("Copy Selected Shapes"));
 
-	Set_Author		(SG_T("(c) 2006 by O.Conrad"));
+	Set_Author		("O.Conrad (c) 2006");
 
 	Set_Description	(_TW(
 		""
@@ -84,66 +82,111 @@ CShapes_Cut_Interactive::CShapes_Cut_Interactive(void)
 
 	//-----------------------------------------------------
 	Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("Shapes"),
+		NULL	, "SHAPES"	, _TL("Shapes"),
 		_TL(""),
 		PARAMETER_INPUT
 	);
 
 	Parameters.Add_Shapes(
-		NULL	, "CUT"			, _TL("Cut"),
+		NULL	, "CUT"		, _TL("Selection"),
 		_TL(""),
 		PARAMETER_OUTPUT
 	);
 
 	Parameters.Add_Shapes(
-		NULL	, "EXTENT"		, _TL("Extent"),
+		NULL	, "EXTENT"	, _TL("Extent"),
 		_TL(""),
 		PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon
 	);
 
 	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Method"),
+		NULL	, "METHOD"	, _TL("Method"),
 		_TL(""),
-		Cut_Methods_Str(), 0
+		Cut_Methods_Str(), 1
+	);
+
+	Parameters.Add_Bool(
+		NULL	, "CONFIRM"	, _TL("Confirm"),
+		_TL("Show a confirmation dialog before selection is performed"),
+		false
 	);
 
 	//-----------------------------------------------------
 	CSG_Parameters	*pParameters	= Add_Parameters("CUT", _TL("Extent"), _TL(""));
 
-	pParameters->Add_Value(
-		NULL, "AX"	, _TL("Left")				, _TL(""), PARAMETER_TYPE_Double
-	);
+	pParameters->Add_Double(NULL, "AX", _TL("Left"            ), _TL(""), 0.0);
+	pParameters->Add_Double(NULL, "BX", _TL("Right"           ), _TL(""), 1.0);
+	pParameters->Add_Double(NULL, "AY", _TL("Bottom"          ), _TL(""), 0.0);
+	pParameters->Add_Double(NULL, "BY", _TL("Top"             ), _TL(""), 1.0);
+	pParameters->Add_Double(NULL, "DX", _TL("Horizontal Range"), _TL(""), 1.0, 0.0, true);
+	pParameters->Add_Double(NULL, "DY", _TL("Vertical Range"  ), _TL(""), 1.0, 0.0, true);
+}
 
-	pParameters->Add_Value(
-		NULL, "BX"	, _TL("Right")				, _TL(""), PARAMETER_TYPE_Double
-	);
 
-	pParameters->Add_Value(
-		NULL, "AY"	, _TL("Bottom")				, _TL(""), PARAMETER_TYPE_Double
-	);
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
 
-	pParameters->Add_Value(
-		NULL, "BY"	, _TL("Top")				, _TL(""), PARAMETER_TYPE_Double
-	);
+//---------------------------------------------------------
+int CShapes_Cut_Interactive::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameters->Get_Identifier(), "CUT") )
+	{
+		double	ax	= pParameters->Get_Parameter("AX")->asDouble();
+		double	ay	= pParameters->Get_Parameter("AY")->asDouble();
+		double	bx	= pParameters->Get_Parameter("BX")->asDouble();
+		double	by	= pParameters->Get_Parameter("BY")->asDouble();
+		double	dx	= pParameters->Get_Parameter("DX")->asDouble();
+		double	dy	= pParameters->Get_Parameter("DY")->asDouble();
 
-	pParameters->Add_Value(
-		NULL, "DX"	, _TL("Horizontal Range")	, _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
+		if( ax > bx )	{	double	d	= ax;	ax	= bx;	bx	= d;	}
+		if( ay > by )	{	double	d	= ay;	ay	= by;	by	= d;	}
 
-	pParameters->Add_Value(
-		NULL, "DY"	, _TL("Vertical Range")		, _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true
-	);
-}
+		if     ( !SG_STR_CMP(pParameter->Get_Identifier(), "DX") )
+		{
+			bx	= ax + dx;
+		}
+		else if( !SG_STR_CMP(pParameter->Get_Identifier(), "AX")
+			||   !SG_STR_CMP(pParameter->Get_Identifier(), "BX") )
+		{
+			dx	= bx - ax;
+		}
 
-//---------------------------------------------------------
-CShapes_Cut_Interactive::~CShapes_Cut_Interactive(void)
-{}
+		else if( !SG_STR_CMP(pParameter->Get_Identifier(), "DY") )
+		{
+			by	= ay + dy;
+		}
+		else if( !SG_STR_CMP(pParameter->Get_Identifier(), "AY")
+			||   !SG_STR_CMP(pParameter->Get_Identifier(), "BY") )
+		{
+			dy	= by - ay;
+		}
+
+		pParameters->Set_Parameter("AX", ax);
+		pParameters->Set_Parameter("AY", ay);
+		pParameters->Set_Parameter("BX", bx);
+		pParameters->Set_Parameter("BY", by);
+		pParameters->Set_Parameter("DX", dx);
+		pParameters->Set_Parameter("DY", dy);
+	}
+
+	//-----------------------------------------------------
+	else if( !SG_STR_CMP(pParameter->Get_Identifier(), "SHAPES") && pParameter->asShapes() )
+	{
+		CSG_Shapes	*pCut	= pParameters->Get_Parameter("CUT")->asShapes();
+
+		if( pCut != DATAOBJECT_NOTSET && pCut != DATAOBJECT_CREATE && pCut->Get_Type() != pParameter->asShapes()->Get_Type() )
+		{
+			pParameters->Get_Parameter("CUT")->Set_Value(DATAOBJECT_CREATE);
+		}
+	}
+
+	return( CSG_Module::On_Parameter_Changed(pParameters, pParameter) );
+}
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
@@ -151,16 +194,22 @@ bool CShapes_Cut_Interactive::On_Execute(void)
 {
 	m_bDown		= false;
 
-	m_pShapes	= Parameters("SHAPES")	->asShapes();
-	m_pCut		= Parameters("CUT")		->asShapes();
-	m_pExtent	= Parameters("EXTENT")	->asShapes();
-	m_Method	= Parameters("METHOD")	->asInt();
+	m_pShapes	= Parameters("SHAPES" )->asShapes();
+	m_pCut		= Parameters("CUT"    )->asShapes();
+	m_pExtent	= Parameters("EXTENT" )->asShapes();
+	m_Method	= Parameters("METHOD" )->asInt   ();
+	m_bConfirm	= Parameters("CONFIRM")->asBool  ();
 
 	m_pCut->Create(m_pShapes->Get_Type());
 
 	return( true );
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 bool CShapes_Cut_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
 {
@@ -173,8 +222,7 @@ bool CShapes_Cut_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_
 			m_bDown	= true;
 			m_pDown	= ptWorld;
 		}
-
-		return( true );
+		break;
 
 	//-----------------------------------------------------
 	case MODULE_INTERACTIVE_LUP:
@@ -182,16 +230,16 @@ bool CShapes_Cut_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_
 		{
 			m_bDown	= false;
 
-			CSG_Rect	r(m_pDown, ptWorld);
+			CSG_Rect	Extent(m_pDown, ptWorld);
 
-			if( Get_Extent(r) )
+			if( !m_bConfirm || Get_Extent(Extent) )
 			{
-				if( Cut_Set_Extent(r, m_pExtent, true) )
+				if( Cut_Set_Extent(Extent, m_pExtent, true) )
 				{
 					DataObject_Update(m_pExtent);
 				}
 
-				if( Cut_Shapes(r, m_Method, m_pShapes, m_pCut) )
+				if( Cut_Shapes(Extent, m_Method, m_pShapes, m_pCut) )
 				{
 					DataObject_Update(m_pCut);
 				}
@@ -201,85 +249,35 @@ bool CShapes_Cut_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_
 				}
 			}
 		}
-
-		return( true );
+		break;
 	}
 
+	//-----------------------------------------------------
 	return( true );
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-int CShapes_Cut_Interactive::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
-{
-	if( !SG_STR_CMP(pParameters->Get_Identifier(), SG_T("CUT")) )
-	{
-		double	ax, ay, bx, by, dx, dy, d;
-
-		ax	= pParameters->Get_Parameter("AX")->asDouble();
-		ay	= pParameters->Get_Parameter("AY")->asDouble();
-		bx	= pParameters->Get_Parameter("BX")->asDouble();
-		by	= pParameters->Get_Parameter("BY")->asDouble();
-		dx	= pParameters->Get_Parameter("DX")->asDouble();
-		dy	= pParameters->Get_Parameter("DY")->asDouble();
-
-		if( ax > bx )	{	d	= ax;	ax	= bx;	bx	= d;	}
-		if( ay > by )	{	d	= ay;	ay	= by;	by	= d;	}
-
-		if     ( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DX")) )
-		{
-			bx	= ax + dx;
-		}
-		else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AX"))
-			||	 !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BX")) )
-		{
-			dx	= bx - ax;
-		}
-
-		else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DY")) )
-		{
-			by	= ay + dy;
-		}
-		else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AY"))
-			||	 !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BY")) )
-		{
-			dy	= by - ay;
-		}
-
-		pParameters->Get_Parameter("AX")->Set_Value(ax);
-		pParameters->Get_Parameter("AY")->Set_Value(ay);
-		pParameters->Get_Parameter("BX")->Set_Value(bx);
-		pParameters->Get_Parameter("BY")->Set_Value(by);
-		pParameters->Get_Parameter("DX")->Set_Value(dx);
-		pParameters->Get_Parameter("DY")->Set_Value(dy);
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CShapes_Cut_Interactive::Get_Extent(CSG_Rect &r)
+bool CShapes_Cut_Interactive::Get_Extent(CSG_Rect &Extent)
 {
 	CSG_Parameters	*pParameters	= Get_Parameters("CUT");
 
-	pParameters->Get_Parameter("AX")->Set_Value(r.Get_XMin());
-	pParameters->Get_Parameter("AY")->Set_Value(r.Get_YMin());
-	pParameters->Get_Parameter("BX")->Set_Value(r.Get_XMax());
-	pParameters->Get_Parameter("BY")->Set_Value(r.Get_YMax());
-	pParameters->Get_Parameter("DX")->Set_Value(r.Get_XRange());
-	pParameters->Get_Parameter("DY")->Set_Value(r.Get_YRange());
+	pParameters->Set_Callback(false);
+	pParameters->Set_Parameter("AX", Extent.Get_XMin  ());
+	pParameters->Set_Parameter("AY", Extent.Get_YMin  ());
+	pParameters->Set_Parameter("BX", Extent.Get_XMax  ());
+	pParameters->Set_Parameter("BY", Extent.Get_YMax  ());
+	pParameters->Set_Parameter("DX", Extent.Get_XRange());
+	pParameters->Set_Parameter("DY", Extent.Get_YRange());
+	pParameters->Set_Callback(true);
 
 	if( Dlg_Parameters("CUT") )
 	{
-		r.Assign(
+		Extent.Assign(
 			pParameters->Get_Parameter("AX")->asDouble(),
 			pParameters->Get_Parameter("AY")->asDouble(),
 			pParameters->Get_Parameter("BX")->asDouble(),
diff --git a/src/modules/shapes/shapes_tools/shapes_cut_interactive.h b/src/modules/shapes/shapes_tools/shapes_cut_interactive.h
index 71c4480..af790a5 100755
--- a/src/modules/shapes/shapes_tools/shapes_cut_interactive.h
+++ b/src/modules/shapes/shapes_tools/shapes_cut_interactive.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_cut_interactive.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -61,6 +61,13 @@
 #ifndef HEADER_INCLUDED__Shapes_Cut_Interactive_H
 #define HEADER_INCLUDED__Shapes_Cut_Interactive_H
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #include "shapes_cut.h"
 
@@ -76,7 +83,6 @@ class CShapes_Cut_Interactive : public CSG_Module_Interactive
 {
 public:
 	CShapes_Cut_Interactive(void);
-	virtual ~CShapes_Cut_Interactive(void);
 
 	virtual CSG_String			Get_MenuPath			(void)	{	return( _TL("A:Shapes|Construction") );	}
 
@@ -86,12 +92,13 @@ protected:
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 
 	virtual bool				On_Execute				(void);
+
 	virtual bool				On_Execute_Position		(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
 
 
 private:
 
-	bool						m_bDown;
+	bool						m_bDown, m_bConfirm;
 
 	int							m_Method;
 
@@ -100,7 +107,7 @@ private:
 	CSG_Shapes					*m_pShapes, *m_pCut, *m_pExtent;
 
 
-	bool						Get_Extent				(CSG_Rect &r);
+	bool						Get_Extent				(CSG_Rect &Extent);
 
 };
 
diff --git a/src/modules/shapes/shapes_tools/shapes_extents.cpp b/src/modules/shapes/shapes_tools/shapes_extents.cpp
index 2c55eaa..e50dd9f 100755
--- a/src/modules/shapes/shapes_tools/shapes_extents.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_extents.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_extents.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_extents.h b/src/modules/shapes/shapes_tools/shapes_extents.h
index bbf8986..6878ea4 100755
--- a/src/modules/shapes/shapes_tools/shapes_extents.h
+++ b/src/modules/shapes/shapes_tools/shapes_extents.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_extents.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_generate.cpp b/src/modules/shapes/shapes_tools/shapes_generate.cpp
index 0dc9272..280cc6c 100755
--- a/src/modules/shapes/shapes_tools/shapes_generate.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_generate.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_generate.cpp 2813 2016-02-22 21:30:40Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_generate.h b/src/modules/shapes/shapes_tools/shapes_generate.h
index bbd53e1..9e79242 100755
--- a/src/modules/shapes/shapes_tools/shapes_generate.h
+++ b/src/modules/shapes/shapes_tools/shapes_generate.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_generate.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_split.cpp b/src/modules/shapes/shapes_tools/shapes_split.cpp
index 72f4fd5..a91fb71 100755
--- a/src/modules/shapes/shapes_tools/shapes_split.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_split.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_split.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_split.h b/src/modules/shapes/shapes_tools/shapes_split.h
index 57d23e1..7046cfc 100755
--- a/src/modules/shapes/shapes_tools/shapes_split.h
+++ b/src/modules/shapes/shapes_tools/shapes_split.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_split.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_split_by_attribute.cpp b/src/modules/shapes/shapes_tools/shapes_split_by_attribute.cpp
index cd3a13f..5cc8905 100755
--- a/src/modules/shapes/shapes_tools/shapes_split_by_attribute.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_split_by_attribute.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_split_by_attribute.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_split_by_attribute.h b/src/modules/shapes/shapes_tools/shapes_split_by_attribute.h
index dd3b2b3..95e961d 100755
--- a/src/modules/shapes/shapes_tools/shapes_split_by_attribute.h
+++ b/src/modules/shapes/shapes_tools/shapes_split_by_attribute.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_split_by_attribute.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp b/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp
index da11160..0a7cb91 100755
--- a/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp
+++ b/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_split_randomly.cpp 2642 2015-10-08 11:57:54Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_tools/shapes_split_randomly.h b/src/modules/shapes/shapes_tools/shapes_split_randomly.h
index a66605e..db9b9a4 100755
--- a/src/modules/shapes/shapes_tools/shapes_split_randomly.h
+++ b/src/modules/shapes/shapes_tools/shapes_split_randomly.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_split_randomly.h 2642 2015-10-08 11:57:54Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_transect/MLB_Interface.cpp b/src/modules/shapes/shapes_transect/MLB_Interface.cpp
index c042e52..581644f 100755
--- a/src/modules/shapes/shapes_transect/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_transect/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_transect/MLB_Interface.h b/src/modules/shapes/shapes_transect/MLB_Interface.h
index 22c9a4e..85de1f8 100755
--- a/src/modules/shapes/shapes_transect/MLB_Interface.h
+++ b/src/modules/shapes/shapes_transect/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_transect/Makefile.am b/src/modules/shapes/shapes_transect/Makefile.am
index 2521a9f..acd3c74 100755
--- a/src/modules/shapes/shapes_transect/Makefile.am
+++ b/src/modules/shapes/shapes_transect/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/shapes/shapes_transect/Makefile.in b/src/modules/shapes/shapes_transect/Makefile.in
index 5d5c378..41b6ce9 100644
--- a/src/modules/shapes/shapes_transect/Makefile.in
+++ b/src/modules/shapes/shapes_transect/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/shapes/shapes_transect
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -212,6 +222,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +256,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +281,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +371,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -362,7 +382,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -393,7 +413,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/shapes/shapes_transect/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/shapes/shapes_transect/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -696,6 +715,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/shapes/shapes_transect/Polygon_Transect.cpp b/src/modules/shapes/shapes_transect/Polygon_Transect.cpp
index e276bd0..08fd3ca 100755
--- a/src/modules/shapes/shapes_transect/Polygon_Transect.cpp
+++ b/src/modules/shapes/shapes_transect/Polygon_Transect.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Transect.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_transect/Polygon_Transect.h b/src/modules/shapes/shapes_transect/Polygon_Transect.h
index c53da92..cda68b4 100755
--- a/src/modules/shapes/shapes_transect/Polygon_Transect.h
+++ b/src/modules/shapes/shapes_transect/Polygon_Transect.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Polygon_Transect.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/simulation/Makefile.in b/src/modules/simulation/Makefile.in
index 11d18c9..f9027ec 100644
--- a/src/modules/simulation/Makefile.in
+++ b/src/modules/simulation/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,9 +89,9 @@ build_triplet = @build@
 host_triplet = @host@
 @LIBFIRE_TRUE at am__append_1 = sim_fire_spreading
 subdir = src/modules/simulation
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -91,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -152,6 +163,7 @@ CTAGS = ctags
 DIST_SUBDIRS = sim_cellular_automata sim_ecosystems_hugget sim_erosion \
 	sim_hydrology sim_ihacres sim_qm_of_esp sim_rivflow \
 	sim_fire_spreading
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -210,6 +222,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -228,6 +247,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -317,6 +337,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -343,7 +364,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -638,6 +658,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/simulation/sim_cellular_automata/Makefile.in b/src/modules/simulation/sim_cellular_automata/Makefile.in
index 86094de..634076e 100644
--- a/src/modules/simulation/sim_cellular_automata/Makefile.in
+++ b/src/modules/simulation/sim_cellular_automata/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/simulation/sim_cellular_automata
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -396,7 +416,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_cellular_automata/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/sim_cellular_automata/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -700,6 +719,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/simulation/sim_ecosystems_hugget/Makefile.in b/src/modules/simulation/sim_ecosystems_hugget/Makefile.in
index 5b5d8c8..af856e0 100644
--- a/src/modules/simulation/sim_ecosystems_hugget/Makefile.in
+++ b/src/modules/simulation/sim_ecosystems_hugget/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/simulation/sim_ecosystems_hugget
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -398,7 +418,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_ecosystems_hugget/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/sim_ecosystems_hugget/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -703,6 +722,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/simulation/sim_erosion/MLB_Interface.cpp b/src/modules/simulation/sim_erosion/MLB_Interface.cpp
index d8c0683..630e061 100755
--- a/src/modules/simulation/sim_erosion/MLB_Interface.cpp
+++ b/src/modules/simulation/sim_erosion/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2454 2015-03-22 15:48:12Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/simulation/sim_erosion/MLB_Interface.h b/src/modules/simulation/sim_erosion/MLB_Interface.h
index 918ebb7..dbf06f2 100755
--- a/src/modules/simulation/sim_erosion/MLB_Interface.h
+++ b/src/modules/simulation/sim_erosion/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 2454 2015-03-22 15:48:12Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/simulation/sim_erosion/MMF_SAGA.cpp b/src/modules/simulation/sim_erosion/MMF_SAGA.cpp
index 303598f..b5f68f5 100755
--- a/src/modules/simulation/sim_erosion/MMF_SAGA.cpp
+++ b/src/modules/simulation/sim_erosion/MMF_SAGA.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MMF_SAGA.cpp 2455 2015-03-22 15:54:14Z reklov_w $
+ * Version $Id$
  *********************************************************/
  
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/simulation/sim_erosion/MMF_SAGA.h b/src/modules/simulation/sim_erosion/MMF_SAGA.h
index fcd2cdd..2f58868 100755
--- a/src/modules/simulation/sim_erosion/MMF_SAGA.h
+++ b/src/modules/simulation/sim_erosion/MMF_SAGA.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MMF_SAGA.h 2455 2015-03-22 15:54:14Z reklov_w $
+ * Version $Id$
  *********************************************************/
  
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/simulation/sim_erosion/Makefile.in b/src/modules/simulation/sim_erosion/Makefile.in
index 90698b3..1483fab 100644
--- a/src/modules/simulation/sim_erosion/Makefile.in
+++ b/src/modules/simulation/sim_erosion/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/simulation/sim_erosion
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -211,6 +221,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -244,6 +255,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -262,6 +280,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -351,6 +370,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -392,7 +412,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_erosion/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/sim_erosion/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -695,6 +714,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/simulation/sim_fire_spreading/Makefile.in b/src/modules/simulation/sim_fire_spreading/Makefile.in
index 170cac6..b434514 100644
--- a/src/modules/simulation/sim_fire_spreading/Makefile.in
+++ b/src/modules/simulation/sim_fire_spreading/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/simulation/sim_fire_spreading
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -398,7 +418,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_fire_spreading/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/sim_fire_spreading/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -727,6 +746,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/simulation/sim_hydrology/Makefile.in b/src/modules/simulation/sim_hydrology/Makefile.in
index 8880845..2ed4dc6 100644
--- a/src/modules/simulation/sim_hydrology/Makefile.in
+++ b/src/modules/simulation/sim_hydrology/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/simulation/sim_hydrology
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -409,7 +429,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_hydrology/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/sim_hydrology/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -719,6 +738,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/simulation/sim_hydrology/topmodel.cpp b/src/modules/simulation/sim_hydrology/topmodel.cpp
index a6b4aa1..d37f73d 100755
--- a/src/modules/simulation/sim_hydrology/topmodel.cpp
+++ b/src/modules/simulation/sim_hydrology/topmodel.cpp
@@ -89,7 +89,7 @@ CTOPMODEL::CTOPMODEL(void)
 		"(Centre for Research on Environmental Systems and Statistics, "
 		"Institute of Environmental and Biological Sciences, "
 		"Lancaster University, Lancaster LA1 4YQ, UK) "
-		"and the C translation of the Fortran source codes implementated in GRASS.\n\n"
+		"and the C translation of the Fortran source codes implemented in GRASS.\n\n"
 
 		"This program allows single or multiple subcatchment calculations "
 		"but with single average rainfall and potential evapotranspiration "
diff --git a/src/modules/simulation/sim_ihacres/Makefile.in b/src/modules/simulation/sim_ihacres/Makefile.in
index bd23638..76d2dd8 100644
--- a/src/modules/simulation/sim_ihacres/Makefile.in
+++ b/src/modules/simulation/sim_ihacres/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/simulation/sim_ihacres
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -413,7 +433,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_ihacres/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/sim_ihacres/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -725,6 +744,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/simulation/sim_ihacres/ihacres_basin.h b/src/modules/simulation/sim_ihacres/ihacres_basin.h
index 85396de..7221598 100755
--- a/src/modules/simulation/sim_ihacres/ihacres_basin.h
+++ b/src/modules/simulation/sim_ihacres/ihacres_basin.h
@@ -218,7 +218,7 @@ private:
 	//----------------------------------
 	C_IHAC_LinearParms*		m_p_linparms;		// parameters of the linear storage module
 	C_IHAC_NonLinearParms*	m_p_nonlinparms;	// parameters of the non-linear rainfall loss module
-	CSnowParms*		m_pSnowparms;				// 3 snow module paramters
+	CSnowParms*		m_pSnowparms;				// 3 snow module parameters
 	CSnowModule*	m_p_SnowModule;
 	//int				m_delay;
 	double			m_vq;
diff --git a/src/modules/simulation/sim_ihacres/ihacres_elev.h b/src/modules/simulation/sim_ihacres/ihacres_elev.h
index daab435..a2895ca 100755
--- a/src/modules/simulation/sim_ihacres/ihacres_elev.h
+++ b/src/modules/simulation/sim_ihacres/ihacres_elev.h
@@ -110,7 +110,7 @@ private:
 	//----------------------------------
 	C_IHAC_LinearParms*		m_p_linparms;		// parameters of the linear storage module
 	C_IHAC_NonLinearParms*	m_p_nonlinparms;	// parameters of the non-linear rainfall loss module
-	CSnowParms*		m_pSnowparms;				// 3 snow module paramters
+	CSnowParms*		m_pSnowparms;				// 3 snow module parameters
 	CSnowModule*	m_p_SnowModule;
 	int				m_delay;
 	double			m_vq;
diff --git a/src/modules/simulation/sim_ihacres/ihacres_eq.h b/src/modules/simulation/sim_ihacres/ihacres_eq.h
index 7559e55..6507bb7 100755
--- a/src/modules/simulation/sim_ihacres/ihacres_eq.h
+++ b/src/modules/simulation/sim_ihacres/ihacres_eq.h
@@ -260,7 +260,7 @@ public:
 
 	///////////////////////////////////////////////////////////////////
 	//
-	// PUBLIC MEMEBER VARIABLES
+	// PUBLIC MEMBER VARIABLES
 	//
 	///////////////////////////////////////////////////////////////////
 
diff --git a/src/modules/simulation/sim_qm_of_esp/Makefile.in b/src/modules/simulation/sim_qm_of_esp/Makefile.in
index 5514bae..c357d88 100644
--- a/src/modules/simulation/sim_qm_of_esp/Makefile.in
+++ b/src/modules/simulation/sim_qm_of_esp/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/simulation/sim_qm_of_esp
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -402,7 +422,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_qm_of_esp/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/sim_qm_of_esp/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -709,6 +728,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/simulation/sim_rivflow/Makefile.in b/src/modules/simulation/sim_rivflow/Makefile.in
index b87e5f8..dc9f42f 100644
--- a/src/modules/simulation/sim_rivflow/Makefile.in
+++ b/src/modules/simulation/sim_rivflow/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/simulation/sim_rivflow
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -212,6 +222,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -245,6 +256,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -263,6 +281,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -352,6 +371,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -403,7 +423,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_rivflow/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/simulation/sim_rivflow/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -711,6 +730,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/statistics/Makefile.in b/src/modules/statistics/Makefile.in
index 4989519..ea38ec6 100644
--- a/src/modules/statistics/Makefile.in
+++ b/src/modules/statistics/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/statistics
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -150,6 +161,7 @@ ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = statistics_points statistics_grid statistics_regression \
 	statistics_kriging
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -208,6 +220,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -226,6 +245,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -315,6 +335,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -340,7 +361,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/statistics/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -635,6 +655,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/statistics/statistics_grid/MLB_Interface.cpp b/src/modules/statistics/statistics_grid/MLB_Interface.cpp
index e441942..8b9917f 100755
--- a/src/modules/statistics/statistics_grid/MLB_Interface.cpp
+++ b/src/modules/statistics/statistics_grid/MLB_Interface.cpp
@@ -108,6 +108,7 @@ CSG_String Get_Info(int i)
 #include "grid_pca.h"
 #include "multiband_variation.h"
 #include "grid_latlon_statistics.h"
+#include "categorical_variation.h"
 
 
 //---------------------------------------------------------
@@ -131,9 +132,11 @@ CSG_Module *		Create_Module(int i)
 	case 11:	return( new CGrid_Statistics_Latitudinal );
 	case 12:	return( new CGrid_Statistics_Meridional );
 	case 13:	return( new CGSGrid_Statistics_To_Table );
-	}
+	case 14:	return( new CCategorical_Variation );
 
-	return( NULL );
+	case 15:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
 }
 
 
diff --git a/src/modules/statistics/statistics_grid/Makefile.am b/src/modules/statistics/statistics_grid/Makefile.am
index ac0a5a6..714e40f 100755
--- a/src/modules/statistics/statistics_grid/Makefile.am
+++ b/src/modules/statistics/statistics_grid/Makefile.am
@@ -11,6 +11,7 @@ AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
 AM_LDFLAGS         = -fPIC -shared -avoid-version 
 pkglib_LTLIBRARIES = libstatistics_grid.la
 libstatistics_grid_la_SOURCES =\
+categorical_variation.cpp\
 fast_representativeness.cpp\
 grid_autocorrelation.cpp\
 grid_latlon_statistics.cpp\
@@ -23,6 +24,7 @@ GSGrid_Variance.cpp\
 GSGrid_Variance_Radius.cpp\
 GSGrid_Zonal_Statistics.cpp\
 MLB_Interface.cpp\
+categorical_variation.h\
 fast_representativeness.h\
 grid_autocorrelation.h\
 grid_latlon_statistics.h\
diff --git a/src/modules/statistics/statistics_grid/Makefile.in b/src/modules/statistics/statistics_grid/Makefile.in
index fb4ef86..f72d255 100644
--- a/src/modules/statistics/statistics_grid/Makefile.in
+++ b/src/modules/statistics/statistics_grid/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/statistics/statistics_grid
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -127,10 +137,11 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libstatistics_grid_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libstatistics_grid_la_OBJECTS = fast_representativeness.lo \
-	grid_autocorrelation.lo grid_latlon_statistics.lo grid_pca.lo \
-	multiband_variation.lo GSGrid_Directional_Statistics.lo \
-	GSGrid_Residuals.lo GSGrid_Statistics.lo GSGrid_Variance.lo \
+am_libstatistics_grid_la_OBJECTS = categorical_variation.lo \
+	fast_representativeness.lo grid_autocorrelation.lo \
+	grid_latlon_statistics.lo grid_pca.lo multiband_variation.lo \
+	GSGrid_Directional_Statistics.lo GSGrid_Residuals.lo \
+	GSGrid_Statistics.lo GSGrid_Variance.lo \
 	GSGrid_Variance_Radius.lo GSGrid_Zonal_Statistics.lo \
 	MLB_Interface.lo
 libstatistics_grid_la_OBJECTS = $(am_libstatistics_grid_la_OBJECTS)
@@ -216,6 +227,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +261,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +286,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +376,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -375,6 +396,7 @@ AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
 AM_LDFLAGS = -fPIC -shared -avoid-version 
 pkglib_LTLIBRARIES = libstatistics_grid.la
 libstatistics_grid_la_SOURCES = \
+categorical_variation.cpp\
 fast_representativeness.cpp\
 grid_autocorrelation.cpp\
 grid_latlon_statistics.cpp\
@@ -387,6 +409,7 @@ GSGrid_Variance.cpp\
 GSGrid_Variance_Radius.cpp\
 GSGrid_Zonal_Statistics.cpp\
 MLB_Interface.cpp\
+categorical_variation.h\
 fast_representativeness.h\
 grid_autocorrelation.h\
 grid_latlon_statistics.h\
@@ -417,7 +440,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/statistics_grid/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/statistics/statistics_grid/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -487,6 +509,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Variance_Radius.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GSGrid_Zonal_Statistics.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/categorical_variation.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fast_representativeness.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_autocorrelation.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid_latlon_statistics.Plo at am__quote@
@@ -730,6 +753,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/grid/grid_filter/Filter.cpp b/src/modules/statistics/statistics_grid/categorical_variation.cpp
similarity index 57%
copy from src/modules/grid/grid_filter/Filter.cpp
copy to src/modules/statistics/statistics_grid/categorical_variation.cpp
index 1a99154..3ab2bc3 100755
--- a/src/modules/grid/grid_filter/Filter.cpp
+++ b/src/modules/statistics/statistics_grid/categorical_variation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter.cpp 2629 2015-10-01 09:40:40Z oconrad $
+ * Version $Id: categorical_variation.cpp 1921 2014-01-09 10:24:11Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,13 +9,13 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                      Grid_Filter                      //
+//                    statistics_grid                    //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                      Filter.cpp                       //
+//               categorical_variation.cpp               //
 //                                                       //
-//                 Copyright (C) 2003 by                 //
+//                 Copyright (C) 2016 by                 //
 //                      Olaf Conrad                      //
 //                                                       //
 //-------------------------------------------------------//
@@ -44,9 +44,7 @@
 //                                                       //
 //    contact:    Olaf Conrad                            //
 //                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
+//                University of Hamburg                  //
 //                Germany                                //
 //                                                       //
 ///////////////////////////////////////////////////////////
@@ -61,7 +59,7 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include "Filter.h"
+#include "categorical_variation.h"
 
 
 ///////////////////////////////////////////////////////////
@@ -71,54 +69,54 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CFilter::CFilter(void)
+CCategorical_Variation::CCategorical_Variation(void)
 {
-	//-----------------------------------------------------
-	Set_Name		(_TL("Simple Filter"));
+	Set_Name		(_TL("Categorical Coincidence"));
 
-	Set_Author		("O.Conrad (c) 2003");
+	Set_Author		("O.Conrad (c) 2016");
 
 	Set_Description	(_TW(
-		"Simple standard filters for grids."
+		"Calculates for each cell the categorical coincidence, "
+		"which can be useful to compare different classifications."
 	));
 
-	//-----------------------------------------------------
-	Parameters.Add_Grid(
-		NULL	, "INPUT"		, _TL("Grid"),
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
 		_TL(""),
 		PARAMETER_INPUT
 	);
 
 	Parameters.Add_Grid(
-		NULL	, "RESULT"		, _TL("Filtered Grid"),
+		NULL	, "CATEGORIES"	, _TL("Number of Categories"),
+		_TL(""),
+		PARAMETER_OUTPUT, true, SG_DATATYPE_Short
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "COINCIDENCE"	, _TL("Coincidence"),
 		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
+		PARAMETER_OUTPUT
 	);
 
-	Parameters.Add_Choice(
-		NULL	, "METHOD"		, _TL("Filter"),
+	Parameters.Add_Grid(
+		NULL	, "MAJ_COUNT"	, _TL("Dominance of Majority"),
 		_TL(""),
-		CSG_String::Format("%s|%s|%s|",
-			_TL("Smooth"),
-			_TL("Sharpen"),
-			_TL("Edge")
-		), 0
+		PARAMETER_OUTPUT
 	);
 
-	Parameters.Add_Choice(
-		NULL	, "MODE"		, _TL("Search Mode"),
+	Parameters.Add_Grid(
+		NULL	, "MAJ_VALUE"	, _TL("Value of Majority"),
 		_TL(""),
-		CSG_String::Format("%s|%s|",
-			_TL("Square"),
-			_TL("Circle")
-		), 1
+		PARAMETER_OUTPUT
 	);
 
 	Parameters.Add_Value(
-		NULL	, "RADIUS"		, _TL("Radius"),
+		NULL	, "RADIUS"		, _TL("Radius [Cells]"),
 		_TL(""),
-		PARAMETER_TYPE_Int, 1, 1, true
+		PARAMETER_TYPE_Int, 0.0, 0.0, true
 	);
+
+//	m_Cells.Get_Weighting().Create_Parameters(&Parameters, false);
 }
 
 
@@ -127,14 +125,11 @@ CFilter::CFilter(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CFilter::On_Before_Execution(void)
+int CCategorical_Variation::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
 {
-	if( Parameters("RESULT")->asGrid() == Parameters("INPUT")->asGrid() )
-	{
-		Parameters("RESULT")->Set_Value(DATAOBJECT_NOTSET);
-	}
+//	m_Cells.Get_Weighting().Enable_Parameters(pParameters);
 
-	return( true );
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
 }
 
 
@@ -143,100 +138,118 @@ bool CFilter::On_Before_Execution(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CFilter::On_Execute(void)
+bool CCategorical_Variation::On_Execute(void)
 {
 	//-----------------------------------------------------
-	m_pInput	= Parameters("INPUT")->asGrid();
+	m_pGrids		= Parameters("GRIDS"      )->asGridList();
 
-	CSG_Grid	Input, *pResult	= Parameters("RESULT")->asGrid();
+	m_pCategories	= Parameters("CATEGORIES" )->asGrid();
+	m_pCoincidence	= Parameters("COINCIDENCE")->asGrid();
+	m_pMaj_Count	= Parameters("MAJ_COUNT"  )->asGrid();
+	m_pMaj_Value	= Parameters("MAJ_VALUE"  )->asGrid();
 
-	if( !pResult || pResult == m_pInput )
-	{
-		Parameters("RESULT")->Set_Value(pResult = m_pInput);
-		Input.Create(*m_pInput);
-		m_pInput	= &Input;
-	}
-	else
+	DataObject_Set_Colors(m_pMaj_Count, 11, SG_COLORS_DEFAULT, true);
+
+	//-----------------------------------------------------
+	if( m_pGrids->Get_Count() < 1 )
 	{
-		pResult->Set_Name(CSG_String::Format("%s [%s]", m_pInput->Get_Name(), _TL("Filter")));
-		pResult->Set_NoData_Value(m_pInput->Get_NoData_Value());
+		Error_Set(_TL("no input"));
+
+		return( false );
 	}
 
 	//-----------------------------------------------------
-	int	Method	= Parameters("METHOD")->asInt();
-
-	m_Kernel.Set_Radius(Parameters("RADIUS")->asInt(), Parameters("MODE")->asInt() == 0);
+//	m_Cells.Get_Weighting().Set_Parameters(&Parameters);
+	m_Cells.Set_Radius(Parameters("RADIUS")->asInt());
 
+	//-----------------------------------------------------
 	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
 	{
 		#pragma omp parallel for
 		for(int x=0; x<Get_NX(); x++)
 		{
-			double	Mean;
-
-			if( Get_Mean(x, y, Mean) )
-			{
-				switch( Method )
-				{
-				default:	// Smooth...
-					pResult->Set_Value(x, y, Mean);
-					break;
-
-				case  1:	// Sharpen...
-					pResult->Set_Value(x, y, m_pInput->asDouble(x, y) + (m_pInput->asDouble(x, y) - Mean));
-					break;
-
-				case  2:	// Edge...
-					pResult->Set_Value(x, y, m_pInput->asDouble(x, y) - Mean);
-					break;
-				}
-			}
-			else
-			{
-				pResult->Set_NoData(x, y);
-			}
+			Get_Variation(x, y);
 		}
 	}
 
-	m_Kernel.Destroy();
-
 	//-----------------------------------------------------
+	m_Cells.Destroy();
+
 	return( true );
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CFilter::Get_Mean(int x, int y, double &Value)
+bool CCategorical_Variation::Get_Variation(int x, int y)
 {
-	CSG_Simple_Statistics	s;
+	CSG_Class_Statistics	s;
 
-	if( m_pInput->is_InGrid(x, y) )
+	//-----------------------------------------------------
+	if( m_Cells.Get_Count() > 1 )
 	{
-		for(int i=0; i<m_Kernel.Get_Count(); i++)
+		for(int iCell=0, ix, iy; iCell<m_Cells.Get_Count(); iCell++)
 		{
-			int	ix	= m_Kernel.Get_X(i, x);
-			int	iy	= m_Kernel.Get_Y(i, y);
-
-			if( m_pInput->is_InGrid(ix, iy) )
+			if( is_InGrid(ix = m_Cells.Get_X(iCell, x), iy = m_Cells.Get_Y(iCell, y)) )
 			{
-				s	+= m_pInput->asDouble(ix, iy);
+				for(int iBand=0; iBand<m_pGrids->Get_Count(); iBand++)
+				{
+					if( !m_pGrids->asGrid(iBand)->is_NoData(ix, iy) )
+					{
+						s.Add_Value(m_pGrids->asGrid(iBand)->asDouble(ix, iy));
+					}
+				}
+			}
+		}
+	}
+	else
+	{
+		for(int iBand=0; iBand<m_pGrids->Get_Count(); iBand++)
+		{
+			if( !m_pGrids->asGrid(iBand)->is_NoData(x, y) )
+			{
+				s.Add_Value(m_pGrids->asGrid(iBand)->asDouble(x, y));
 			}
 		}
 	}
 
+	//-----------------------------------------------------
 	if( s.Get_Count() > 0 )
 	{
-		Value	= s.Get_Mean();
+		#define GET_COINCIDENCE(x)	((x * (x - 1)) / 2)
+
+		int		nValues		= 0;
+		double	Coincidence	= 0.0;
+
+		for(int iClass=0; iClass<s.Get_Count(); iClass++)
+		{
+			int	nClass	= s.Get_Class_Count(iClass);
+
+			nValues		+= nClass;
+			Coincidence	+= GET_COINCIDENCE(nClass);
+		}
+
+		int		maj_Count;
+		double	maj_Value;
+
+		s.Get_Majority(maj_Value, maj_Count);
+
+		SG_GRID_PTR_SAFE_SET_VALUE(m_pCategories , x, y, s.Get_Count());
+		SG_GRID_PTR_SAFE_SET_VALUE(m_pCoincidence, x, y, Coincidence / GET_COINCIDENCE(nValues));
+		SG_GRID_PTR_SAFE_SET_VALUE(m_pMaj_Count  , x, y, maj_Count   / (double)nValues);
+		SG_GRID_PTR_SAFE_SET_VALUE(m_pMaj_Value  , x, y, maj_Value);
 
 		return( true );
 	}
 
+	SG_GRID_PTR_SAFE_SET_NODATA(m_pCategories , x, y);
+	SG_GRID_PTR_SAFE_SET_NODATA(m_pCoincidence, x, y);
+	SG_GRID_PTR_SAFE_SET_NODATA(m_pMaj_Count  , x, y);
+	SG_GRID_PTR_SAFE_SET_NODATA(m_pMaj_Value  , x, y);
+
 	return( false );
 }
 
diff --git a/src/modules/shapes/shapes_lines/line_dissolve.h b/src/modules/statistics/statistics_grid/categorical_variation.h
similarity index 83%
copy from src/modules/shapes/shapes_lines/line_dissolve.h
copy to src/modules/statistics/statistics_grid/categorical_variation.h
index ef0312e..1614cff 100755
--- a/src/modules/shapes/shapes_lines/line_dissolve.h
+++ b/src/modules/statistics/statistics_grid/categorical_variation.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_dissolve.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: categorical_variation.h 1922 2014-01-09 10:28:46Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,11 +9,11 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                     shapes_lines                      //
+//                    statistics_grid                    //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                    line_dissolve.h                    //
+//                categorical_variation.h                //
 //                                                       //
 //                 Copyright (C) 2011 by                 //
 //                      Olaf Conrad                      //
@@ -59,8 +59,8 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifndef HEADER_INCLUDED__line_dissolve_H
-#define HEADER_INCLUDED__line_dissolve_H
+#ifndef HEADER_INCLUDED__categorical_variation_H
+#define HEADER_INCLUDED__categorical_variation_H
 
 
 ///////////////////////////////////////////////////////////
@@ -80,22 +80,30 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CLine_Dissolve : public CSG_Module  
+class CCategorical_Variation : public CSG_Module_Grid
 {
 public:
-	CLine_Dissolve(void);
+	CCategorical_Variation(void);
 
 
 protected:
 
-	virtual bool			On_Execute				(void);
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
 
-	virtual int				On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+	virtual bool			On_Execute				(void);
 
 
 private:
 
-	bool					Add_Line				(CSG_Shape *pLine, CSG_Shape *pAdd);
+	CSG_Grid_Cell_Addressor	m_Cells;
+
+	CSG_Parameter_Grid_List	*m_pGrids;
+
+	CSG_Grid				*m_pCategories, *m_pCoincidence, *m_pMaj_Count, *m_pMaj_Value;
+
+
+	bool					Get_Variation			(int x, int y);
+	bool					Get_Variation			(int x, int y, int &nValues, int &nIdent, int &nIdent_Max);
 
 };
 
@@ -107,4 +115,4 @@ private:
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__line_dissolve_H
+#endif // #ifndef HEADER_INCLUDED__categorical_variation_H
diff --git a/src/modules/statistics/statistics_kriging/Makefile.in b/src/modules/statistics/statistics_kriging/Makefile.in
index 13a8088..8883bcf 100644
--- a/src/modules/statistics/statistics_kriging/Makefile.in
+++ b/src/modules/statistics/statistics_kriging/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/statistics/statistics_kriging
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -216,6 +226,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +260,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +285,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +375,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -407,7 +427,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/statistics_kriging/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/statistics/statistics_kriging/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -716,6 +735,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/statistics/statistics_points/Makefile.in b/src/modules/statistics/statistics_points/Makefile.in
index 93afbe6..467abf0 100644
--- a/src/modules/statistics/statistics_points/Makefile.in
+++ b/src/modules/statistics/statistics_points/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/statistics/statistics_points
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -215,6 +225,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -248,6 +259,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -266,6 +284,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -355,6 +374,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -404,7 +424,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/statistics_points/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/statistics/statistics_points/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -711,6 +730,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/statistics/statistics_regression/Makefile.in b/src/modules/statistics/statistics_regression/Makefile.in
index 0f79290..3958221 100644
--- a/src/modules/statistics/statistics_regression/Makefile.in
+++ b/src/modules/statistics/statistics_regression/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/statistics/statistics_regression
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -219,6 +229,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -252,6 +263,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -270,6 +288,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -359,6 +378,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -426,7 +446,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/statistics/statistics_regression/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/statistics/statistics_regression/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -742,6 +761,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/table/Makefile.in b/src/modules/table/Makefile.in
index c6ce68b..67040e9 100644
--- a/src/modules/table/Makefile.in
+++ b/src/modules/table/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/table
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/table/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/table/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/table/table_calculus/Fit.cpp b/src/modules/table/table_calculus/Fit.cpp
index 588fa6c..9e7d6e0 100755
--- a/src/modules/table/table_calculus/Fit.cpp
+++ b/src/modules/table/table_calculus/Fit.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Fit.cpp 2813 2016-02-22 21:30:40Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/Fit.h b/src/modules/table/table_calculus/Fit.h
index f492d8e..4b35142 100755
--- a/src/modules/table/table_calculus/Fit.h
+++ b/src/modules/table/table_calculus/Fit.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Fit.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/LMFit.cpp b/src/modules/table/table_calculus/LMFit.cpp
index bfc8469..f3657c0 100755
--- a/src/modules/table/table_calculus/LMFit.cpp
+++ b/src/modules/table/table_calculus/LMFit.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: LMFit.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/LMFit.h b/src/modules/table/table_calculus/LMFit.h
index 33217c7..ce619c0 100755
--- a/src/modules/table/table_calculus/LMFit.h
+++ b/src/modules/table/table_calculus/LMFit.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: LMFit.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/MLB_Interface.cpp b/src/modules/table/table_calculus/MLB_Interface.cpp
index 31716e2..6c63d7b 100755
--- a/src/modules/table/table_calculus/MLB_Interface.cpp
+++ b/src/modules/table/table_calculus/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2345 2014-11-27 11:27:59Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/MLB_Interface.h b/src/modules/table/table_calculus/MLB_Interface.h
index 74843db..147ce71 100755
--- a/src/modules/table/table_calculus/MLB_Interface.h
+++ b/src/modules/table/table_calculus/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/Makefile.am b/src/modules/table/table_calculus/Makefile.am
index 0a912d6..df45a05 100755
--- a/src/modules/table/table_calculus/Makefile.am
+++ b/src/modules/table/table_calculus/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/table/table_calculus/Makefile.in b/src/modules/table/table_calculus/Makefile.in
index 4109494..59f783e 100644
--- a/src/modules/table/table_calculus/Makefile.in
+++ b/src/modules/table/table_calculus/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/table/table_calculus
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -215,6 +225,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -248,6 +259,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -266,6 +284,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -355,6 +374,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -365,7 +385,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -414,7 +434,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/table/table_calculus/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/table/table_calculus/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -726,6 +745,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/table/table_calculus/Table_Calculator.cpp b/src/modules/table/table_calculus/Table_Calculator.cpp
index 9741577..c1bd1e1 100755
--- a/src/modules/table/table_calculus/Table_Calculator.cpp
+++ b/src/modules/table/table_calculus/Table_Calculator.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Calculator.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     TableCalculator.cpp
diff --git a/src/modules/table/table_calculus/Table_Calculator.h b/src/modules/table/table_calculus/Table_Calculator.h
index d2ddd5f..0f4db39 100755
--- a/src/modules/table/table_calculus/Table_Calculator.h
+++ b/src/modules/table/table_calculus/Table_Calculator.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Calculator.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     TableCalculator.h
diff --git a/src/modules/table/table_calculus/table_cluster_analysis.cpp b/src/modules/table/table_calculus/table_cluster_analysis.cpp
index 573914a..2b13da0 100755
--- a/src/modules/table/table_calculus/table_cluster_analysis.cpp
+++ b/src/modules/table/table_calculus/table_cluster_analysis.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_cluster_analysis.cpp 2343 2014-11-26 16:21:11Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/table_cluster_analysis.h b/src/modules/table/table_calculus/table_cluster_analysis.h
index d2d99bc..a53f831 100755
--- a/src/modules/table/table_calculus/table_cluster_analysis.h
+++ b/src/modules/table/table_calculus/table_cluster_analysis.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_cluster_analysis.h 2270 2014-10-02 15:39:13Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/table_field_statistics.cpp b/src/modules/table/table_calculus/table_field_statistics.cpp
index ac16ccc..0ef353c 100755
--- a/src/modules/table/table_calculus/table_field_statistics.cpp
+++ b/src/modules/table/table_calculus/table_field_statistics.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_field_statistics.cpp 2704 2015-11-26 14:46:25Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/table_field_statistics.h b/src/modules/table/table_calculus/table_field_statistics.h
index 5c8b0a6..dc3b4ec 100755
--- a/src/modules/table/table_calculus/table_field_statistics.h
+++ b/src/modules/table/table_calculus/table_field_statistics.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_field_statistics.h 2345 2014-11-27 11:27:59Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/table_pca.cpp b/src/modules/table/table_calculus/table_pca.cpp
index 98c4388..5794da9 100755
--- a/src/modules/table/table_calculus/table_pca.cpp
+++ b/src/modules/table/table_calculus/table_pca.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_pca.cpp 1928 2014-01-10 12:10:05Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/table_pca.h b/src/modules/table/table_calculus/table_pca.h
index 131492a..652a6a4 100755
--- a/src/modules/table/table_calculus/table_pca.h
+++ b/src/modules/table/table_calculus/table_pca.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_pca.h 1928 2014-01-10 12:10:05Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/table_running_average.cpp b/src/modules/table/table_calculus/table_running_average.cpp
index 70916ae..6efef2b 100755
--- a/src/modules/table/table_calculus/table_running_average.cpp
+++ b/src/modules/table/table_calculus/table_running_average.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_running_average.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_calculus/table_running_average.h b/src/modules/table/table_calculus/table_running_average.h
index 62ef909..3987d0b 100755
--- a/src/modules/table/table_calculus/table_running_average.h
+++ b/src/modules/table/table_calculus/table_running_average.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_running_average.h 1922 2014-01-09 10:28:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/MLB_Interface.cpp b/src/modules/table/table_tools/MLB_Interface.cpp
index ecb802d..2761ae5 100755
--- a/src/modules/table/table_tools/MLB_Interface.cpp
+++ b/src/modules/table/table_tools/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2481 2015-04-30 15:31:49Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/MLB_Interface.h b/src/modules/table/table_tools/MLB_Interface.h
index 34fe827..07b6e71 100755
--- a/src/modules/table/table_tools/MLB_Interface.h
+++ b/src/modules/table/table_tools/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/Makefile.am b/src/modules/table/table_tools/Makefile.am
index af3dd06..fd6fced 100755
--- a/src/modules/table/table_tools/Makefile.am
+++ b/src/modules/table/table_tools/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/table/table_tools/Makefile.in b/src/modules/table/table_tools/Makefile.in
index b0b9e99..39af74d 100644
--- a/src/modules/table/table_tools/Makefile.in
+++ b/src/modules/table/table_tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/table/table_tools
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -216,6 +226,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -249,6 +260,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -267,6 +285,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -356,6 +375,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -366,7 +386,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -417,7 +437,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/table/table_tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/table/table_tools/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -730,6 +749,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/table/table_tools/Table_Create_Empty.cpp b/src/modules/table/table_tools/Table_Create_Empty.cpp
index 4e4ff52..92c9b75 100755
--- a/src/modules/table/table_tools/Table_Create_Empty.cpp
+++ b/src/modules/table/table_tools/Table_Create_Empty.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Create_Empty.cpp 2355 2014-12-19 09:55:41Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/Table_Create_Empty.h b/src/modules/table/table_tools/Table_Create_Empty.h
index 5a1b06c..373a207 100755
--- a/src/modules/table/table_tools/Table_Create_Empty.h
+++ b/src/modules/table/table_tools/Table_Create_Empty.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Create_Empty.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/Table_Enumerate.cpp b/src/modules/table/table_tools/Table_Enumerate.cpp
index b0635a4..1f566f5 100755
--- a/src/modules/table/table_tools/Table_Enumerate.cpp
+++ b/src/modules/table/table_tools/Table_Enumerate.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Enumerate.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/Table_Enumerate.h b/src/modules/table/table_tools/Table_Enumerate.h
index 94301e4..9eaa4c6 100755
--- a/src/modules/table/table_tools/Table_Enumerate.h
+++ b/src/modules/table/table_tools/Table_Enumerate.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Enumerate.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/Table_Rotate.cpp b/src/modules/table/table_tools/Table_Rotate.cpp
index 0dcea4b..11491c9 100755
--- a/src/modules/table/table_tools/Table_Rotate.cpp
+++ b/src/modules/table/table_tools/Table_Rotate.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Rotate.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/Table_Rotate.h b/src/modules/table/table_tools/Table_Rotate.h
index 338e9ed..9754e75 100755
--- a/src/modules/table/table_tools/Table_Rotate.h
+++ b/src/modules/table/table_tools/Table_Rotate.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Table_Rotate.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/table_change_color_format.cpp b/src/modules/table/table_tools/table_change_color_format.cpp
index 198116c..007322f 100755
--- a/src/modules/table/table_tools/table_change_color_format.cpp
+++ b/src/modules/table/table_tools/table_change_color_format.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_change_color_format.cpp 2322 2014-11-03 21:29:57Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/table_change_color_format.h b/src/modules/table/table_tools/table_change_color_format.h
index 88a5fd9..9af04f5 100755
--- a/src/modules/table/table_tools/table_change_color_format.h
+++ b/src/modules/table/table_tools/table_change_color_format.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_change_color_format.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/table/table_tools/table_change_date_format.cpp b/src/modules/table/table_tools/table_change_date_format.cpp
index 208f766..2966d87 100755
--- a/src/modules/table/table_tools/table_change_date_format.cpp
+++ b/src/modules/table/table_tools/table_change_date_format.cpp
@@ -78,7 +78,7 @@ CTable_Change_Date_Format::CTable_Change_Date_Format(void)
 
 	Set_Name		(_TL("Change Date Format"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2011"));
+	Set_Author		("O.Conrad (c) 2011");
 
 	Set_Description	(_TW(
 		""
@@ -105,36 +105,45 @@ CTable_Change_Date_Format::CTable_Change_Date_Format(void)
 		PARAMETER_OUTPUT_OPTIONAL
 	);
 
-	Parameters.Add_Choice(
+	pNode	= Parameters.Add_Choice(
 		NULL	, "FMT_IN"			, _TL("Input Format"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("dd.mm.yy"),
-			_TL("yy.mm.dd"),
-			_TL("dd:mm:yy"),
-			_TL("yy:mm:dd"),
+		CSG_String::Format("%s|%s|%s|%s|%s|%s|%s|",
+			_TL("dd:mm:yyyy"),
+			_TL("yyyy:mm:dd"),
 			_TL("ddmmyyyy, fix size"),
 			_TL("yyyymmdd, fix size"),
 			_TL("ddmmyy, fix size"),
 			_TL("yymmdd, fix size"),
 			_TL("Julian Day")
-		), 0
+		)
 	);
 
-	Parameters.Add_Choice(
+	Parameters.Add_String(
+		pNode	, "SEP_IN"			, _TL("Separator"),
+		_TL(""),
+		":"
+	);
+
+	pNode	= Parameters.Add_Choice(
 		NULL	, "FMT_OUT"			, _TL("Output Format"),
 		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"),
-			_TL("dd.mm.yy"),
-			_TL("yy.mm.dd"),
-			_TL("dd:mm:yy"),
-			_TL("yy:mm:dd"),
+		CSG_String::Format("%s|%s|%s|%s|%s|%s|%s|%s",
+			_TL("dd:mm:yyyy"),
+			_TL("yyyy:mm:dd"),
 			_TL("ddmmyyyy, fix size"),
 			_TL("yyyymmdd, fix size"),
 			_TL("ddmmyy, fix size"),
 			_TL("yymmdd, fix size"),
-			_TL("Julian Day")
-		), 7
+			_TL("Julian Day"),
+			_TL("Date")
+		)
+	);
+
+	Parameters.Add_String(
+		pNode	, "SEP_OUT"			, _TL("Separator"),
+		_TL(""),
+		":"
 	);
 }
 
@@ -144,19 +153,46 @@ CTable_Change_Date_Format::CTable_Change_Date_Format(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CTable_Change_Date_Format::On_Execute(void)
+int CTable_Change_Date_Format::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
 {
-	//-----------------------------------------------------
-	int		fmt_In	= Parameters("FMT_IN" )->asInt();
-	int		fmt_Out	= Parameters("FMT_OUT")->asInt();
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "FMT_IN" ) )
+	{
+		pParameters->Set_Enabled("SEP_IN" , pParameter->asInt() == 0 || pParameter->asInt() == 1);
+	}
 
-	if( fmt_In == fmt_Out )
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "FMT_OUT") )
 	{
-		Error_Set(_TL("nothing to do: input format is same as output format"));
+		pParameters->Set_Enabled("SEP_OUT", pParameter->asInt() == 0 || pParameter->asInt() == 1);
+	}
 
-		return( false );
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "TABLE")
+	||  !SG_STR_CMP(pParameter->Get_Identifier(), "FIELD") )
+	{
+		CSG_Table	*pTable	= pParameters->Get_Parameter("TABLE")->asTable();
+
+		if( pTable )
+		{
+			int	Field	= pParameters->Get_Parameter("FIELD")->asInt();
+
+			pParameters->Set_Enabled("FMT_IN", pTable->Get_Field_Type(Field) != SG_DATATYPE_Date);
+		}
+		else
+		{
+			pParameters->Set_Enabled("FMT_IN", false);
+		}
 	}
 
+	return( CSG_Module::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTable_Change_Date_Format::On_Execute(void)
+{
 	//-----------------------------------------------------
 	CSG_Table	*pTable	= Parameters("OUTPUT")->asTable();
 
@@ -170,121 +206,117 @@ bool CTable_Change_Date_Format::On_Execute(void)
 		pTable	= Parameters("TABLE")->asTable();
 	}
 
+	int	Field	= Parameters("FIELD")->asInt();
+
 	//-----------------------------------------------------
-	int		fDate	= Parameters("FIELD" )->asInt();
+	SG_Char	sep_In	= *Parameters("SEP_IN" )->asString(); if( !sep_In  ) sep_In  = SG_T(':');
+	SG_Char	sep_Out	= *Parameters("SEP_OUT")->asString(); if( !sep_Out ) sep_Out = SG_T(':');
 
-	switch( fmt_Out )
+	//-----------------------------------------------------
+	int	fmt_In	= Parameters("FMT_IN" )->asInt();
+	int	fmt_Out	= Parameters("FMT_OUT")->asInt();
+
+	if( pTable->Get_Field_Type(Field) == SG_DATATYPE_Date )
 	{
-	case 0:	case 1: case 2: case 3:
-		pTable->Set_Field_Type(fDate, SG_DATATYPE_String);
-		break;
+		fmt_In	= 0;
+		sep_In	= SG_T('.');
+	}
 
-	default:
-		pTable->Set_Field_Type(fDate, SG_DATATYPE_Int);
-		break;
+	if( fmt_Out == 7 )
+	{
+		fmt_Out	= 0;
+		sep_Out	= SG_T('.');
 	}
 
-	//-----------------------------------------------------
-	SG_Char	sep_In	= fmt_In  == 0 || fmt_In  == 1 ? SG_T('.') : SG_T(':');
+	pTable->Set_Field_Type(Field, SG_DATATYPE_String);
 
 	//-----------------------------------------------------
 	for(int iRecord=0; iRecord<pTable->Get_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++)
 	{
 		CSG_Table_Record	*pRecord	= pTable->Get_Record(iRecord);
 
-		CSG_String	sDate	= pRecord->asString(fDate);
+		CSG_String	s(pRecord->asString(Field));
 
 		int	y, m, d;
 
 		switch( fmt_In )
 		{
-		case 0:	// dd.mm.yy
-		case 2:	// dd:mm:yy
-			d	= sDate.BeforeFirst(sep_In).asInt();
-			m	= sDate.AfterFirst (sep_In).asInt();
-			y	= sDate.AfterLast  (sep_In).asInt();
+		case 0:	// dd:mm:yyyy
+			d	= s.BeforeFirst(sep_In).asInt();
+			m	= s.AfterFirst (sep_In).asInt();
+			y	= s.AfterLast  (sep_In).asInt();
 			break;
 
-		case 1:	// yy.mm.dd
-		case 3:	// yy:mm:dd
-			y	= sDate.BeforeFirst(sep_In).asInt();
-			m	= sDate.AfterFirst (sep_In).asInt();
-			d	= sDate.AfterLast  (sep_In).asInt();
+		case 1:	// yyyy:mm:dd
+			d	= s.AfterLast  (sep_In).asInt();
+			m	= s.AfterFirst (sep_In).asInt();
+			y	= s.BeforeFirst(sep_In).asInt();
 			break;
 
-		case 4:	// ddmmyyyy
-			d	= sDate.Left (2)   .asInt();
-			m	= sDate.Mid  (2, 2).asInt();
-			y	= sDate.Right(4)   .asInt();
+		case 2:	// ddmmyyyy
+			d	= s.Left (2)   .asInt();
+			m	= s.Mid  (2, 2).asInt();
+			y	= s.Right(4)   .asInt();
 			break;
 
-		case 5:	// yyyymmdd
-			y	= sDate.Left (4)   .asInt();
-			m	= sDate.Mid  (4, 2).asInt();
-			d	= sDate.Right(2)   .asInt();
+		case 3:	// yyyymmdd
+			d	= s.Right(2)   .asInt();
+			m	= s.Mid  (4, 2).asInt();
+			y	= s.Left (4)   .asInt();
 			break;
 
-		case 6:	// ddmmyy
-			d	= sDate.Left (2)   .asInt();
-			m	= sDate.Mid  (2, 2).asInt();
-			y	= sDate.Right(2)   .asInt();
+		case 4:	// ddmmyy
+			d	= s.Left (2)   .asInt();
+			m	= s.Mid  (2, 2).asInt();
+			y	= s.Right(2)   .asInt();
 			break;
 
-		case 7:	// yymmdd
-			y	= sDate.Left (2)   .asInt();
-			m	= sDate.Mid  (2, 2).asInt();
-			d	= sDate.Right(2)   .asInt();
+		case 5:	// yymmdd
+			d	= s.Right(2)   .asInt();
+			m	= s.Mid  (2, 2).asInt();
+			y	= s.Left (2)   .asInt();
 			break;
 
-		case 8:	// Julian Day
+		case 6:	// Julian Day
 			{
-				d	= sDate.asInt();
-   
-				if( d >= 2299161 )	// Gregorian, else Julian
-				{
-					y	= (int)((d - 1867216.25) / 36524.25);
-					d	= d + 1 + y - (int)(y / 4.0);
-				}
-
-				int	B	= d + 1524;
-
-				y	= (int)((B - 122.1) / 365.25);
-				d	= (int)(365.25 * y);
-				m	= (int)((B - d) / 30.6001);
+				CSG_DateTime	Date(s.asDouble());
 
-				d	= B - d - (int)(30.6001 * m);	// day, without day fraction df
-				m	= m < 14 ? m -    1 : m -   13;	// month
-				y	= m >  2 ? y - 4716 : y - 4715;	// year
+				d	= Date.Get_Day  ();
+				m	= Date.Get_Month();
+				y	= Date.Get_Year ();
 			}
 			break;
 		}
 
+		//-------------------------------------------------
 		switch( fmt_Out )
 		{
-		case 0:	sDate.Printf(SG_T("%02d.%02d.%02d"), d, m, y);	break;	// dd:mm:yy
-		case 1:	sDate.Printf(SG_T("%02d.%02d.%02d"), y, m, d);	break;	// yy:mm:dd
-		case 2:	sDate.Printf(SG_T("%02d:%02d:%02d"), d, m, y);	break;	// dd:mm:yy
-		case 3:	sDate.Printf(SG_T("%02d:%02d:%02d"), y, m, d);	break;	// yy:mm:dd
-		case 4:	sDate.Printf(SG_T("%02d%02d%04d")  , d, m, y);	break;	// ddmmyyyy
-		case 5:	sDate.Printf(SG_T("%04d%02d%02d")  , y, m, d);	break;	// yyyymmdd
-		case 6:	sDate.Printf(SG_T("%02d%02d%02d")  , d, m, y - 100 * (int)(y / 100.0));	break;	// ddmmyy
-		case 7:	sDate.Printf(SG_T("%02d%02d%02d")  , y - 100 * (int)(y / 100.0), m, d);	break;	// yymmdd
-
-		case 8:	// Julian Day
+		case 0:	s.Printf("%02d%c%02d%c%02d", d, sep_Out, m, sep_Out, y       );	break;	// dd:mm:yyyy
+		case 1:	s.Printf("%02d%c%02d%c%02d", y, sep_Out, m, sep_Out, d       );	break;	// yyyy:mm:dd
+		case 2:	s.Printf("%02d%02d%04d"    , d, m, y                         );	break;	// ddmmyyyy
+		case 3:	s.Printf("%04d%02d%02d"    , y, m, d                         );	break;	// yyyymmdd
+		case 4:	s.Printf("%02d%02d%02d"    , d, m, y - 100 * (int)(y / 100.0));	break;	// ddmmyy
+		case 5:	s.Printf("%02d%02d%02d"    , y - 100 * (int)(y / 100.0), m, d);	break;	// yymmdd
+
+		case 6:	// Julian Day
 			{
-				double	Y	= y + (m - 2.85) / 12.0;
+				CSG_DateTime	Date(d, (CSG_DateTime::Month)(m - 1), y);
 
-				d	= (int)((int)((int)(367.0 * Y) - 1.75 * (int)(Y) + d) - 0.75 * (int)(Y / 100.0)) + 1721115;
-		
-				sDate.Printf(SG_T("%d"), d);
+				s.Printf("%d", (int)Date.Get_JDN());
 			}
 			break;
 		}
 
-		pRecord->Set_Value(fDate, sDate);
+		pRecord->Set_Value(Field, s);
 	}
 
 	//-----------------------------------------------------
+	switch( Parameters("FMT_OUT")->asInt() )
+	{
+	case 6:	pTable->Set_Field_Type(Field, SG_DATATYPE_Int );	break;	// Julian Day
+	case 7:	pTable->Set_Field_Type(Field, SG_DATATYPE_Date);	break;	// Date
+	}
+
 	if( pTable == Parameters("TABLE")->asTable() )
 	{
 		DataObject_Update(pTable);
diff --git a/src/modules/table/table_tools/table_change_date_format.h b/src/modules/table/table_tools/table_change_date_format.h
index ad3cdd8..9786420 100755
--- a/src/modules/table/table_tools/table_change_date_format.h
+++ b/src/modules/table/table_tools/table_change_date_format.h
@@ -90,8 +90,9 @@ public:
 
 protected:
 
-	virtual bool				On_Execute		(void);
-
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
 
 };
 
@@ -113,7 +114,6 @@ protected:
 
 	virtual bool				On_Execute		(void);
 
-
 };
 
 
diff --git a/src/modules/terrain_analysis/Makefile.in b/src/modules/terrain_analysis/Makefile.in
index 8ebce31..ac804d1 100644
--- a/src/modules/terrain_analysis/Makefile.in
+++ b/src/modules/terrain_analysis/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -338,7 +359,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -633,6 +653,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork.cpp b/src/modules/terrain_analysis/ta_channels/ChannelNetwork.cpp
index f5cc4b7..62d5630 100755
--- a/src/modules/terrain_analysis/ta_channels/ChannelNetwork.cpp
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ChannelNetwork.cpp 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork.h b/src/modules/terrain_analysis/ta_channels/ChannelNetwork.h
index 7404182..9262798 100755
--- a/src/modules/terrain_analysis/ta_channels/ChannelNetwork.h
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ChannelNetwork.h 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp
index 546c93f..0338cf3 100755
--- a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ChannelNetwork_Altitude.cpp 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -76,7 +76,7 @@ CChannelNetwork_Altitude::CChannelNetwork_Altitude(void)
 	//-----------------------------------------------------
 	Set_Name		(_TL("Vertical Distance to Channel Network"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2002"));
+	Set_Author		("O.Conrad (c) 2002");
 
 	Set_Description	(_TW(
 		"This module calculates the vertical distance to a channel network base level. "
@@ -85,53 +85,43 @@ CChannelNetwork_Altitude::CChannelNetwork_Altitude(void)
 		" 2. Subtraction of this base level from the original elevations\n"
 	));
 
-
 	//-----------------------------------------------------
-	// Input...
-
 	Parameters.Add_Grid(
-		NULL, "ELEVATION"	, _TL("Elevation"),
+		NULL	, "ELEVATION"	, _TL("Elevation"),
 		_TL("A grid that contains elevation data."),
 		PARAMETER_INPUT
 	);
 
 	Parameters.Add_Grid(
-		NULL, "CHANNELS"	, _TL("Channel Network"),
-		_TW("A grid providing information about the channel network. It is assumed that no-data cells are not part "
-		"of the channel network. Vice versa all others cells are recognised as channel network members."),
+		NULL	, "CHANNELS"	, _TL("Channel Network"),
+		_TL("A grid providing information about the channel network. It is assumed that no-data cells are not part of the channel network. Vice versa all others cells are recognised as channel network members."),
 		PARAMETER_INPUT
 	);
 
-
 	//-----------------------------------------------------
-	// Output...
-
 	Parameters.Add_Grid(
-		NULL, "DISTANCE"	, _TL("Vertical Distance to Channel Network"),
+		NULL	, "DISTANCE"	, _TL("Vertical Distance to Channel Network"),
 		_TL("The resulting grid gives the altitude above the channel network in the same units as the elevation data."),
 		PARAMETER_OUTPUT
 	);
 
 	Parameters.Add_Grid(
-		NULL, "BASELEVEL"	, _TL("Channel Network Base Level"),
+		NULL	, "BASELEVEL"	, _TL("Channel Network Base Level"),
 		_TL("This optional grid output contains the interpolated channel network base level elevations."),
 		PARAMETER_OUTPUT_OPTIONAL
 	);
 
-
 	//-----------------------------------------------------
-	// Options...
-
-	Parameters.Add_Value(
-		NULL, "THRESHOLD"	, _TL("Tension Threshold [Percentage of Cell Size]"),
+	Parameters.Add_Double(
+		NULL	, "THRESHOLD"	, _TL("Tension Threshold [Percentage of Cell Size]"),
 		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
+		1.0, 0.0, true
 	);
 
-	Parameters.Add_Value(
-		NULL, "NOUNDERGROUND", _TL("Keep Base Level below Surface"),
+	Parameters.Add_Bool(
+		NULL	, "NOUNDERGROUND", _TL("Keep Base Level below Surface"),
 		_TL(""),
-		PARAMETER_TYPE_Bool, true
+		true
 	);
 }
 
@@ -147,13 +137,13 @@ bool CChannelNetwork_Altitude::On_Execute(void)
 	double		Threshold;
 
 	//-----------------------------------------------------
-	m_pDTM				= Parameters("ELEVATION")		->asGrid();
-	m_pChannels			= Parameters("CHANNELS")		->asGrid();
-	m_pDistance			= Parameters("DISTANCE")		->asGrid();
-	m_bNoUnderground	= Parameters("NOUNDERGROUND")	->asBool();
-	Threshold			= Parameters("THRESHOLD")		->asDouble() * Get_Cellsize();
+	m_pDTM				= Parameters("ELEVATION"    )->asGrid();
+	m_pChannels			= Parameters("CHANNELS"     )->asGrid();
+	m_pDistance			= Parameters("DISTANCE"     )->asGrid();
+	m_bNoUnderground	= Parameters("NOUNDERGROUND")->asBool();
+	Threshold			= Parameters("THRESHOLD"    )->asDouble() * Get_Cellsize();
 
-	DataObject_Set_Colors(m_pDistance, 10, SG_COLORS_YELLOW_BLUE, true);
+	DataObject_Set_Colors(m_pDistance, 11, SG_COLORS_YELLOW_BLUE, true);
 
 	//-----------------------------------------------------
 	nCells			= Get_NX() > Get_NY() ? Get_NX() : Get_NY();
@@ -363,13 +353,15 @@ CValley_Depth::CValley_Depth(void)
 	//-----------------------------------------------------
 	Set_Name		(_TL("Valley Depth"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
+	Set_Author		("O.Conrad (c) 2012");
 
 	Set_Description	(_TW(
-		"Valley depth is calculated here  vertical distance to a channel network base level. "
-		"The algorithm consists of two major steps:\n"
-		" 1. Interpolation of a channel network base level elevation\n"
-		" 2. Subtraction of this base level from the original elevations\n"
+		"Valley depth is calculated as difference between the elevation and an interpolated ridge level. "
+		"Ridge level interpolation uses the algorithm implemented in the 'Vertical Distance to Channel Network' tool. "
+		"It performs the following steps:\n"
+		" - Definition of ridge cells (using Strahler order on the inverted DEM).\n"
+		" - Interpolation of the ridge level.\n"
+		" - Subtraction of the original elevations from the ridge level.\n"
 	));
 
 	//-----------------------------------------------------
@@ -391,22 +383,22 @@ CValley_Depth::CValley_Depth(void)
 		PARAMETER_OUTPUT_OPTIONAL
 	);
 
-	Parameters.Add_Value(
+	Parameters.Add_Double(
 		NULL	, "THRESHOLD"		, _TL("Tension Threshold [Percentage of Cell Size]"),
 		_TL(""),
-		PARAMETER_TYPE_Double, 1.0, 0.0, true
+		1.0, 0.0, true
 	);
 
-	Parameters.Add_Value(
+	Parameters.Add_Bool(
 		NULL	, "NOUNDERGROUND"	, _TL("Keep Ridge Level above Surface"),
 		_TL(""),
-		PARAMETER_TYPE_Bool, true
+		true
 	);
 
-	Parameters.Add_Value(
+	Parameters.Add_Int(
 		NULL	, "ORDER"			, _TL("Ridge Detection Threshold"),
 		_TL(""),
-		PARAMETER_TYPE_Int, 4, 1, true, 7, true
+		4, 1, true, 7, true
 	);
 }
 
@@ -427,15 +419,13 @@ CValley_Depth::CValley_Depth(void)
 //---------------------------------------------------------
 bool CValley_Depth::On_Execute(void)
 {
-	CSG_Grid	Inverse(*Get_System(), SG_DATATYPE_Float);
-	CSG_Grid	Ridges (*Get_System(), SG_DATATYPE_Int);
+	CSG_Grid	*pDepth	= Parameters("VALLEY_DEPTH")->asGrid();
 
 	//-----------------------------------------------------
-	RUN_MODULE("grid_tools"					, 19,	// grid orientation
-			SET_PARAMETER("INPUT"			, Parameters("ELEVATION"))
-		&&	SET_PARAMETER("RESULT"			, &Inverse)
-		&&	SET_PARAMETER("METHOD"			, 3)	// invert
-	)
+	CSG_Grid	Inverse(*Parameters("ELEVATION")->asGrid());
+	CSG_Grid	Ridges (*Get_System(), SG_DATATYPE_Int);
+
+	Inverse.Invert();
 
 	RUN_MODULE("ta_channels"				, 6,	// strahler order
 			SET_PARAMETER("DEM"				, &Inverse)
@@ -447,19 +437,24 @@ bool CValley_Depth::On_Execute(void)
 	RUN_MODULE("ta_channels"				, 3,	// vertical channel network distance
 			SET_PARAMETER("ELEVATION"		, &Inverse)
 		&&	SET_PARAMETER("CHANNELS"		, &Ridges)
-		&&	SET_PARAMETER("DISTANCE"		, Parameters("VALLEY_DEPTH"))
-		&&	SET_PARAMETER("BASELEVEL"		, Parameters("RIDGE_LEVEL"))
+		&&	SET_PARAMETER("DISTANCE"		, pDepth)
 		&&	SET_PARAMETER("THRESHOLD"		, Parameters("THRESHOLD"))
 		&&	SET_PARAMETER("NOUNDERGROUND"	, Parameters("NOUNDERGROUND"))
 	)
 
 	//-----------------------------------------------------
-	if( Parameters("RIDGE_LEVEL")->asGrid() )
+	CSG_Grid	*pRidge	= Parameters("RIDGE_LEVEL")->asGrid();
+
+	if( pRidge )
 	{
-		Parameters("RIDGE_LEVEL")->asGrid()->Invert();
+		pRidge->Assign(Parameters("ELEVATION")->asGrid());
+		pRidge->Add(*pDepth);
 	}
 
-	DataObject_Set_Colors(Parameters("VALLEY_DEPTH")->asGrid(), 10, SG_COLORS_YELLOW_BLUE, false);
+	pDepth->Set_Name(_TL("Valley Depth"));
+
+	DataObject_Set_Colors(pDepth, 11, SG_COLORS_RAINBOW, false);
+	DataObject_Set_Colors(pDepth, 11, SG_COLORS_RAINBOW, false);
 
 	return( true );
 }
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h
index 66e4579..e3a8c33 100755
--- a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ChannelNetwork_Altitude.h 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp
index 968a711..1ca4f2d 100755
--- a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ChannelNetwork_Distance.cpp 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.h b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.h
index 50432d2..77ad907 100755
--- a/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.h
+++ b/src/modules/terrain_analysis/ta_channels/ChannelNetwork_Distance.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ChannelNetwork_Distance.h 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp b/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp
index eec680d..cc4e407 100755
--- a/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp
+++ b/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: D8_Flow_Analysis.cpp 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.h b/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.h
index 90b0191..2ebd84c 100755
--- a/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.h
+++ b/src/modules/terrain_analysis/ta_channels/D8_Flow_Analysis.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: D8_Flow_Analysis.h 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_channels/MLB_Interface.cpp
index 4687b3f..30296b0 100755
--- a/src/modules/terrain_analysis/ta_channels/MLB_Interface.cpp
+++ b/src/modules/terrain_analysis/ta_channels/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/MLB_Interface.h b/src/modules/terrain_analysis/ta_channels/MLB_Interface.h
index c8d8511..6b6e43f 100755
--- a/src/modules/terrain_analysis/ta_channels/MLB_Interface.h
+++ b/src/modules/terrain_analysis/ta_channels/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/Makefile.in b/src/modules/terrain_analysis/ta_channels/Makefile.in
index a073f1d..eac007a 100644
--- a/src/modules/terrain_analysis/ta_channels/Makefile.in
+++ b/src/modules/terrain_analysis/ta_channels/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis/ta_channels
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -407,7 +427,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_channels/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_channels/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -716,6 +735,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_channels/Strahler.cpp b/src/modules/terrain_analysis/ta_channels/Strahler.cpp
index 28c2d64..fe33613 100755
--- a/src/modules/terrain_analysis/ta_channels/Strahler.cpp
+++ b/src/modules/terrain_analysis/ta_channels/Strahler.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Strahler.cpp 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Strahler.cpp
diff --git a/src/modules/terrain_analysis/ta_channels/Strahler.h b/src/modules/terrain_analysis/ta_channels/Strahler.h
index 4f2c6c1..13c47c9 100755
--- a/src/modules/terrain_analysis/ta_channels/Strahler.h
+++ b/src/modules/terrain_analysis/ta_channels/Strahler.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Strahler.h 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Strahler.h
diff --git a/src/modules/terrain_analysis/ta_channels/Watersheds.cpp b/src/modules/terrain_analysis/ta_channels/Watersheds.cpp
index f74d5c3..f2ef6b5 100755
--- a/src/modules/terrain_analysis/ta_channels/Watersheds.cpp
+++ b/src/modules/terrain_analysis/ta_channels/Watersheds.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Watersheds.cpp 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/Watersheds.h b/src/modules/terrain_analysis/ta_channels/Watersheds.h
index be2774b..eb48cf0 100755
--- a/src/modules/terrain_analysis/ta_channels/Watersheds.h
+++ b/src/modules/terrain_analysis/ta_channels/Watersheds.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Watersheds.h 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_channels/Watersheds_ext.cpp b/src/modules/terrain_analysis/ta_channels/Watersheds_ext.cpp
index 49b72ef..0c475e6 100755
--- a/src/modules/terrain_analysis/ta_channels/Watersheds_ext.cpp
+++ b/src/modules/terrain_analysis/ta_channels/Watersheds_ext.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Watersheds_ext.cpp 2806 2016-02-21 18:23:12Z johanvdw $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Watersheds.cpp
diff --git a/src/modules/terrain_analysis/ta_channels/Watersheds_ext.h b/src/modules/terrain_analysis/ta_channels/Watersheds_ext.h
index 0ed3934..564fa4f 100755
--- a/src/modules/terrain_analysis/ta_channels/Watersheds_ext.h
+++ b/src/modules/terrain_analysis/ta_channels/Watersheds_ext.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Watersheds_ext.h 2342 2014-11-26 13:41:35Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     Watersheds.h
diff --git a/src/modules/terrain_analysis/ta_compound/Makefile.in b/src/modules/terrain_analysis/ta_compound/Makefile.in
index d051ae6..d815a52 100644
--- a/src/modules/terrain_analysis/ta_compound/Makefile.in
+++ b/src/modules/terrain_analysis/ta_compound/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis/ta_compound
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -211,6 +221,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -244,6 +255,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -262,6 +280,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -351,6 +370,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -392,7 +412,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_compound/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_compound/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -695,6 +714,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.cpp
index 816b7c5..c679c7e 100755
--- a/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.cpp
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.cpp
@@ -74,9 +74,9 @@
 CFlow_Distance::CFlow_Distance(void)
 {
 	//-----------------------------------------------------
-	Set_Name(_TL("Flow Path Length"));
+	Set_Name		(_TL("Flow Path Length"));
 
-	Set_Author		(SG_T("(c) 2005 by O.Conrad"));
+	Set_Author		("O.Conrad (c) 2005");
 
 	Set_Description	(_TW(
 		"This module calculates the average flow path length starting from the seeds, "
diff --git a/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.h b/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.h
index c61b012..8f4f9c0 100755
--- a/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.h
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_Distance.h
@@ -88,7 +88,7 @@ public:
 	CFlow_Distance(void);
 	virtual ~CFlow_Distance(void);
 
-	virtual CSG_String		Get_MenuPath	(void)	{	return( SG_T("Flow Accumulation") );	}
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Flow Accumulation") );	}
 
 
 protected:
diff --git a/src/modules/grid/grid_tools/Grid_Proximity.cpp b/src/modules/terrain_analysis/ta_hydrology/Flow_Length.cpp
similarity index 60%
copy from src/modules/grid/grid_tools/Grid_Proximity.cpp
copy to src/modules/terrain_analysis/ta_hydrology/Flow_Length.cpp
index 164cf57..2cac238 100755
--- a/src/modules/grid/grid_tools/Grid_Proximity.cpp
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_Length.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Proximity.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Flow_Length.cpp 1921 2014-01-09 10:24:11Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,13 +9,13 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                     Grid_Tools                        //
+//                     ta_hydrology                      //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                   Grid_Proximity.cpp                  //
+//                    Flow_Length.cpp                    //
 //                                                       //
-//                 Copyright (C) 2010 by                 //
+//                 Copyright (C) 2016 by                 //
 //                      Olaf Conrad                      //
 //                                                       //
 //-------------------------------------------------------//
@@ -59,7 +59,7 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include "Grid_Proximity.h"
+#include "Flow_Length.h"
 
 
 ///////////////////////////////////////////////////////////
@@ -69,152 +69,139 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CGrid_Proximity::CGrid_Proximity(void)
+CFlow_Length::CFlow_Length(void)
 {
 	//-----------------------------------------------------
-	// 1. Info...
+	Set_Name		(_TL("Maximum Flow Path Length"));
 
-	Set_Name		(_TL("Proximity Grid"));
-
-	Set_Author		(SG_T("O.Conrad (c) 2010"));
+	Set_Author		("O.Conrad (c) 2016");
 
 	Set_Description	(_TW(
-		"Calculates a grid with euclidean distance to feature cells (not no-data cells)."
+		"This tool calculates the maximum upstream or downstream distance "
+		"or weighted distance along the flow path for each cell "
+		"based on \'Deterministic 8 (D8)\' (O'Callaghan and Mark 1984) flow directions.\n"
+		"\n"
+		"Reference:\n"
+		"O'Callaghan, J.F., Mark, D.M. (1984): "
+		"'The extraction of drainage networks from digital elevation data'. "
+		" Computer Vision, Graphics and Image Processing, 28:323-344\n"
 	));
 
-
 	//-----------------------------------------------------
-	// 2. Standard in- and output...
-
 	Parameters.Add_Grid(
-		NULL	, "FEATURES"		, _TL("Features"),
+		NULL	, "ELEVATION"	, _TL("Elevation"),
 		_TL(""),
 		PARAMETER_INPUT
 	);
 
 	Parameters.Add_Grid(
-		NULL	, "DISTANCE"		, _TL("Distance"),
+		NULL	, "WEIGHTS"		, _TL("Weights"),
 		_TL(""),
-		PARAMETER_OUTPUT
+		PARAMETER_INPUT_OPTIONAL
 	);
 
 	Parameters.Add_Grid(
-		NULL	, "DIRECTION"		, _TL("Direction"),
+		NULL	, "DISTANCE"	, _TL("Flow Path Length"),
 		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
+		PARAMETER_OUTPUT
 	);
 
-	Parameters.Add_Grid(
-		NULL	, "ALLOCATION"		, _TL("Allocation"),
+	Parameters.Add_Choice(
+		NULL	, "DIRECTION"	, _TL("Direction of Measurement"),
 		_TL(""),
-		PARAMETER_OUTPUT_OPTIONAL
+		CSG_String::Format("%s|%s|",
+			_TL("downstream"),
+			_TL("upstream")
+		), 0
 	);
 }
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CGrid_Proximity::On_Execute(void)
+bool CFlow_Length::On_Execute(void)
 {
-	int				x, y;
-	double			z, d;
-	TSG_Point		p;
-	CSG_Grid		*pFeatures, *pDistance, *pDirection, *pAllocation;
-	CSG_PRQuadTree	Search;
-
 	//-----------------------------------------------------
-	pFeatures	= Parameters("FEATURES")	->asGrid();
-	pDistance	= Parameters("DISTANCE")	->asGrid();
-	pDirection	= Parameters("DIRECTION")	->asGrid();
-	pAllocation	= Parameters("ALLOCATION")	->asGrid();
+	CSG_Grid	*pDEM		= Parameters("ELEVATION")->asGrid();
+	CSG_Grid	*pWeights	= Parameters("WEIGHTS"  )->asGrid();
+
+	if( !pDEM->Set_Index() )
+	{
+		Error_Set(_TL("index creation failed"));
+
+		return( false );
+	}
 
 	//-----------------------------------------------------
-	Process_Set_Text(_TL("preparing distance calculation..."));
+	CSG_Grid	*pDistance	= Parameters("DISTANCE")->asGrid();
 
-	Search.Create(CSG_Rect(-1, -1, Get_NX(), Get_NY()));
+	pDistance->Set_NoData_Value(-1.0);
+	pDistance->Assign_NoData();
 
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
-		{
-			if( pFeatures->is_NoData(x, y) )
-			{
-				pDistance->Set_Value(x, y, -1.0);
-			}
-			else
-			{
-				pDistance->Set_Value(x, y,  0.0);
+	int		x, y, i;
 
-				if( pDirection )
-				{
-					pDirection->Set_NoData(x, y);
-				}
+	//-----------------------------------------------------
+	if( Parameters("DIRECTION")->asInt() == 0 )	// downstream
+	{
+		pDistance->Set_Name(CSG_String::Format("%s [%s]", _TL("Flow Path Length"), _TL("downstream")));
 
-				if( pAllocation )
-				{
-					pAllocation->Set_Value(x, y, pFeatures->asDouble(x, y));
-				}
+		DataObject_Set_Colors(pDistance, 11, SG_COLORS_RAINBOW);
 
-				//-----------------------------------------
-				bool	bBorder	= false;
+		for(sLong iCell=0; iCell<Get_NCells() && Set_Progress_NCells(iCell); iCell++)
+		{
+			if( pDEM->Get_Sorted(iCell, x, y, false) )
+			{
+				double	Distance	= 0.0;
 
-				for(int i=0; i<8 && !bBorder; i++)
+				if( (i = pDEM->Get_Gradient_NeighborDir(x, y, true, false)) >= 0 )
 				{
 					int	ix	= Get_xTo(i, x);
 					int	iy	= Get_yTo(i, y);
 
-					if( is_InGrid(ix, iy) && pFeatures->is_NoData(ix, iy) )
+					if( pDistance->is_InGrid(ix, iy) )
 					{
-						bBorder	= true;
+						Distance	= pDistance->asDouble(ix, iy) + Get_Length(i) * (pWeights ? pWeights->asDouble(ix, iy) : 1.0);
 					}
 				}
 
-				if( bBorder )
-				{
-					Search.Add_Point(x, y, pFeatures->asDouble(x, y));
-				}
+				pDistance->Set_Value(x, y, Distance);
 			}
 		}
 	}
 
-	if( !Search.is_Okay() || Search.Get_Point_Count() <= 0 || Search.Get_Point_Count() >= Get_NCells() )
+	//-----------------------------------------------------
+	else	// upstream
 	{
-		Message_Add(_TL("no features to buffer."));
-
-		return( false );
-	}
+		pDistance->Set_Name(CSG_String::Format("%s [%s]", _TL("Flow Path Length"), _TL("upstream")));
 
-	//-----------------------------------------------------
-	Process_Set_Text(_TL("performing distance calculation..."));
+		DataObject_Set_Colors(pDistance, 11, SG_COLORS_WHITE_BLUE);
 
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		for(x=0; x<Get_NX(); x++)
+		for(sLong iCell=0; iCell<Get_NCells() && Set_Progress_NCells(iCell); iCell++)
 		{
-			if( pDistance->asDouble(x, y) < 0.0 && Search.Get_Nearest_Point(x, y, p, z, d) )
+			if( pDEM->Get_Sorted(iCell, x, y, true) )
 			{
-				pDistance->Set_Value(x, y, d * Get_Cellsize());
-
-				if( pDirection )
+				if( pDistance->is_NoData(x, y) )
 				{
-					if( d > 0.0 )
-					{
-						pDirection->Set_Value(x, y, SG_Get_Angle_Of_Direction(x, y, p.x, p.y) * M_RAD_TO_DEG);
-					}
-					else
-					{
-						pDirection->Set_NoData(x, y);
-					}
+					pDistance->Set_Value(x, y, 0.0);
 				}
 
-				if( pAllocation )
+				if( (i = pDEM->Get_Gradient_NeighborDir(x, y, true, false)) >= 0 )
 				{
-					pAllocation->Set_Value(x, y, z);
+					int	ix	= Get_xTo(i, x);
+					int	iy	= Get_yTo(i, y);
+
+					if( pDEM->is_InGrid(ix, iy) )
+					{
+						double	Distance	= pDistance->asDouble(x, y) + Get_Length(i) * (pWeights ? pWeights->asDouble(x, y) : 1.0);
+
+						if( pDistance->is_NoData(ix, iy) || pDistance->asDouble(ix, iy) < Distance )
+						{
+							pDistance->Set_Value(ix, iy, Distance);
+						}
+					}
 				}
 			}
 		}
diff --git a/src/modules/grid/grid_filter/Filter_Rank.h b/src/modules/terrain_analysis/ta_hydrology/Flow_Length.h
similarity index 87%
copy from src/modules/grid/grid_filter/Filter_Rank.h
copy to src/modules/terrain_analysis/ta_hydrology/Flow_Length.h
index 5044bc6..477a3e5 100755
--- a/src/modules/grid/grid_filter/Filter_Rank.h
+++ b/src/modules/terrain_analysis/ta_hydrology/Flow_Length.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Filter_Rank.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: Flow_Length.h 1921 2014-01-09 10:24:11Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,13 +9,13 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                      Grid_Filter                      //
+//                     ta_hydrology                      //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                     Filter_Rank.h                     //
+//                     Flow_Length.h                     //
 //                                                       //
-//                 Copyright (C) 2010 by                 //
+//                 Copyright (C) 2016 by                 //
 //                      Olaf Conrad                      //
 //                                                       //
 //-------------------------------------------------------//
@@ -59,8 +59,8 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifndef HEADER_INCLUDED__Filter_Rank_H
-#define HEADER_INCLUDED__Filter_Rank_H
+#ifndef HEADER_INCLUDED__Flow_Length_H
+#define HEADER_INCLUDED__Flow_Length_H
 
 
 ///////////////////////////////////////////////////////////
@@ -80,26 +80,18 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CFilter_Rank : public CSG_Module_Grid
+class CFlow_Length : public CSG_Module_Grid  
 {
 public:
-	CFilter_Rank(void);
+	CFlow_Length(void);
+
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("Flow Accumulation") );	}
 
 
 protected:
 
 	virtual bool			On_Execute		(void);
 
-
-private:
-
-	CSG_Grid_Cell_Addressor	m_Kernel;
-
-	CSG_Grid				*m_pInput;
-
-
-	bool					Get_Value		(int x, int y, double Rank, double &Value);
-
 };
 
 
@@ -110,4 +102,4 @@ private:
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__Filter_Rank_H
+#endif // #ifndef HEADER_INCLUDED__Flow_Length_H
diff --git a/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.cpp b/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.cpp
index 940f8c0..0d323dd 100755
--- a/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.cpp
+++ b/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: IsochronesVar.cpp 2492 2015-05-18 12:37:39Z reklov_w $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     IsochronesVar.cpp
diff --git a/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.h b/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.h
index 5097a0f..444c557 100755
--- a/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.h
+++ b/src/modules/terrain_analysis/ta_hydrology/IsochronesVar.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: IsochronesVar.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 /*******************************************************************************
     IsochronesVar.h
diff --git a/src/modules/terrain_analysis/ta_hydrology/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_hydrology/MLB_Interface.cpp
index 9250402..a549a3a 100755
--- a/src/modules/terrain_analysis/ta_hydrology/MLB_Interface.cpp
+++ b/src/modules/terrain_analysis/ta_hydrology/MLB_Interface.cpp
@@ -98,6 +98,7 @@ CSG_String Get_Info(int i)
 #include "Flow_AreaDownslope.h"
 
 #include "Flow_Distance.h"
+#include "Flow_Length.h"
 #include "SlopeLength.h"
 
 #include "EdgeContamination.h"
@@ -144,7 +145,6 @@ CSG_Module *		Create_Module(int i)
 	case 11:	return( new CSinuosity );
 	case 12:	return( new CFlowDepth );
 	case 13:	return( new CEdgeContamination );
-	case 14:	return( MLB_INTERFACE_SKIP_MODULE );	// removed: CTopographicIndices
 	case 15:	return( new CSAGA_Wetness_Index );
 	case 16:	return( new CLakeFlood );
 	case 17:	return( new CLakeFloodInteractive );
@@ -157,9 +157,11 @@ CSG_Module *		Create_Module(int i)
 	case 24:	return( new CTCI_Low );
 	case 25:	return( new CErosion_LS_Fields );
 	case 26:	return( new CFlow_by_Slope );
-	}
+	case 27:	return( new CFlow_Length );
 
-	return( NULL );
+	case 28:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
 }
 
 
diff --git a/src/modules/terrain_analysis/ta_hydrology/Makefile.am b/src/modules/terrain_analysis/ta_hydrology/Makefile.am
index b2db1e4..13946f1 100755
--- a/src/modules/terrain_analysis/ta_hydrology/Makefile.am
+++ b/src/modules/terrain_analysis/ta_hydrology/Makefile.am
@@ -19,6 +19,7 @@ Flow_AreaDownslope.cpp\
 Flow_AreaUpslope.cpp\
 flow_by_slope.cpp\
 Flow_Distance.cpp\
+Flow_Length.cpp\
 Flow_Parallel.cpp\
 Flow_RecursiveDown.cpp\
 Flow_RecursiveUp.cpp\
@@ -45,6 +46,7 @@ Flow_AreaUpslope.h\
 flow_by_slope.h\
 Flow_BRM.h\
 Flow_Distance.h\
+Flow_Length.h\
 Flow_Parallel.h\
 Flow_RecursiveDown.h\
 Flow_RecursiveUp.h\
diff --git a/src/modules/terrain_analysis/ta_hydrology/Makefile.in b/src/modules/terrain_analysis/ta_hydrology/Makefile.in
index 6caa49b..a842186 100644
--- a/src/modules/terrain_analysis/ta_hydrology/Makefile.in
+++ b/src/modules/terrain_analysis/ta_hydrology/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis/ta_hydrology
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -130,12 +140,12 @@ libta_hydrology_la_DEPENDENCIES =  \
 am_libta_hydrology_la_OBJECTS = CellBalance.lo EdgeContamination.lo \
 	Erosion_LS_Fields.lo Flow.lo Flow_AreaDownslope.lo \
 	Flow_AreaUpslope.lo flow_by_slope.lo Flow_Distance.lo \
-	Flow_Parallel.lo Flow_RecursiveDown.lo Flow_RecursiveUp.lo \
-	flow_massflux.lo flow_width.lo FlowDepth.lo Helper.lo \
-	IsochronesConst.lo IsochronesVar.lo LakeFlood.lo \
-	LakeFloodInteractive.lo MLB_Interface.lo melton_ruggedness.lo \
-	SAGA_Wetness_Index.lo Sinuosity.lo SlopeLength.lo \
-	TopographicIndices.lo
+	Flow_Length.lo Flow_Parallel.lo Flow_RecursiveDown.lo \
+	Flow_RecursiveUp.lo flow_massflux.lo flow_width.lo \
+	FlowDepth.lo Helper.lo IsochronesConst.lo IsochronesVar.lo \
+	LakeFlood.lo LakeFloodInteractive.lo MLB_Interface.lo \
+	melton_ruggedness.lo SAGA_Wetness_Index.lo Sinuosity.lo \
+	SlopeLength.lo TopographicIndices.lo
 libta_hydrology_la_OBJECTS = $(am_libta_hydrology_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -219,6 +229,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -252,6 +263,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -270,6 +288,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -359,6 +378,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -386,6 +406,7 @@ Flow_AreaDownslope.cpp\
 Flow_AreaUpslope.cpp\
 flow_by_slope.cpp\
 Flow_Distance.cpp\
+Flow_Length.cpp\
 Flow_Parallel.cpp\
 Flow_RecursiveDown.cpp\
 Flow_RecursiveUp.cpp\
@@ -412,6 +433,7 @@ Flow_AreaUpslope.h\
 flow_by_slope.h\
 Flow_BRM.h\
 Flow_Distance.h\
+Flow_Length.h\
 Flow_Parallel.h\
 Flow_RecursiveDown.h\
 Flow_RecursiveUp.h\
@@ -446,7 +468,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_hydrology/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_hydrology/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -517,6 +538,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_AreaDownslope.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_AreaUpslope.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_Distance.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_Length.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_Parallel.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_RecursiveDown.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Flow_RecursiveUp.Plo at am__quote@
@@ -772,6 +794,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_lighting/HillShade.cpp b/src/modules/terrain_analysis/ta_lighting/HillShade.cpp
index 9bcab9c..b3a16ea 100755
--- a/src/modules/terrain_analysis/ta_lighting/HillShade.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/HillShade.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: HillShade.cpp 2841 2016-03-05 11:25:04Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/HillShade.h b/src/modules/terrain_analysis/ta_lighting/HillShade.h
index feb46db..46619de 100755
--- a/src/modules/terrain_analysis/ta_lighting/HillShade.h
+++ b/src/modules/terrain_analysis/ta_lighting/HillShade.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: HillShade.h 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_lighting/MLB_Interface.cpp
index 4cad9db..9f694be 100755
--- a/src/modules/terrain_analysis/ta_lighting/MLB_Interface.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/MLB_Interface.h b/src/modules/terrain_analysis/ta_lighting/MLB_Interface.h
index 1b08954..dda8f75 100755
--- a/src/modules/terrain_analysis/ta_lighting/MLB_Interface.h
+++ b/src/modules/terrain_analysis/ta_lighting/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/Makefile.in b/src/modules/terrain_analysis/ta_lighting/Makefile.in
index bec0deb..1d71246 100644
--- a/src/modules/terrain_analysis/ta_lighting/Makefile.in
+++ b/src/modules/terrain_analysis/ta_lighting/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis/ta_lighting
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -409,7 +429,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_lighting/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_lighting/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -719,6 +738,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_lighting/SolarRadiation.cpp b/src/modules/terrain_analysis/ta_lighting/SolarRadiation.cpp
index a7192f5..4a11c69 100755
--- a/src/modules/terrain_analysis/ta_lighting/SolarRadiation.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/SolarRadiation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SolarRadiation.cpp 2873 2016-03-31 09:37:32Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/SolarRadiation.h b/src/modules/terrain_analysis/ta_lighting/SolarRadiation.h
index 7b340bb..dea71cc 100755
--- a/src/modules/terrain_analysis/ta_lighting/SolarRadiation.h
+++ b/src/modules/terrain_analysis/ta_lighting/SolarRadiation.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SolarRadiation.h 2873 2016-03-31 09:37:32Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.cpp b/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.cpp
index 796c6ae..130263b 100755
--- a/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Visibility_BASE.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.h b/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.h
index 0de310a..2c276de 100755
--- a/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.h
+++ b/src/modules/terrain_analysis/ta_lighting/Visibility_BASE.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Visibility_BASE.h 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/Visibility_Point.cpp b/src/modules/terrain_analysis/ta_lighting/Visibility_Point.cpp
index 6267fe1..8500096 100755
--- a/src/modules/terrain_analysis/ta_lighting/Visibility_Point.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/Visibility_Point.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Visibility_Point.cpp 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/Visibility_Point.h b/src/modules/terrain_analysis/ta_lighting/Visibility_Point.h
index 124eaa2..2d042df 100755
--- a/src/modules/terrain_analysis/ta_lighting/Visibility_Point.h
+++ b/src/modules/terrain_analysis/ta_lighting/Visibility_Point.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Visibility_Point.h 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/Visibility_Points.cpp b/src/modules/terrain_analysis/ta_lighting/Visibility_Points.cpp
index 150f864..a11df29 100755
--- a/src/modules/terrain_analysis/ta_lighting/Visibility_Points.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/Visibility_Points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Visibility_Points.cpp 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/Visibility_Points.h b/src/modules/terrain_analysis/ta_lighting/Visibility_Points.h
index 9de672d..b16d4fe 100755
--- a/src/modules/terrain_analysis/ta_lighting/Visibility_Points.h
+++ b/src/modules/terrain_analysis/ta_lighting/Visibility_Points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Visibility_Points.h 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/topographic_correction.cpp b/src/modules/terrain_analysis/ta_lighting/topographic_correction.cpp
index f753780..b5191fd 100755
--- a/src/modules/terrain_analysis/ta_lighting/topographic_correction.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/topographic_correction.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: topographic_correction.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/topographic_correction.h b/src/modules/terrain_analysis/ta_lighting/topographic_correction.h
index 6a0e706..d504ba1 100755
--- a/src/modules/terrain_analysis/ta_lighting/topographic_correction.h
+++ b/src/modules/terrain_analysis/ta_lighting/topographic_correction.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: topographic_correction.h 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/topographic_openness.cpp b/src/modules/terrain_analysis/ta_lighting/topographic_openness.cpp
index e5d315a..071ca0a 100755
--- a/src/modules/terrain_analysis/ta_lighting/topographic_openness.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/topographic_openness.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: topographic_openness.cpp 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/topographic_openness.h b/src/modules/terrain_analysis/ta_lighting/topographic_openness.h
index 7fa16d6..85bdd77 100755
--- a/src/modules/terrain_analysis/ta_lighting/topographic_openness.h
+++ b/src/modules/terrain_analysis/ta_lighting/topographic_openness.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: topographic_openness.h 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/view_shed.cpp b/src/modules/terrain_analysis/ta_lighting/view_shed.cpp
index e2fa308..fdabc23 100755
--- a/src/modules/terrain_analysis/ta_lighting/view_shed.cpp
+++ b/src/modules/terrain_analysis/ta_lighting/view_shed.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_shed.cpp 1972 2014-02-06 16:19:50Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_lighting/view_shed.h b/src/modules/terrain_analysis/ta_lighting/view_shed.h
index 4fc97a2..79e5695 100755
--- a/src/modules/terrain_analysis/ta_lighting/view_shed.h
+++ b/src/modules/terrain_analysis/ta_lighting/view_shed.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_shed.h 2137 2014-06-05 08:23:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_morphometry/Hypsometry.cpp b/src/modules/terrain_analysis/ta_morphometry/Hypsometry.cpp
index 6480fa7..8e0c075 100755
--- a/src/modules/terrain_analysis/ta_morphometry/Hypsometry.cpp
+++ b/src/modules/terrain_analysis/ta_morphometry/Hypsometry.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Hypsometry.cpp 2322 2014-11-03 21:29:57Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_morphometry/Hypsometry.h b/src/modules/terrain_analysis/ta_morphometry/Hypsometry.h
index 373ef54..5d563c4 100755
--- a/src/modules/terrain_analysis/ta_morphometry/Hypsometry.h
+++ b/src/modules/terrain_analysis/ta_morphometry/Hypsometry.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Hypsometry.h 2103 2014-04-21 12:21:50Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_morphometry/Makefile.in b/src/modules/terrain_analysis/ta_morphometry/Makefile.in
index b810585..090e4e6 100644
--- a/src/modules/terrain_analysis/ta_morphometry/Makefile.in
+++ b/src/modules/terrain_analysis/ta_morphometry/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis/ta_morphometry
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -219,6 +229,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -252,6 +263,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -270,6 +288,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -359,6 +378,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -444,7 +464,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_morphometry/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_morphometry/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -769,6 +788,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_morphometry/param_scale.cpp b/src/modules/terrain_analysis/ta_morphometry/param_scale.cpp
index 0c86936..baea9f1 100755
--- a/src/modules/terrain_analysis/ta_morphometry/param_scale.cpp
+++ b/src/modules/terrain_analysis/ta_morphometry/param_scale.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: param_scale.cpp 2435 2015-03-05 17:17:00Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_morphometry/param_scale.h b/src/modules/terrain_analysis/ta_morphometry/param_scale.h
index b3ff031..67c634a 100755
--- a/src/modules/terrain_analysis/ta_morphometry/param_scale.h
+++ b/src/modules/terrain_analysis/ta_morphometry/param_scale.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: param_scale.h 2435 2015-03-05 17:17:00Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_preprocessor/Makefile.in b/src/modules/terrain_analysis/ta_preprocessor/Makefile.in
index e837cd3..5429070 100644
--- a/src/modules/terrain_analysis/ta_preprocessor/Makefile.in
+++ b/src/modules/terrain_analysis/ta_preprocessor/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis/ta_preprocessor
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -405,7 +425,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_preprocessor/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_preprocessor/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -714,6 +733,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_profiles/Makefile.in b/src/modules/terrain_analysis/ta_profiles/Makefile.in
index 834d511..5fec332 100644
--- a/src/modules/terrain_analysis/ta_profiles/Makefile.in
+++ b/src/modules/terrain_analysis/ta_profiles/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis/ta_profiles
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -405,7 +425,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_profiles/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_profiles/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -713,6 +732,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.cpp
index adf8c31..79359c0 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.cpp
+++ b/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ANGMAP_01.cpp 1948 2014-01-17 15:09:07Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.h b/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.h
index 5c07b5e..e045cfb 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.h
+++ b/src/modules/terrain_analysis/ta_slope_stability/ANGMAP_01.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: ANGMAP_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.cpp b/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.cpp
index 1c84722..9624d07 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.cpp
+++ b/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2304 2014-10-24 08:55:03Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.h b/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.h
index 4e01208..fd8d873 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.h
+++ b/src/modules/terrain_analysis/ta_slope_stability/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/Makefile.in b/src/modules/terrain_analysis/ta_slope_stability/Makefile.in
index 87f54eb..cc699ce 100644
--- a/src/modules/terrain_analysis/ta_slope_stability/Makefile.in
+++ b/src/modules/terrain_analysis/ta_slope_stability/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/terrain_analysis/ta_slope_stability
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -405,7 +425,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_slope_stability/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/terrain_analysis/ta_slope_stability/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -713,6 +732,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.cpp
index 1fc9bc5..25c2541 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.cpp
+++ b/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SHALSTAB_01.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.h b/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.h
index a59aa2c..54a3b04 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.h
+++ b/src/modules/terrain_analysis/ta_slope_stability/SHALSTAB_01.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: SHALSTAB_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.cpp
index d16e268..98bff2a 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.cpp
+++ b/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Safetyfactor_01.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.h b/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.h
index af877c2..340a6f6 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.h
+++ b/src/modules/terrain_analysis/ta_slope_stability/Safetyfactor_01.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Safetyfactor_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.cpp
index eaa6f6b..b03ef16 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.cpp
+++ b/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TOBIA_01.cpp 2807 2016-02-21 19:32:40Z johanvdw $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.h b/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.h
index c80a095..7366289 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.h
+++ b/src/modules/terrain_analysis/ta_slope_stability/TOBIA_01.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TOBIA_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.cpp
index 4b3f518..4152963 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.cpp
+++ b/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: WEDGEFAIL_01.cpp 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.h b/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.h
index cfc7942..47fc913 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.h
+++ b/src/modules/terrain_analysis/ta_slope_stability/WEDGEFAIL_01.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: WEDGEFAIL_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.cpp b/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.cpp
index 79b477a..d419106 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.cpp
+++ b/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: WETNESS_01.cpp 2834 2016-02-29 08:06:28Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.h b/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.h
index c6d6886..0d346ce 100755
--- a/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.h
+++ b/src/modules/terrain_analysis/ta_slope_stability/WETNESS_01.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: WETNESS_01.h 1935 2014-01-10 19:29:57Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/Makefile.in b/src/modules/tin/Makefile.in
index 94bdf6e..f397eb4 100644
--- a/src/modules/tin/Makefile.in
+++ b/src/modules/tin/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/tin
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,6 +160,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = tin_tools tin_viewer
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -207,6 +219,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -225,6 +244,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -314,6 +334,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -339,7 +360,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/tin/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/tin/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -634,6 +654,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/tin/tin_tools/MLB_Interface.cpp b/src/modules/tin/tin_tools/MLB_Interface.cpp
index 19b2356..01ba78b 100755
--- a/src/modules/tin/tin_tools/MLB_Interface.cpp
+++ b/src/modules/tin/tin_tools/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/MLB_Interface.h b/src/modules/tin/tin_tools/MLB_Interface.h
index 9e5a390..0ccc187 100755
--- a/src/modules/tin/tin_tools/MLB_Interface.h
+++ b/src/modules/tin/tin_tools/MLB_Interface.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/Makefile.am b/src/modules/tin/tin_tools/Makefile.am
index 702231d..fe5568c 100755
--- a/src/modules/tin/tin_tools/Makefile.am
+++ b/src/modules/tin/tin_tools/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/modules/tin/tin_tools/Makefile.in b/src/modules/tin/tin_tools/Makefile.in
index 7c6c428..5910cc8 100644
--- a/src/modules/tin/tin_tools/Makefile.in
+++ b/src/modules/tin/tin_tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/tin/tin_tools
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +224,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -247,6 +258,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -265,6 +283,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -354,6 +373,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -364,7 +384,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_UNICODE
@@ -407,7 +427,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/tin/tin_tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/tin/tin_tools/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -716,6 +735,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/modules/tin/tin_tools/TIN_Flow_Parallel.cpp b/src/modules/tin/tin_tools/TIN_Flow_Parallel.cpp
index ec0747f..9cc3eac 100755
--- a/src/modules/tin/tin_tools/TIN_Flow_Parallel.cpp
+++ b/src/modules/tin/tin_tools/TIN_Flow_Parallel.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_Flow_Parallel.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_Flow_Parallel.h b/src/modules/tin/tin_tools/TIN_Flow_Parallel.h
index 1a1950f..ccb6fbf 100755
--- a/src/modules/tin/tin_tools/TIN_Flow_Parallel.h
+++ b/src/modules/tin/tin_tools/TIN_Flow_Parallel.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_Flow_Parallel.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_Flow_Trace.cpp b/src/modules/tin/tin_tools/TIN_Flow_Trace.cpp
index 8ca2dd8..f420e7f 100755
--- a/src/modules/tin/tin_tools/TIN_Flow_Trace.cpp
+++ b/src/modules/tin/tin_tools/TIN_Flow_Trace.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_Flow_Trace.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_Flow_Trace.h b/src/modules/tin/tin_tools/TIN_Flow_Trace.h
index 879bd02..17e93db 100755
--- a/src/modules/tin/tin_tools/TIN_Flow_Trace.h
+++ b/src/modules/tin/tin_tools/TIN_Flow_Trace.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_Flow_Trace.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_From_Grid.cpp b/src/modules/tin/tin_tools/TIN_From_Grid.cpp
index 2668746..3cca119 100755
--- a/src/modules/tin/tin_tools/TIN_From_Grid.cpp
+++ b/src/modules/tin/tin_tools/TIN_From_Grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_From_Grid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_From_Grid.h b/src/modules/tin/tin_tools/TIN_From_Grid.h
index f00f410..93c2bb6 100755
--- a/src/modules/tin/tin_tools/TIN_From_Grid.h
+++ b/src/modules/tin/tin_tools/TIN_From_Grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_From_Grid.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp b/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp
index abb6ef4..9e59b61 100755
--- a/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp
+++ b/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_From_Grid_Specific_Points.cpp 2064 2014-03-21 13:20:57Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.h b/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.h
index f53b636..5a5d55e 100755
--- a/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.h
+++ b/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_From_Grid_Specific_Points.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_From_Shapes.cpp b/src/modules/tin/tin_tools/TIN_From_Shapes.cpp
index 4ccabb7..7cb6fbe 100755
--- a/src/modules/tin/tin_tools/TIN_From_Shapes.cpp
+++ b/src/modules/tin/tin_tools/TIN_From_Shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_From_Shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_From_Shapes.h b/src/modules/tin/tin_tools/TIN_From_Shapes.h
index 7cc1f62..a641122 100755
--- a/src/modules/tin/tin_tools/TIN_From_Shapes.h
+++ b/src/modules/tin/tin_tools/TIN_From_Shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_From_Shapes.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_Gradient.cpp b/src/modules/tin/tin_tools/TIN_Gradient.cpp
index 3e4e6bd..51ee92a 100755
--- a/src/modules/tin/tin_tools/TIN_Gradient.cpp
+++ b/src/modules/tin/tin_tools/TIN_Gradient.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_Gradient.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_Gradient.h b/src/modules/tin/tin_tools/TIN_Gradient.h
index a0424d2..ec35a80 100755
--- a/src/modules/tin/tin_tools/TIN_Gradient.h
+++ b/src/modules/tin/tin_tools/TIN_Gradient.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_Gradient.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_To_Shapes.cpp b/src/modules/tin/tin_tools/TIN_To_Shapes.cpp
index f6805fa..200437d 100755
--- a/src/modules/tin/tin_tools/TIN_To_Shapes.cpp
+++ b/src/modules/tin/tin_tools/TIN_To_Shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_To_Shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_tools/TIN_To_Shapes.h b/src/modules/tin/tin_tools/TIN_To_Shapes.h
index 21ab16a..25ce2aa 100755
--- a/src/modules/tin/tin_tools/TIN_To_Shapes.h
+++ b/src/modules/tin/tin_tools/TIN_To_Shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: TIN_To_Shapes.h 2851 2016-03-22 16:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/tin/tin_viewer/Makefile.in b/src/modules/tin/tin_viewer/Makefile.in
index d6771db..060d3a0 100644
--- a/src/modules/tin/tin_viewer/Makefile.in
+++ b/src/modules/tin/tin_viewer/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,10 +89,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/modules/tin/tin_viewer
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -213,6 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -246,6 +257,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -264,6 +282,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -353,6 +372,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -396,7 +416,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/tin/tin_viewer/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/modules/tin/tin_viewer/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -701,6 +720,8 @@ uninstall-am: uninstall-pkglibLTLIBRARIES
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-pkglibLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/saga_core/Makefile.in b/src/saga_core/Makefile.in
index 0deb0a6..f336c5c 100644
--- a/src/saga_core/Makefile.in
+++ b/src/saga_core/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,9 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/saga_core
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -90,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -148,6 +159,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -206,6 +218,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -224,6 +243,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -313,6 +333,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -340,7 +361,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/saga_core/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/saga_core/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -635,6 +655,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
 	ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/saga_core/saga_api/Makefile.am b/src/saga_core/saga_api/Makefile.am
index 2344972..9e44a70 100755
--- a/src/saga_core/saga_api/Makefile.am
+++ b/src/saga_core/saga_api/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2857 2016-03-23 14:22:48Z oconrad $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/saga_core/saga_api/Makefile.in b/src/saga_core/saga_api/Makefile.in
index 8a531c7..d1f4365 100644
--- a/src/saga_core/saga_api/Makefile.in
+++ b/src/saga_core/saga_api/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -16,7 +16,17 @@
 
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,11 +90,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/saga_core/saga_api
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(top_srcdir)/py-compile \
-	$(otherinclude_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -94,6 +102,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(otherinclude_HEADERS) \
+	$(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -249,6 +259,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/py-compile
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -282,6 +294,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -300,6 +319,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -389,6 +409,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -399,7 +420,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2857 2016-03-23 14:22:48Z oconrad $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 @SAGA_PYTHON_TRUE at SAGAPYTHONFLAGS = -D_SAGA_PYTHON
@@ -542,7 +563,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/saga_core/saga_api/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/saga_core/saga_api/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -1055,6 +1075,8 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-nodist_pyexecPYTHON \
 	uninstall-libLTLIBRARIES uninstall-nodist_pyexecPYTHON \
 	uninstall-otherincludeHEADERS uninstall-pyexecLTLIBRARIES
 
+.PRECIOUS: Makefile
+
 
 install-exec-hook:
 	-ldconfig
diff --git a/src/saga_core/saga_api/api_callback.cpp b/src/saga_core/saga_api/api_callback.cpp
index 961b608..77c6328 100755
--- a/src/saga_core/saga_api/api_callback.cpp
+++ b/src/saga_core/saga_api/api_callback.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_callback.cpp 2715 2015-12-04 11:54:03Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/api_colors.cpp b/src/saga_core/saga_api/api_colors.cpp
index c6fb0e3..180ec5b 100755
--- a/src/saga_core/saga_api/api_colors.cpp
+++ b/src/saga_core/saga_api/api_colors.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_colors.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/api_core.cpp b/src/saga_core/saga_api/api_core.cpp
index d9d5179..8db719e 100755
--- a/src/saga_core/saga_api/api_core.cpp
+++ b/src/saga_core/saga_api/api_core.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_core.cpp 2872 2016-03-30 16:28:26Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/api_core.h b/src/saga_core/saga_api/api_core.h
index c692ff3..4b83a21 100755
--- a/src/saga_core/saga_api/api_core.h
+++ b/src/saga_core/saga_api/api_core.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_core.h 2872 2016-03-30 16:28:26Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/api_file.cpp b/src/saga_core/saga_api/api_file.cpp
index 04e4749..30c9552 100755
--- a/src/saga_core/saga_api/api_file.cpp
+++ b/src/saga_core/saga_api/api_file.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_file.cpp 2711 2015-12-02 16:12:16Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -66,6 +66,7 @@
 #include <wx/utils.h>
 #include <wx/filename.h>
 #include <wx/dir.h>
+#include <wx/wxcrtvararg.h>
 
 #include "api_core.h"
 
diff --git a/src/saga_core/saga_api/api_memory.cpp b/src/saga_core/saga_api/api_memory.cpp
index 0acad5e..7fb267a 100755
--- a/src/saga_core/saga_api/api_memory.cpp
+++ b/src/saga_core/saga_api/api_memory.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_memory.cpp 2745 2016-01-13 11:13:49Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/api_string.cpp b/src/saga_core/saga_api/api_string.cpp
index 3ab5caa..aded920 100755
--- a/src/saga_core/saga_api/api_string.cpp
+++ b/src/saga_core/saga_api/api_string.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_string.cpp 2564 2015-09-01 13:06:20Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -68,6 +68,8 @@
 #include <wx/string.h>
 #include <wx/datetime.h>
 #include <wx/tokenzr.h>
+#include <wx/wxcrt.h>
+#include <wx/wxcrtvararg.h>
 
 #include "api_core.h"
 
@@ -1066,35 +1068,35 @@ CSG_String		SG_Number_To_Date(int Value)
 
 CSG_String		SG_Number_To_Date(double Value)
 {
-	int		y, m, d;
+	int	y	= (int)(Value / 10000);	Value	-= y * 10000;
+	int	m	= (int)(Value /   100);	Value	-= m * 100;
+	int	d	= (int)(Value /     1);
 
-	y	= (int)(Value / 10000);	Value	-= y * 10000;
-	m	= (int)(Value / 100);	Value	-= m * 100;
-	d	= (int)(Value / 1);
-
-	return( CSG_String::Format(SG_T("%02d.%02d.%04d"), d, m, y) );
+	return( CSG_String::Format("%04d-%02d-%02d", y, m, d) );	// yyyy-mm-dd (ISO 8601)
 }
 
 //---------------------------------------------------------
 int				SG_Date_To_Number(const CSG_String &String)
 {
-	if( String.Length() > 0 )
+	if( String.Length() >= 10 )
 	{
-		CSG_String	s(String), sValue;
-
-		sValue	= s.AfterLast	('.');
-		int	y	= sValue.asInt();
-		sValue	= s.BeforeLast	('.');	s		= sValue;
+		if( String[4] == '-' && String[7] == '-' )	// yyyy-mm-dd (ISO 8601)
+		{
+			int	y	= String.BeforeFirst('-').asInt();
+			int	m	= String.AfterFirst ('-').asInt(); if( m < 1 ) m = 1; else if( m > 12 ) m = 12;
+			int	d	= String.AfterLast  ('-').asInt(); if( d < 1 ) d = 1; else if( d > 31 ) d = 31;
 
-		sValue	= s.AfterLast	('.');
-		int	m	= sValue.asInt();
-		sValue	= s.BeforeLast	('.');	s		= sValue;
-		int	d	= sValue.asInt();
+			return( 10000 * y + 100 * m + 1 * d );
+		}
 
-		if( d < 1 )	d	= 1;	else if( d > 31 )	d	= 31;
-		if( m < 1 )	m	= 1;	else if( m > 12 )	m	= 12;
+		if( String[2] == '.' && String[5] == '.' )	// dd.mm.yyyy
+		{
+			int	y	= String.AfterLast  ('.').asInt();
+			int	m	= String.AfterFirst ('.').asInt(); if( m < 1 ) m = 1; else if( m > 12 ) m = 12;
+			int	d	= String.BeforeFirst('.').asInt(); if( d < 1 ) d = 1; else if( d > 31 ) d = 31;
 
-		return( 10000 * y + 100 * m + 1 * d );
+			return( 10000 * y + 100 * m + 1 * d );
+		}
 	}
 
 	return( 0.0 );
diff --git a/src/saga_core/saga_api/api_translator.cpp b/src/saga_core/saga_api/api_translator.cpp
index 57dceab..fa7e5a5 100755
--- a/src/saga_core/saga_api/api_translator.cpp
+++ b/src/saga_core/saga_api/api_translator.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_translator.cpp 2005 2014-02-20 13:49:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/clipper.cpp b/src/saga_core/saga_api/clipper.cpp
index 76522ac..f44201a 100755
--- a/src/saga_core/saga_api/clipper.cpp
+++ b/src/saga_core/saga_api/clipper.cpp
@@ -1,8 +1,8 @@
 /*******************************************************************************
 *                                                                              *
 * Author    :  Angus Johnson                                                   *
-* Version   :  6.1.3a                                                          *
-* Date      :  22 January 2014                                                 *
+* Version   :  6.2.1                                                           *
+* Date      :  31 October 2014                                                 *
 * Website   :  http://www.angusj.com                                           *
 * Copyright :  Angus Johnson 2010-2014                                         *
 *                                                                              *
@@ -50,15 +50,6 @@
 
 namespace ClipperLib {
 
-#ifdef use_int32
-  static cInt const loRange = 46340;
-  static cInt const hiRange = 46340;
-#else
-  static cInt const loRange = 0x3FFFFFFF;
-  static cInt const hiRange = 0x3FFFFFFFFFFFFFFFLL;
-  typedef unsigned long long ulong64;
-#endif
-
 static double const pi = 3.141592653589793238;
 static double const two_pi = pi *2;
 static double const def_arc_tolerance = 0.25;
@@ -99,11 +90,10 @@ struct IntersectNode {
   IntPoint        Pt;
 };
 
-struct LocalMinima {
+struct LocalMinimum {
   cInt          Y;
   TEdge        *LeftBound;
   TEdge        *RightBound;
-  LocalMinima  *Next;
 };
 
 struct OutPt;
@@ -131,6 +121,14 @@ struct Join {
   IntPoint  OffPt;
 };
 
+struct LocMinSorter
+{
+  inline bool operator()(const LocalMinimum& locMin1, const LocalMinimum& locMin2)
+  {
+    return locMin2.Y < locMin1.Y;
+  }
+};
+
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 
@@ -170,7 +168,10 @@ PolyNode* PolyTree::GetFirst() const
 
 int PolyTree::Total() const
 {
-  return (int)AllNodes.size();
+  int result = (int)AllNodes.size();
+  //with negative offsets, ignore the hidden outer polygon ...
+  if (result > 0 && Childs[0] != AllNodes[0]) result--;
+  return result;
 }
 
 //------------------------------------------------------------------------------
@@ -240,8 +241,8 @@ bool PolyNode::IsOpen() const
 
 //------------------------------------------------------------------------------
 // Int128 class (enables safe math on signed 64bit integers)
-// eg Int128 val1((cInt)9223372036854775807); //ie 2^63 -1
-//    Int128 val2((cInt)9223372036854775807);
+// eg Int128 val1((long64)9223372036854775807); //ie 2^63 -1
+//    Int128 val2((long64)9223372036854775807);
 //    Int128 val3 = val1 * val2;
 //    val3.AsString => "85070591730234615847396907784232501249" (8.5e+37)
 //------------------------------------------------------------------------------
@@ -249,22 +250,21 @@ bool PolyNode::IsOpen() const
 class Int128
 {
   public:
+    ulong64 lo;
+    long64 hi;
 
-    cUInt lo;
-    cInt hi;
-
-    Int128(cInt _lo = 0)
+    Int128(long64 _lo = 0)
     {
-      lo = (cUInt)_lo;   
+      lo = (ulong64)_lo;   
       if (_lo < 0)  hi = -1; else hi = 0; 
     }
 
 
     Int128(const Int128 &val): lo(val.lo), hi(val.hi){}
 
-    Int128(const cInt& _hi, const ulong64& _lo): lo(_lo), hi(_hi){}
+    Int128(const long64& _hi, const ulong64& _lo): lo(_lo), hi(_hi){}
     
-    Int128& operator = (const cInt &val)
+    Int128& operator = (const long64 &val)
     {
       lo = (ulong64)val;
       if (val < 0) hi = -1; else hi = 0;
@@ -330,81 +330,18 @@ class Int128
     Int128 operator-() const //unary negation
     {
       if (lo == 0)
-        return Int128(-hi,0);
-      else 
-        return Int128(~hi,~lo +1);
-    }
-
-    Int128 operator/ (const Int128 &rhs) const
-    {
-      if (rhs.lo == 0 && rhs.hi == 0)
-        throw "Int128 operator/: divide by zero";
-
-      bool negate = (rhs.hi < 0) != (hi < 0);
-      Int128 dividend = *this;
-      Int128 divisor = rhs;
-      if (dividend.hi < 0) dividend = -dividend;
-      if (divisor.hi < 0) divisor = -divisor;
-
-      if (divisor < dividend)
-      {
-          Int128 result = Int128(0);
-          Int128 cntr = Int128(1);
-          while (divisor.hi >= 0 && !(divisor > dividend))
-          {
-              divisor.hi <<= 1;
-              if ((cInt)divisor.lo < 0) divisor.hi++;
-              divisor.lo <<= 1;
-
-              cntr.hi <<= 1;
-              if ((cInt)cntr.lo < 0) cntr.hi++;
-              cntr.lo <<= 1;
-          }
-          divisor.lo >>= 1;
-          if ((divisor.hi & 1) == 1)
-              divisor.lo |= 0x8000000000000000LL; 
-          divisor.hi = (ulong64)divisor.hi >> 1;
-
-          cntr.lo >>= 1;
-          if ((cntr.hi & 1) == 1)
-              cntr.lo |= 0x8000000000000000LL; 
-          cntr.hi >>= 1;
-
-          while (cntr.hi != 0 || cntr.lo != 0)
-          {
-              if (!(dividend < divisor))
-              {
-                  dividend -= divisor;
-                  result.hi |= cntr.hi;
-                  result.lo |= cntr.lo;
-              }
-              divisor.lo >>= 1;
-              if ((divisor.hi & 1) == 1)
-                  divisor.lo |= 0x8000000000000000LL; 
-              divisor.hi >>= 1;
-
-              cntr.lo >>= 1;
-              if ((cntr.hi & 1) == 1)
-                  cntr.lo |= 0x8000000000000000LL; 
-              cntr.hi >>= 1;
-          }
-          if (negate) result = -result;
-          return result;
-      }
-      else if (rhs.hi == this->hi && rhs.lo == this->lo)
-          return Int128(negate ? -1: 1);
+        return Int128(-hi, 0);
       else
-          return Int128(0);
+        return Int128(~hi, ~lo + 1);
     }
 
-    double AsDouble() const
+    operator double() const
     {
       const double shift64 = 18446744073709551616.0; //2^64
       if (hi < 0)
       {
-        cUInt lo_ = ~lo + 1;
-        if (lo_ == 0) return (double)hi * shift64;
-        else return -(double)(lo_ + ~hi * shift64);
+        if (lo == 0) return (double)hi * shift64;
+        else return -(double)(~lo + ~hi * shift64);
       }
       else
         return (double)(lo + hi * shift64);
@@ -413,7 +350,7 @@ class Int128
 };
 //------------------------------------------------------------------------------
 
-Int128 Int128Mul (cInt lhs, cInt rhs)
+Int128 Int128Mul (long64 lhs, long64 rhs)
 {
   bool negate = (lhs < 0) != (rhs < 0);
 
@@ -431,9 +368,9 @@ Int128 Int128Mul (cInt lhs, cInt rhs)
   ulong64 c = int1Hi * int2Lo + int1Lo * int2Hi;
 
   Int128 tmp;
-  tmp.hi = cInt(a + (c >> 32));
-  tmp.lo = cInt(c << 32);
-  tmp.lo += cInt(b);
+  tmp.hi = long64(a + (c >> 32));
+  tmp.lo = long64(c << 32);
+  tmp.lo += long64(b);
   if (tmp.lo < b) tmp.hi++;
   if (negate) tmp = -tmp;
   return tmp;
@@ -444,6 +381,13 @@ Int128 Int128Mul (cInt lhs, cInt rhs)
 // Miscellaneous global functions
 //------------------------------------------------------------------------------
 
+void Swap(cInt& val1, cInt& val2)
+{
+  cInt tmp = val1;
+  val1 = val2;
+  val2 = tmp;
+}
+//------------------------------------------------------------------------------
 bool Orientation(const Path &poly)
 {
     return Area(poly) >= 0;
@@ -494,6 +438,7 @@ bool PointIsVertex(const IntPoint &Pt, OutPt *pp)
 int PointInPolygon (const IntPoint &pt, const Path &path)
 {
   //returns 0 if false, +1 if true, -1 if pt ON polygon boundary
+  //See "The Point in Polygon Problem for Arbitrary Polygons" by Hormann & Agathos
   //http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.88.5498&rep=rep1&type=pdf
   int result = 0;
   size_t cnt = path.size();
@@ -539,7 +484,6 @@ int PointInPolygon (const IntPoint &pt, const Path &path)
 int PointInPolygon (const IntPoint &pt, OutPt *op)
 {
   //returns 0 if false, +1 if true, -1 if pt ON polygon boundary
-  //http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.88.5498&rep=rep1&type=pdf
   int result = 0;
   OutPt* startOp = op;
   for(;;)
@@ -584,8 +528,9 @@ bool Poly2ContainsPoly1(OutPt *OutPt1, OutPt *OutPt2)
   OutPt* op = OutPt1;
   do
   {
+    //nb: PointInPolygon returns 0 if false, +1 if true, -1 if pt on polygon
     int res = PointInPolygon(op->Pt, OutPt2);
-    if (res >= 0) return res != 0;
+    if (res >= 0) return res > 0;
     op = op->Next; 
   }
   while (op != OutPt1);
@@ -674,20 +619,18 @@ inline cInt TopX(TEdge &edge, const cInt currentY)
 }
 //------------------------------------------------------------------------------
 
-bool IntersectPoint(TEdge &Edge1, TEdge &Edge2,
-  IntPoint &ip, bool UseFullInt64Range)
+void IntersectPoint(TEdge &Edge1, TEdge &Edge2, IntPoint &ip)
 {
 #ifdef use_xyz  
   ip.Z = 0;
 #endif
+
   double b1, b2;
-  //nb: with very large coordinate values, it's possible for SlopesEqual() to 
-  //return false but for the edge.Dx value be equal due to double precision rounding.
-  if (SlopesEqual(Edge1, Edge2, UseFullInt64Range) || Edge1.Dx == Edge2.Dx)
+  if (Edge1.Dx == Edge2.Dx)
   {
-    if (Edge2.Bot.Y > Edge1.Bot.Y) ip = Edge2.Bot;
-    else ip = Edge1.Bot;
-    return false;
+    ip.Y = Edge1.Curr.Y;
+    ip.X = TopX(Edge1, ip.Y);
+    return;
   }
   else if (Edge1.Delta.X == 0)
   {
@@ -734,7 +677,15 @@ bool IntersectPoint(TEdge &Edge1, TEdge &Edge2,
     else
       ip.X = TopX(Edge2, ip.Y);
   } 
-  return true;
+  //finally, don't allow 'ip' to be BELOW curr.Y (ie bottom of scanbeam) ...
+  if (ip.Y > Edge1.Curr.Y)
+  {
+    ip.Y = Edge1.Curr.Y;
+    //use the more vertical edge to derive X ...
+    if (std::fabs(Edge1.Dx) > std::fabs(Edge2.Dx))
+      ip.X = TopX(Edge2, ip.Y); else
+      ip.X = TopX(Edge1, ip.Y);
+  }
 }
 //------------------------------------------------------------------------------
 
@@ -807,13 +758,9 @@ inline void ReverseHorizontal(TEdge &e)
   //swap horizontal edges' Top and Bottom x's so they follow the natural
   //progression of the bounds - ie so their xbots will align with the
   //adjoining lower edge. [Helpful in the ProcessHorizontal() method.]
-  cInt tmp = e.Top.X;
-  e.Top.X = e.Bot.X;
-  e.Bot.X = tmp;
+  Swap(e.Top.X, e.Bot.X);
 #ifdef use_xyz  
-  tmp = e.Top.Z;
-  e.Top.Z = e.Bot.Z;
-  e.Bot.Z = tmp;
+  Swap(e.Top.Z, e.Bot.Z);
 #endif
 }
 //------------------------------------------------------------------------------
@@ -905,26 +852,6 @@ OutPt* GetBottomPt(OutPt *pp)
 }
 //------------------------------------------------------------------------------
 
-bool FindSegment(OutPt* &pp, bool UseFullInt64Range, 
-  IntPoint &pt1, IntPoint &pt2)
-{
-  //OutPt1 & OutPt2 => the overlap segment (if the function returns true)
-  if (!pp) return false;
-  OutPt* pp2 = pp;
-  IntPoint pt1a = pt1, pt2a = pt2;
-  do
-  {
-    if (SlopesEqual(pt1a, pt2a, pp->Pt, pp->Prev->Pt, UseFullInt64Range) &&
-      SlopesEqual(pt1a, pt2a, pp->Pt, UseFullInt64Range) &&
-      GetOverlapSegment(pt1a, pt2a, pp->Pt, pp->Prev->Pt, pt1, pt2))
-        return true;
-    pp = pp->Next;
-  }
-  while (pp != pp2);
-  return false;
-}
-//------------------------------------------------------------------------------
-
 bool Pt2IsBetweenPt1AndPt3(const IntPoint pt1,
   const IntPoint pt2, const IntPoint pt3)
 {
@@ -937,50 +864,20 @@ bool Pt2IsBetweenPt1AndPt3(const IntPoint pt1,
 }
 //------------------------------------------------------------------------------
 
-OutPt* InsertPolyPtBetween(OutPt* p1, OutPt* p2, const IntPoint Pt)
-{
-  if (p1 == p2) throw "JoinError";
-  OutPt* result = new OutPt;
-  result->Pt = Pt;
-  if (p2 == p1->Next)
-  {
-    p1->Next = result;
-    p2->Prev = result;
-    result->Next = p2;
-    result->Prev = p1;
-  } else
-  {
-    p2->Next = result;
-    p1->Prev = result;
-    result->Next = p1;
-    result->Prev = p2;
-  }
-  return result;
-}
-//------------------------------------------------------------------------------
-
-bool HorzSegmentsOverlap(const IntPoint& pt1a, const IntPoint& pt1b, 
-    const IntPoint& pt2a, const IntPoint& pt2b)
+bool HorzSegmentsOverlap(cInt seg1a, cInt seg1b, cInt seg2a, cInt seg2b)
 {
-  //precondition: both segments are horizontal
-  if ((pt1a.X > pt2a.X) == (pt1a.X < pt2b.X)) return true;
-  else if ((pt1b.X > pt2a.X) == (pt1b.X < pt2b.X)) return true;
-  else if ((pt2a.X > pt1a.X) == (pt2a.X < pt1b.X)) return true;
-  else if ((pt2b.X > pt1a.X) == (pt2b.X < pt1b.X)) return true;
-  else if ((pt1a.X == pt2a.X) && (pt1b.X == pt2b.X)) return true;
-  else if ((pt1a.X == pt2b.X) && (pt1b.X == pt2a.X)) return true;
-  else return false;
+  if (seg1a > seg1b) Swap(seg1a, seg1b);
+  if (seg2a > seg2b) Swap(seg2a, seg2b);
+  return (seg1a < seg2b) && (seg2a < seg1b);
 }
 
-
 //------------------------------------------------------------------------------
 // ClipperBase class methods ...
 //------------------------------------------------------------------------------
 
 ClipperBase::ClipperBase() //constructor
 {
-  m_MinimaList = 0;
-  m_CurrentLM = 0;
+  m_CurrentLM = m_MinimaList.begin(); //begin() == end() here
   m_UseFullRange = false;
 }
 //------------------------------------------------------------------------------
@@ -1023,114 +920,129 @@ TEdge* FindNextLocMin(TEdge* E)
 }
 //------------------------------------------------------------------------------
 
-TEdge* ClipperBase::ProcessBound(TEdge* E, bool IsClockwise)
+TEdge* ClipperBase::ProcessBound(TEdge* E, bool NextIsForward)
 {
-  TEdge *EStart = E, *Result = E;
+  TEdge *Result = E;
   TEdge *Horz = 0;
-  cInt StartX;
-  if (IsHorizontal(*E))
-  {
-    //it's possible for adjacent overlapping horz edges to start heading left
-    //before finishing right, so ...
-    if (IsClockwise) StartX = E->Prev->Bot.X;
-    else StartX = E->Next->Bot.X;
-    if (E->Bot.X != StartX) ReverseHorizontal(*E);
-  }
-  
-  if (Result->OutIdx != Skip)
-  {
-    if (IsClockwise)
-    {
-      while (Result->Top.Y == Result->Next->Bot.Y && Result->Next->OutIdx != Skip)
-        Result = Result->Next;
-      if (IsHorizontal(*Result) && Result->Next->OutIdx != Skip)
-      {
-        //nb: at the top of a bound, horizontals are added to the bound
-        //only when the preceding edge attaches to the horizontal's left vertex
-        //unless a Skip edge is encountered when that becomes the top divide
-        Horz = Result;
-        while (IsHorizontal(*Horz->Prev)) Horz = Horz->Prev;
-        if (Horz->Prev->Top.X == Result->Next->Top.X) 
-        {
-          if (!IsClockwise) Result = Horz->Prev;
-        }
-        else if (Horz->Prev->Top.X > Result->Next->Top.X) Result = Horz->Prev;
-      }
-      while (E != Result) 
-      {
-        E->NextInLML = E->Next;
-        if (IsHorizontal(*E) && E != EStart &&
-          E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E);
-        E = E->Next;
-      }
-      if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Prev->Top.X) 
-        ReverseHorizontal(*E);
-      Result = Result->Next; //move to the edge just beyond current bound
-    } else
-    {
-      while (Result->Top.Y == Result->Prev->Bot.Y && Result->Prev->OutIdx != Skip) 
-        Result = Result->Prev;
-      if (IsHorizontal(*Result) && Result->Prev->OutIdx != Skip)
-      {
-        Horz = Result;
-        while (IsHorizontal(*Horz->Next)) Horz = Horz->Next;
-        if (Horz->Next->Top.X == Result->Prev->Top.X) 
-        {
-          if (!IsClockwise) Result = Horz->Next;
-        }
-        else if (Horz->Next->Top.X > Result->Prev->Top.X) Result = Horz->Next;
-      }
 
-      while (E != Result)
-      {
-        E->NextInLML = E->Prev;
-        if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X) 
-          ReverseHorizontal(*E);
-        E = E->Prev;
-      }
-      if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X) 
-        ReverseHorizontal(*E);
-      Result = Result->Prev; //move to the edge just beyond current bound
-    }
-  }
-
-  if (Result->OutIdx == Skip) 
+  if (E->OutIdx == Skip)
   {
     //if edges still remain in the current bound beyond the skip edge then
     //create another LocMin and call ProcessBound once more
-    E = Result;
-    if (IsClockwise)
+    if (NextIsForward)
     {
       while (E->Top.Y == E->Next->Bot.Y) E = E->Next;
       //don't include top horizontals when parsing a bound a second time,
       //they will be contained in the opposite bound ...
       while (E != Result && IsHorizontal(*E)) E = E->Prev;
-    } else
+    }
+    else
     {
       while (E->Top.Y == E->Prev->Bot.Y) E = E->Prev;
       while (E != Result && IsHorizontal(*E)) E = E->Next;
     }
+
     if (E == Result)
     {
-      if (IsClockwise) Result = E->Next;
+      if (NextIsForward) Result = E->Next;
       else Result = E->Prev;
-    } else
+    }
+    else
     {
       //there are more edges in the bound beyond result starting with E
-      if (IsClockwise)
-        E = Result->Next; 
+      if (NextIsForward)
+        E = Result->Next;
       else
         E = Result->Prev;
-      LocalMinima* locMin = new LocalMinima;
-      locMin->Next = 0;
-      locMin->Y = E->Bot.Y;
-      locMin->LeftBound = 0;
-      locMin->RightBound = E;
-      locMin->RightBound->WindDelta = 0;
-      Result = ProcessBound(locMin->RightBound, IsClockwise);
-      InsertLocalMinima(locMin);
+      MinimaList::value_type locMin;
+      locMin.Y = E->Bot.Y;
+      locMin.LeftBound = 0;
+      locMin.RightBound = E;
+      E->WindDelta = 0;
+      Result = ProcessBound(E, NextIsForward);
+      m_MinimaList.push_back(locMin);
+    }
+    return Result;
+  }
+
+  TEdge *EStart;
+
+  if (IsHorizontal(*E))
+  {
+    //We need to be careful with open paths because this may not be a
+    //true local minima (ie E may be following a skip edge).
+    //Also, consecutive horz. edges may start heading left before going right.
+    if (NextIsForward) 
+      EStart = E->Prev;
+    else 
+      EStart = E->Next;
+    if (EStart->OutIdx != Skip)
+    {
+      if (IsHorizontal(*EStart)) //ie an adjoining horizontal skip edge
+      {
+        if (EStart->Bot.X != E->Bot.X && EStart->Top.X != E->Bot.X)
+          ReverseHorizontal(*E);
+      }
+      else if (EStart->Bot.X != E->Bot.X)
+        ReverseHorizontal(*E);
+    }
+  }
+  
+  EStart = E;
+  if (NextIsForward)
+  {
+    while (Result->Top.Y == Result->Next->Bot.Y && Result->Next->OutIdx != Skip)
+      Result = Result->Next;
+    if (IsHorizontal(*Result) && Result->Next->OutIdx != Skip)
+    {
+      //nb: at the top of a bound, horizontals are added to the bound
+      //only when the preceding edge attaches to the horizontal's left vertex
+      //unless a Skip edge is encountered when that becomes the top divide
+      Horz = Result;
+      while (IsHorizontal(*Horz->Prev)) Horz = Horz->Prev;
+      if (Horz->Prev->Top.X == Result->Next->Top.X) 
+      {
+        if (!NextIsForward) Result = Horz->Prev;
+      }
+      else if (Horz->Prev->Top.X > Result->Next->Top.X) Result = Horz->Prev;
+    }
+    while (E != Result) 
+    {
+      E->NextInLML = E->Next;
+      if (IsHorizontal(*E) && E != EStart &&
+        E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E);
+      E = E->Next;
+    }
+    if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Prev->Top.X) 
+      ReverseHorizontal(*E);
+    Result = Result->Next; //move to the edge just beyond current bound
+  } else
+  {
+    while (Result->Top.Y == Result->Prev->Bot.Y && Result->Prev->OutIdx != Skip) 
+      Result = Result->Prev;
+    if (IsHorizontal(*Result) && Result->Prev->OutIdx != Skip)
+    {
+      Horz = Result;
+      while (IsHorizontal(*Horz->Next)) Horz = Horz->Next;
+      if (Horz->Next->Top.X == Result->Prev->Top.X) 
+      {
+        if (!NextIsForward) Result = Horz->Next;
+      }
+      else if (Horz->Next->Top.X > Result->Prev->Top.X) Result = Horz->Next;
     }
+
+    while (E != Result)
+    {
+      E->NextInLML = E->Prev;
+      if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X) 
+        ReverseHorizontal(*E);
+      E = E->Prev;
+    }
+    if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X) 
+      ReverseHorizontal(*E);
+    Result = Result->Prev; //move to the edge just beyond current bound
   }
+
   return Result;
 }
 //------------------------------------------------------------------------------
@@ -1179,7 +1091,8 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
   TEdge *E = eStart, *eLoopStop = eStart;
   for (;;)
   {
-    if ((E->Curr == E->Next->Curr))
+    //nb: allows matching start and end points when not Closed ...
+    if (E->Curr == E->Next->Curr && (Closed || E->Next != eStart))
     {
       if (E == E->Next) break;
       if (E == eStart) eStart = E->Next;
@@ -1205,7 +1118,7 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
       continue;
     }
     E = E->Next;
-    if (E == eLoopStop) break;
+    if ((E == eLoopStop) || (!Closed && E->Next == eStart)) break;
   }
 
   if ((!Closed && (E == E->Next)) || (Closed && (E->Prev == E->Next)))
@@ -1243,27 +1156,31 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
     }
     E->Prev->OutIdx = Skip;
     if (E->Prev->Bot.X < E->Prev->Top.X) ReverseHorizontal(*E->Prev);
-    LocalMinima* locMin = new LocalMinima();
-    locMin->Next = 0;
-    locMin->Y = E->Bot.Y;
-    locMin->LeftBound = 0;
-    locMin->RightBound = E;
-    locMin->RightBound->Side = esRight;
-    locMin->RightBound->WindDelta = 0;
+    MinimaList::value_type locMin;
+    locMin.Y = E->Bot.Y;
+    locMin.LeftBound = 0;
+    locMin.RightBound = E;
+    locMin.RightBound->Side = esRight;
+    locMin.RightBound->WindDelta = 0;
     while (E->Next->OutIdx != Skip)
     {
       E->NextInLML = E->Next;
       if (E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E);
       E = E->Next;
     }
-    InsertLocalMinima(locMin);
+    m_MinimaList.push_back(locMin);
     m_edges.push_back(edges);
 	  return true;
   }
 
   m_edges.push_back(edges);
-  bool clockwise;
+  bool leftBoundIsForward;
   TEdge* EMin = 0;
+
+  //workaround to avoid an endless loop in the while loop below when
+  //open paths have matching start and end points ...
+  if (E->Prev->Bot == E->Prev->Top) E = E->Next;
+
   for (;;)
   {
     E = FindNextLocMin(E);
@@ -1272,38 +1189,40 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
 
     //E and E.Prev now share a local minima (left aligned if horizontal).
     //Compare their slopes to find which starts which bound ...
-    LocalMinima* locMin = new LocalMinima;
-    locMin->Next = 0;
-    locMin->Y = E->Bot.Y;
+    MinimaList::value_type locMin;
+    locMin.Y = E->Bot.Y;
     if (E->Dx < E->Prev->Dx) 
     {
-      locMin->LeftBound = E->Prev;
-      locMin->RightBound = E;
-      clockwise = false; //Q.nextInLML = Q.prev
+      locMin.LeftBound = E->Prev;
+      locMin.RightBound = E;
+      leftBoundIsForward = false; //Q.nextInLML = Q.prev
     } else
     {
-      locMin->LeftBound = E;
-      locMin->RightBound = E->Prev;
-      clockwise = true; //Q.nextInLML = Q.next
+      locMin.LeftBound = E;
+      locMin.RightBound = E->Prev;
+      leftBoundIsForward = true; //Q.nextInLML = Q.next
     }
-    locMin->LeftBound->Side = esLeft;
-    locMin->RightBound->Side = esRight;
-
-    if (!Closed) locMin->LeftBound->WindDelta = 0;
-    else if (locMin->LeftBound->Next == locMin->RightBound)
-      locMin->LeftBound->WindDelta = -1;
-    else locMin->LeftBound->WindDelta = 1;
-    locMin->RightBound->WindDelta = -locMin->LeftBound->WindDelta;
-
-    E = ProcessBound(locMin->LeftBound, clockwise);
-    TEdge* E2 = ProcessBound(locMin->RightBound, !clockwise);
-
-    if (locMin->LeftBound->OutIdx == Skip)
-      locMin->LeftBound = 0;
-    else if (locMin->RightBound->OutIdx == Skip)
-      locMin->RightBound = 0;
-    InsertLocalMinima(locMin);
-    if (!clockwise) E = E2;
+    locMin.LeftBound->Side = esLeft;
+    locMin.RightBound->Side = esRight;
+
+    if (!Closed) locMin.LeftBound->WindDelta = 0;
+    else if (locMin.LeftBound->Next == locMin.RightBound)
+      locMin.LeftBound->WindDelta = -1;
+    else locMin.LeftBound->WindDelta = 1;
+    locMin.RightBound->WindDelta = -locMin.LeftBound->WindDelta;
+
+    E = ProcessBound(locMin.LeftBound, leftBoundIsForward);
+    if (E->OutIdx == Skip) E = ProcessBound(E, leftBoundIsForward);
+
+    TEdge* E2 = ProcessBound(locMin.RightBound, !leftBoundIsForward);
+    if (E2->OutIdx == Skip) E2 = ProcessBound(E2, !leftBoundIsForward);
+
+    if (locMin.LeftBound->OutIdx == Skip)
+      locMin.LeftBound = 0;
+    else if (locMin.RightBound->OutIdx == Skip)
+      locMin.RightBound = 0;
+    m_MinimaList.push_back(locMin);
+    if (!leftBoundIsForward) E = E2;
   }
   return true;
 }
@@ -1318,27 +1237,6 @@ bool ClipperBase::AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed)
 }
 //------------------------------------------------------------------------------
 
-void ClipperBase::InsertLocalMinima(LocalMinima *newLm)
-{
-  if( ! m_MinimaList )
-  {
-    m_MinimaList = newLm;
-  }
-  else if( newLm->Y >= m_MinimaList->Y )
-  {
-    newLm->Next = m_MinimaList;
-    m_MinimaList = newLm;
-  } else
-  {
-    LocalMinima* tmpLm = m_MinimaList;
-    while( tmpLm->Next  && ( newLm->Y < tmpLm->Next->Y ) )
-      tmpLm = tmpLm->Next;
-    newLm->Next = tmpLm->Next;
-    tmpLm->Next = newLm;
-  }
-}
-//------------------------------------------------------------------------------
-
 void ClipperBase::Clear()
 {
   DisposeLocalMinimaList();
@@ -1357,12 +1255,12 @@ void ClipperBase::Clear()
 
 void ClipperBase::Reset()
 {
-  m_CurrentLM = m_MinimaList;
-  if( !m_CurrentLM ) return; //ie nothing to process
+  m_CurrentLM = m_MinimaList.begin();
+  if (m_CurrentLM == m_MinimaList.end()) return; //ie nothing to process
+  std::sort(m_MinimaList.begin(), m_MinimaList.end(), LocMinSorter());
 
   //reset all edges ...
-  LocalMinima* lm = m_MinimaList;
-  while( lm )
+  for (MinimaList::iterator lm = m_MinimaList.begin(); lm != m_MinimaList.end(); ++lm)
   {
     TEdge* e = lm->LeftBound;
     if (e)
@@ -1379,35 +1277,29 @@ void ClipperBase::Reset()
       e->Side = esRight;
       e->OutIdx = Unassigned;
     }
-    lm = lm->Next;
   }
 }
 //------------------------------------------------------------------------------
 
 void ClipperBase::DisposeLocalMinimaList()
 {
-  while( m_MinimaList )
-  {
-    LocalMinima* tmpLm = m_MinimaList->Next;
-    delete m_MinimaList;
-    m_MinimaList = tmpLm;
-  }
-  m_CurrentLM = 0;
+  m_MinimaList.clear();
+  m_CurrentLM = m_MinimaList.begin();
 }
 //------------------------------------------------------------------------------
 
 void ClipperBase::PopLocalMinima()
 {
-  if( ! m_CurrentLM ) return;
-  m_CurrentLM = m_CurrentLM->Next;
+  if (m_CurrentLM == m_MinimaList.end()) return;
+  ++m_CurrentLM;
 }
 //------------------------------------------------------------------------------
 
 IntRect ClipperBase::GetBounds()
 {
   IntRect result;
-  LocalMinima* lm = m_MinimaList;
-  if (!lm)
+  MinimaList::iterator lm = m_MinimaList.begin();
+  if (lm == m_MinimaList.end())
   {
     result.left = result.top = result.right = result.bottom = 0;
     return result;
@@ -1416,10 +1308,9 @@ IntRect ClipperBase::GetBounds()
   result.top = lm->LeftBound->Bot.Y;
   result.right = lm->LeftBound->Bot.X;
   result.bottom = lm->LeftBound->Bot.Y;
-  while (lm)
+  while (lm != m_MinimaList.end())
   {
-    if (lm->LeftBound->Bot.Y > result.bottom)
-      result.bottom = lm->LeftBound->Bot.Y;
+    result.bottom = std::max(result.bottom, lm->LeftBound->Bot.Y);
     TEdge* e = lm->LeftBound;
     for (;;) {
       TEdge* bottomE = e;
@@ -1429,16 +1320,15 @@ IntRect ClipperBase::GetBounds()
         if (e->Bot.X > result.right) result.right = e->Bot.X;
         e = e->NextInLML;
       }
-      if (e->Bot.X < result.left) result.left = e->Bot.X;
-      if (e->Bot.X > result.right) result.right = e->Bot.X;
-      if (e->Top.X < result.left) result.left = e->Top.X;
-      if (e->Top.X > result.right) result.right = e->Top.X;
-      if (e->Top.Y < result.top) result.top = e->Top.Y;
-
+      result.left = std::min(result.left, e->Bot.X);
+      result.right = std::max(result.right, e->Bot.X);
+      result.left = std::min(result.left, e->Top.X);
+      result.right = std::max(result.right, e->Top.X);
+      result.top = std::min(result.top, e->Top.Y);
       if (bottomE == lm->LeftBound) e = lm->RightBound;
       else break;
     }
-    lm = lm->Next;
+    ++lm;
   }
   return result;
 }
@@ -1466,12 +1356,11 @@ Clipper::Clipper(int initOptions) : ClipperBase() //constructor
 Clipper::~Clipper() //destructor
 {
   Clear();
-  m_Scanbeam.clear();
 }
 //------------------------------------------------------------------------------
 
 #ifdef use_xyz  
-void Clipper::ZFillFunction(TZFillCallback zFillFunc)
+void Clipper::ZFillFunction(ZFillCallback zFillFunc)
 {  
   m_ZFill = zFillFunc;
 }
@@ -1481,15 +1370,11 @@ void Clipper::ZFillFunction(TZFillCallback zFillFunc)
 void Clipper::Reset()
 {
   ClipperBase::Reset();
-  m_Scanbeam.clear();
+  m_Scanbeam = ScanbeamList();
   m_ActiveEdges = 0;
   m_SortedEdges = 0;
-  LocalMinima* lm = m_MinimaList;
-  while (lm)
-  {
+  for (MinimaList::iterator lm = m_MinimaList.begin(); lm != m_MinimaList.end(); ++lm)
     InsertScanbeam(lm->Y);
-    lm = lm->Next;
-  }
 }
 //------------------------------------------------------------------------------
 
@@ -1550,7 +1435,7 @@ bool Clipper::ExecuteInternal()
   bool succeeded = true;
   try {
     Reset();
-    if (!m_CurrentLM) return false;
+    if (m_CurrentLM == m_MinimaList.end()) return true;
     cInt botY = PopScanbeam();
     do {
       InsertLocalMinimaIntoAEL(botY);
@@ -1558,11 +1443,11 @@ bool Clipper::ExecuteInternal()
       ProcessHorizontals(false);
       if (m_Scanbeam.empty()) break;
       cInt topY = PopScanbeam();
-      succeeded = ProcessIntersections(botY, topY);
+      succeeded = ProcessIntersections(topY);
       if (!succeeded) break;
       ProcessEdgesAtTopOfScanbeam(topY);
       botY = topY;
-    } while (!m_Scanbeam.empty() || m_CurrentLM);
+    } while (!m_Scanbeam.empty() || m_CurrentLM != m_MinimaList.end());
   }
   catch(...) 
   {
@@ -1601,14 +1486,16 @@ bool Clipper::ExecuteInternal()
 
 void Clipper::InsertScanbeam(const cInt Y)
 {
-  m_Scanbeam.insert(Y);
+  //if (!m_Scanbeam.empty() && Y == m_Scanbeam.top()) return;// avoid duplicates.
+  m_Scanbeam.push(Y);
 }
 //------------------------------------------------------------------------------
 
 cInt Clipper::PopScanbeam()
 {
-  cInt Y = *m_Scanbeam.begin();
-  m_Scanbeam.erase(m_Scanbeam.begin());
+  const cInt Y = m_Scanbeam.top();
+  m_Scanbeam.pop();
+  while (!m_Scanbeam.empty() && Y == m_Scanbeam.top()) { m_Scanbeam.pop(); } // Pop duplicates.
   return Y;
 }
 //------------------------------------------------------------------------------
@@ -1967,7 +1854,7 @@ void Clipper::AddGhostJoin(OutPt *op, const IntPoint OffPt)
 
 void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
 {
-  while(  m_CurrentLM  && ( m_CurrentLM->Y == botY ) )
+  while (m_CurrentLM != m_MinimaList.end() && (m_CurrentLM->Y == botY))
   {
     TEdge* lb = m_CurrentLM->LeftBound;
     TEdge* rb = m_CurrentLM->RightBound;
@@ -2018,7 +1905,7 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
         Join* jr = m_GhostJoins[i];
         //if the horizontal Rb and a 'ghost' horizontal overlap, then convert
         //the 'ghost' join to a real join ready for later ...
-        if (HorzSegmentsOverlap(jr->OutPt1->Pt, jr->OffPt, rb->Bot, rb->Top))
+        if (HorzSegmentsOverlap(jr->OutPt1->Pt.X, jr->OffPt.X, rb->Bot.X, rb->Top.X))
           AddJoin(jr->OutPt1, Op1, jr->OffPt);
       }
     }
@@ -2088,45 +1975,34 @@ void Clipper::DeleteFromSEL(TEdge *e)
 //------------------------------------------------------------------------------
 
 #ifdef use_xyz
-
-void Clipper::SetZ(IntPoint& pt, TEdge& e)
+void Clipper::SetZ(IntPoint& pt, TEdge& e1, TEdge& e2)
 {
-  pt.Z = 0;
-  if (m_ZFill)
-  {
-    //put the 'preferred' point as first parameter ...
-    if (e.OutIdx < 0)
-      (*m_ZFill)(e.Bot, e.Top, pt); //outside a path so presume entering
-    else
-      (*m_ZFill)(e.Top, e.Bot, pt); //inside a path so presume exiting
-  }
+  if (pt.Z != 0 || !m_ZFill) return;
+  else if (pt == e1.Bot) pt.Z = e1.Bot.Z;
+  else if (pt == e1.Top) pt.Z = e1.Top.Z;
+  else if (pt == e2.Bot) pt.Z = e2.Bot.Z;
+  else if (pt == e2.Top) pt.Z = e2.Top.Z;
+  else (*m_ZFill)(e1.Bot, e1.Top, e2.Bot, e2.Top, pt); 
 }
 //------------------------------------------------------------------------------
 #endif
 
-void Clipper::IntersectEdges(TEdge *e1, TEdge *e2,
-     const IntPoint &Pt, bool protect)
+void Clipper::IntersectEdges(TEdge *e1, TEdge *e2, IntPoint &Pt)
 {
-  //e1 will be to the Left of e2 BELOW the intersection. Therefore e1 is before
-  //e2 in AEL except when e1 is being inserted at the intersection point ...
-  bool e1stops = !protect &&  !e1->NextInLML &&
-    e1->Top.X == Pt.X && e1->Top.Y == Pt.Y;
-  bool e2stops = !protect &&  !e2->NextInLML &&
-    e2->Top.X == Pt.X && e2->Top.Y == Pt.Y;
   bool e1Contributing = ( e1->OutIdx >= 0 );
   bool e2Contributing = ( e2->OutIdx >= 0 );
 
+#ifdef use_xyz
+        SetZ(Pt, *e1, *e2);
+#endif
+
 #ifdef use_lines
   //if either edge is on an OPEN path ...
   if (e1->WindDelta == 0 || e2->WindDelta == 0)
   {
     //ignore subject-subject open path intersections UNLESS they
     //are both open paths, AND they are both 'contributing maximas' ...
-    if (e1->WindDelta == 0 && e2->WindDelta == 0)
-    {
-      if ((e1stops || e2stops) && e1Contributing && e2Contributing)
-        AddLocalMaxPoly(e1, e2, Pt);
-    }
+	if (e1->WindDelta == 0 && e2->WindDelta == 0) return;
 
     //if intersecting a subj line with a subj poly ...
     else if (e1->PolyTyp == e2->PolyTyp && 
@@ -2165,13 +2041,6 @@ void Clipper::IntersectEdges(TEdge *e1, TEdge *e2,
         if (e2Contributing) e2->OutIdx = Unassigned;
       }
     }
-
-    if (e1stops)
-      if (e1->OutIdx < 0) DeleteFromAEL(e1);
-      else throw clipperException("Error intersecting polylines");
-    if (e2stops) 
-      if (e2->OutIdx < 0) DeleteFromAEL(e2);
-      else throw clipperException("Error intersecting polylines");
     return;
   }
 #endif
@@ -2236,10 +2105,11 @@ void Clipper::IntersectEdges(TEdge *e1, TEdge *e2,
 
   if ( e1Contributing && e2Contributing )
   {
-    if ( e1stops || e2stops || 
-      (e1Wc != 0 && e1Wc != 1) || (e2Wc != 0 && e2Wc != 1) ||
+    if ((e1Wc != 0 && e1Wc != 1) || (e2Wc != 0 && e2Wc != 1) ||
       (e1->PolyTyp != e2->PolyTyp && m_ClipType != ctXor) )
-        AddLocalMaxPoly(e1, e2, Pt); 
+    {
+      AddLocalMaxPoly(e1, e2, Pt); 
+    }
     else
     {
       AddOutPt(e1, Pt);
@@ -2266,8 +2136,7 @@ void Clipper::IntersectEdges(TEdge *e1, TEdge *e2,
       SwapPolyIndexes(*e1, *e2);
     }
   } 
-  else if ( (e1Wc == 0 || e1Wc == 1) && 
-    (e2Wc == 0 || e2Wc == 1) && !e1stops && !e2stops )
+  else if ( (e1Wc == 0 || e1Wc == 1) && (e2Wc == 0 || e2Wc == 1))
   {
     //neither edge is currently contributing ...
 
@@ -2286,7 +2155,9 @@ void Clipper::IntersectEdges(TEdge *e1, TEdge *e2,
     }
 
     if (e1->PolyTyp != e2->PolyTyp)
-        AddLocalMinPoly(e1, e2, Pt);
+    {
+      AddLocalMinPoly(e1, e2, Pt);
+    }
     else if (e1Wc == 1 && e2Wc == 1)
       switch( m_ClipType ) {
         case ctIntersection:
@@ -2308,17 +2179,6 @@ void Clipper::IntersectEdges(TEdge *e1, TEdge *e2,
     else
       SwapSides( *e1, *e2 );
   }
-
-  if(  (e1stops != e2stops) &&
-    ( (e1stops && (e1->OutIdx >= 0)) || (e2stops && (e2->OutIdx >= 0)) ) )
-  {
-    SwapSides( *e1, *e2 );
-    SwapPolyIndexes( *e1, *e2 );
-  }
-
-  //finally, delete any non-contributing maxima edges  ...
-  if( e1stops ) DeleteFromAEL( e1 );
-  if( e2stops ) DeleteFromAEL( e2 );
 }
 //------------------------------------------------------------------------------
 
@@ -2509,12 +2369,7 @@ OutPt* Clipper::AddOutPt(TEdge *e, const IntPoint &pt)
     newOp->Prev = newOp;
     if (!outRec->IsOpen)
       SetHoleState(e, outRec);
-#ifdef use_xyz
-    if (pt == e->Bot) newOp->Pt = e->Bot;
-    else if (pt == e->Top) newOp->Pt = e->Top;
-    else SetZ(newOp->Pt, *e);
-#endif
-    e->OutIdx = outRec->Idx; //nb: do this after SetZ !
+    e->OutIdx = outRec->Idx;
     return newOp;
   } else
   {
@@ -2533,11 +2388,6 @@ OutPt* Clipper::AddOutPt(TEdge *e, const IntPoint &pt)
     newOp->Prev->Next = newOp;
     op->Prev = newOp;
     if (ToFront) outRec->Pts = newOp;
-#ifdef use_xyz
-    if (pt == e->Bot) newOp->Pt = e->Bot;
-    else if (pt == e->Top) newOp->Pt = e->Top;
-    else SetZ(newOp->Pt, *e);
-#endif
     return newOp;
   }
 }
@@ -2704,37 +2554,6 @@ void GetHorzDirection(TEdge& HorzEdge, Direction& Dir, cInt& Left, cInt& Right)
 }
 //------------------------------------------------------------------------
 
-void Clipper::PrepareHorzJoins(TEdge* horzEdge, bool isTopOfScanbeam)
-{
-  //get the last Op for this horizontal edge
-  //the point may be anywhere along the horizontal ...
-  OutPt* outPt = m_PolyOuts[horzEdge->OutIdx]->Pts;
-  if (horzEdge->Side != esLeft) outPt = outPt->Prev;
-
-  //First, match up overlapping horizontal edges (eg when one polygon's
-  //intermediate horz edge overlaps an intermediate horz edge of another, or
-  //when one polygon sits on top of another) ...
-  //for (JoinList::size_type i = 0; i < m_GhostJoins.size(); ++i)
-  //{
-  //  Join* j = m_GhostJoins[i];
-  //  if (HorzSegmentsOverlap(j->OutPt1->Pt, j->OffPt, horzEdge->Bot, horzEdge->Top))
-  //      AddJoin(j->OutPt1, outPt, j->OffPt);
-  //}
-
-  //Also, since horizontal edges at the top of one SB are often removed from
-  //the AEL before we process the horizontal edges at the bottom of the next,
-  //we need to create 'ghost' Join records of 'contrubuting' horizontals that
-  //we can compare with horizontals at the bottom of the next SB.
-  if (isTopOfScanbeam) 
-  {
-    if (outPt->Pt == horzEdge->Top)
-      AddGhostJoin(outPt, horzEdge->Bot); 
-    else
-      AddGhostJoin(outPt, horzEdge->Top);
-  }
-}
-//------------------------------------------------------------------------------
-
 /*******************************************************************************
 * Notes: Horizontal edges (HEs) at scanline intersections (ie at the Top or    *
 * Bottom of a scanbeam) are processed as if layered. The order in which HEs    *
@@ -2774,28 +2593,42 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam)
       if ((dir == dLeftToRight && e->Curr.X <= horzRight) ||
         (dir == dRightToLeft && e->Curr.X >= horzLeft))
       {
-        if (horzEdge->OutIdx >= 0 && horzEdge->WindDelta != 0) 
-          PrepareHorzJoins(horzEdge, isTopOfScanbeam);
         //so far we're still in range of the horizontal Edge  but make sure
         //we're at the last of consec. horizontals when matching with eMaxPair
         if(e == eMaxPair && IsLastHorz)
         {
-          if (dir == dLeftToRight)
-            IntersectEdges(horzEdge, e, e->Top);
-          else
-            IntersectEdges(e, horzEdge, e->Top);
-          if (eMaxPair->OutIdx >= 0) throw clipperException("ProcessHorizontal error");
+
+          if (horzEdge->OutIdx >= 0)
+          {
+            OutPt* op1 = AddOutPt(horzEdge, horzEdge->Top);
+            TEdge* eNextHorz = m_SortedEdges;
+            while (eNextHorz)
+            {
+              if (eNextHorz->OutIdx >= 0 &&
+                HorzSegmentsOverlap(horzEdge->Bot.X,
+                horzEdge->Top.X, eNextHorz->Bot.X, eNextHorz->Top.X))
+              {
+                OutPt* op2 = AddOutPt(eNextHorz, eNextHorz->Bot);
+                AddJoin(op2, op1, eNextHorz->Top);
+              }
+              eNextHorz = eNextHorz->NextInSEL;
+            }
+            AddGhostJoin(op1, horzEdge->Bot);
+            AddLocalMaxPoly(horzEdge, eMaxPair, horzEdge->Top);
+          }
+          DeleteFromAEL(horzEdge);
+          DeleteFromAEL(eMaxPair);
           return;
         }
         else if(dir == dLeftToRight)
         {
           IntPoint Pt = IntPoint(e->Curr.X, horzEdge->Curr.Y);
-          IntersectEdges(horzEdge, e, Pt, true);
+          IntersectEdges(horzEdge, e, Pt);
         }
         else
         {
           IntPoint Pt = IntPoint(e->Curr.X, horzEdge->Curr.Y);
-          IntersectEdges( e, horzEdge, Pt, true);
+          IntersectEdges( e, horzEdge, Pt);
         }
         SwapPositionsInAEL( horzEdge, e );
       }
@@ -2804,9 +2637,6 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam)
       e = eNext;
     } //end while
 
-    if (horzEdge->OutIdx >= 0 && horzEdge->WindDelta != 0)
-      PrepareHorzJoins(horzEdge, isTopOfScanbeam);
-
     if (horzEdge->NextInLML && IsHorizontal(*horzEdge->NextInLML))
     {
       UpdateEdgeIntoAEL(horzEdge);
@@ -2821,6 +2651,7 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam)
     if(horzEdge->OutIdx >= 0)
     {
       OutPt* op1 = AddOutPt( horzEdge, horzEdge->Top);
+      if (isTopOfScanbeam) AddGhostJoin(op1, horzEdge->Bot);
       UpdateEdgeIntoAEL(horzEdge);
       if (horzEdge->WindDelta == 0) return;
       //nb: HorzEdge is no longer horizontal here
@@ -2846,22 +2677,7 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam)
     else
       UpdateEdgeIntoAEL(horzEdge); 
   }
-  else if (eMaxPair)
-  {
-    if (eMaxPair->OutIdx >= 0)
-    {
-      if (dir == dLeftToRight)
-        IntersectEdges(horzEdge, eMaxPair, horzEdge->Top); 
-      else
-        IntersectEdges(eMaxPair, horzEdge, horzEdge->Top);
-      if (eMaxPair->OutIdx >= 0)
-        throw clipperException("ProcessHorizontal error");
-    } else
-    {
-      DeleteFromAEL(horzEdge);
-      DeleteFromAEL(eMaxPair);
-    }
-  } else
+  else
   {
     if (horzEdge->OutIdx >= 0) AddOutPt(horzEdge, horzEdge->Top);
     DeleteFromAEL(horzEdge);
@@ -2892,11 +2708,11 @@ void Clipper::UpdateEdgeIntoAEL(TEdge *&e)
 }
 //------------------------------------------------------------------------------
 
-bool Clipper::ProcessIntersections(const cInt botY, const cInt topY)
+bool Clipper::ProcessIntersections(const cInt topY)
 {
   if( !m_ActiveEdges ) return true;
   try {
-    BuildIntersectList(botY, topY);
+    BuildIntersectList(topY);
     size_t IlSize = m_IntersectList.size();
     if (IlSize == 0) return true;
     if (IlSize == 1 || FixupIntersectionOrder()) ProcessIntersectList();
@@ -2921,7 +2737,7 @@ void Clipper::DisposeIntersectNodes()
 }
 //------------------------------------------------------------------------------
 
-void Clipper::BuildIntersectList(const cInt botY, const cInt topY)
+void Clipper::BuildIntersectList(const cInt topY)
 {
   if ( !m_ActiveEdges ) return;
 
@@ -2948,16 +2764,7 @@ void Clipper::BuildIntersectList(const cInt botY, const cInt topY)
       IntPoint Pt;
       if(e->Curr.X > eNext->Curr.X)
       {
-        if (!IntersectPoint(*e, *eNext, Pt, m_UseFullRange) && e->Curr.X > eNext->Curr.X +1)
-          throw clipperException("Intersection error");
-        if (Pt.Y > botY)
-        {
-            Pt.Y = botY;
-            if (std::fabs(e->Dx) > std::fabs(eNext->Dx))
-              Pt.X = TopX(*eNext, botY); else
-              Pt.X = TopX(*e, botY);
-        }
-
+        IntersectPoint(*e, *eNext, Pt);
         IntersectNode * newNode = new IntersectNode;
         newNode->Edge1 = e;
         newNode->Edge2 = eNext;
@@ -2985,7 +2792,7 @@ void Clipper::ProcessIntersectList()
   {
     IntersectNode* iNode = m_IntersectList[i];
     {
-      IntersectEdges( iNode->Edge1, iNode->Edge2, iNode->Pt, true);
+      IntersectEdges( iNode->Edge1, iNode->Edge2, iNode->Pt);
       SwapPositionsInAEL( iNode->Edge1 , iNode->Edge2 );
     }
     delete iNode;
@@ -3044,7 +2851,7 @@ void Clipper::DoMaxima(TEdge *e)
   TEdge* eNext = e->NextInAEL;
   while(eNext && eNext != eMaxPair)
   {
-    IntersectEdges(e, eNext, e->Top, true);
+    IntersectEdges(e, eNext, e->Top);
     SwapPositionsInAEL(e, eNext);
     eNext = e->NextInAEL;
   }
@@ -3056,7 +2863,9 @@ void Clipper::DoMaxima(TEdge *e)
   }
   else if( e->OutIdx >= 0 && eMaxPair->OutIdx >= 0 )
   {
-    IntersectEdges( e, eMaxPair, e->Top);
+    if (e->OutIdx >= 0) AddLocalMaxPoly(e, eMaxPair, e->Top);
+    DeleteFromAEL(e);
+    DeleteFromAEL(eMaxPair);
   }
 #ifdef use_lines
   else if (e->WindDelta == 0)
@@ -3124,9 +2933,13 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
         if ((e->OutIdx >= 0) && (e->WindDelta != 0) && ePrev && (ePrev->OutIdx >= 0) &&
           (ePrev->Curr.X == e->Curr.X) && (ePrev->WindDelta != 0))
         {
-          OutPt* op = AddOutPt(ePrev, e->Curr);
-          OutPt* op2 = AddOutPt(e, e->Curr);
-          AddJoin(op, op2, e->Curr); //StrictlySimple (type-3) join
+          IntPoint pt = e->Curr;
+#ifdef use_xyz
+          SetZ(pt, *ePrev, *e);
+#endif
+          OutPt* op = AddOutPt(ePrev, pt);
+          OutPt* op2 = AddOutPt(e, pt);
+          AddJoin(op, op2, pt); //StrictlySimple (type-3) join
         }
       }
 
@@ -3508,6 +3321,7 @@ bool Clipper::JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2)
   (j->OffPt == j->OutPt2->Pt))
   {
     //Strictly Simple join ...
+    if (outRec1 != outRec2) return false;
     op1b = j->OutPt1->Next;
     while (op1b != op1 && (op1b->Pt == j->OffPt)) 
       op1b = op1b->Next;
@@ -3648,13 +3462,23 @@ bool Clipper::JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2)
 }
 //----------------------------------------------------------------------
 
+static OutRec* ParseFirstLeft(OutRec* FirstLeft)
+{
+  while (FirstLeft && !FirstLeft->Pts)
+    FirstLeft = FirstLeft->FirstLeft;
+  return FirstLeft;
+}
+//------------------------------------------------------------------------------
+
 void Clipper::FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec)
 { 
-  
+  //tests if NewOutRec contains the polygon before reassigning FirstLeft
   for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
   {
     OutRec* outRec = m_PolyOuts[i];
-    if (outRec->Pts && outRec->FirstLeft == OldOutRec) 
+    if (!outRec->Pts || !outRec->FirstLeft) continue;
+    OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft);
+    if (firstLeft == OldOutRec)
     {
       if (Poly2ContainsPoly1(outRec->Pts, NewOutRec->Pts))
         outRec->FirstLeft = NewOutRec;
@@ -3665,6 +3489,7 @@ void Clipper::FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec)
 
 void Clipper::FixupFirstLefts2(OutRec* OldOutRec, OutRec* NewOutRec)
 { 
+  //reassigns FirstLeft WITHOUT testing if NewOutRec contains the polygon
   for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
   {
     OutRec* outRec = m_PolyOuts[i];
@@ -3673,14 +3498,6 @@ void Clipper::FixupFirstLefts2(OutRec* OldOutRec, OutRec* NewOutRec)
 }
 //----------------------------------------------------------------------
 
-static OutRec* ParseFirstLeft(OutRec* FirstLeft)
-{
-  while (FirstLeft && !FirstLeft->Pts) 
-    FirstLeft = FirstLeft->FirstLeft;
-  return FirstLeft;
-}
-//------------------------------------------------------------------------------
-
 void Clipper::JoinCommonEdges()
 {
   for (JoinList::size_type i = 0; i < m_Joins.size(); i++)
@@ -3848,8 +3665,7 @@ void ClipperOffset::AddPath(const Path& path, JoinType joinType, EndType endType
         (path[i].Y == newNode->Contour[k].Y &&
         path[i].X < newNode->Contour[k].X)) k = j;
     }
-  if ((endType == etClosedPolygon && j < 2) || 
-    (endType != etClosedPolygon && j < 0))
+  if (endType == etClosedPolygon && j < 2)
   {
     delete newNode;
     return;
@@ -3859,7 +3675,7 @@ void ClipperOffset::AddPath(const Path& path, JoinType joinType, EndType endType
   //if this path's lowest pt is lower than all the others then update m_lowest
   if (endType != etClosedPolygon) return;
   if (m_lowest.X < 0)
-    m_lowest = IntPoint(0, k);
+    m_lowest = IntPoint(m_polyNodes.ChildCount() - 1, k);
   else
   {
     IntPoint ip = m_polyNodes.Childs[(int)m_lowest.X]->Contour[(int)m_lowest.Y];
@@ -3965,6 +3781,7 @@ void ClipperOffset::Execute(PolyTree& solution, double delta)
       PolyNode* outerNode = solution.Childs[0];
       solution.Childs.reserve(outerNode->ChildCount());
       solution.Childs[0] = outerNode->Childs[0];
+      solution.Childs[0]->Parent = outerNode->Parent;
       for (int i = 1; i < outerNode->ChildCount(); ++i)
         solution.AddChild(*outerNode->Childs[i]);
     }
@@ -4149,8 +3966,20 @@ void ClipperOffset::DoOffset(double delta)
 
 void ClipperOffset::OffsetPoint(int j, int& k, JoinType jointype)
 {
+  //cross product ...
   m_sinA = (m_normals[k].X * m_normals[j].Y - m_normals[j].X * m_normals[k].Y);
-  if (m_sinA < 0.00005 && m_sinA > -0.00005) return;
+  if (std::fabs(m_sinA * m_delta) < 1.0) 
+  {
+    //dot product ...
+    double cosA = (m_normals[k].X * m_normals[j].X + m_normals[j].Y * m_normals[k].Y ); 
+    if (cosA > 0) // angle => 0 degrees
+    {
+      m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[k].X * m_delta),
+        Round(m_srcPoly[j].Y + m_normals[k].Y * m_delta)));
+      return; 
+    }
+    //else angle => 180 degrees   
+  }
   else if (m_sinA > 1.0) m_sinA = 1.0;
   else if (m_sinA < -1.0) m_sinA = -1.0;
 
@@ -4204,7 +4033,7 @@ void ClipperOffset::DoRound(int j, int k)
 {
   double a = std::atan2(m_sinA,
   m_normals[k].X * m_normals[j].X + m_normals[k].Y * m_normals[j].Y);
-  int steps = (int)Round(m_StepsPerRad * std::fabs(a));
+  int steps = std::max((int)Round(m_StepsPerRad * std::fabs(a)), 1);
 
   double X = m_normals[k].X, Y = m_normals[k].Y, X2;
   for (int i = 0; i < steps; ++i)
@@ -4232,7 +4061,7 @@ void Clipper::DoSimplePolygons()
   {
     OutRec* outrec = m_PolyOuts[i++];
     OutPt* op = outrec->Pts;
-    if (!op) continue;
+    if (!op || outrec->IsOpen) continue;
     do //for each Pt in Polygon until duplicate found do ...
     {
       OutPt* op2 = op->Next;
@@ -4257,6 +4086,7 @@ void Clipper::DoSimplePolygons()
             //OutRec2 is contained by OutRec1 ...
             outrec2->IsHole = !outrec->IsHole;
             outrec2->FirstLeft = outrec;
+            if (m_UsingPolyTree) FixupFirstLefts2(outrec2, outrec);
           }
           else
             if (Poly2ContainsPoly1(outrec->Pts, outrec2->Pts))
@@ -4266,12 +4096,15 @@ void Clipper::DoSimplePolygons()
             outrec->IsHole = !outrec2->IsHole;
             outrec2->FirstLeft = outrec->FirstLeft;
             outrec->FirstLeft = outrec2;
-          } else
+            if (m_UsingPolyTree) FixupFirstLefts2(outrec, outrec2);
+            }
+            else
           {
             //the 2 polygons are separate ...
             outrec2->IsHole = outrec->IsHole;
             outrec2->FirstLeft = outrec->FirstLeft;
-          }
+            if (m_UsingPolyTree) FixupFirstLefts1(outrec, outrec2);
+            }
           op2 = op; //ie get ready for the Next iteration
         }
         op2 = op2->Next;
@@ -4348,7 +4181,27 @@ double DistanceFromLineSqrd(
 bool SlopesNearCollinear(const IntPoint& pt1, 
     const IntPoint& pt2, const IntPoint& pt3, double distSqrd)
 {
-  return DistanceFromLineSqrd(pt2, pt1, pt3) < distSqrd;
+  //this function is more accurate when the point that's geometrically
+  //between the other 2 points is the one that's tested for distance.
+  //ie makes it more likely to pick up 'spikes' ...
+	if (Abs(pt1.X - pt2.X) > Abs(pt1.Y - pt2.Y))
+	{
+    if ((pt1.X > pt2.X) == (pt1.X < pt3.X))
+      return DistanceFromLineSqrd(pt1, pt2, pt3) < distSqrd;
+    else if ((pt2.X > pt1.X) == (pt2.X < pt3.X))
+      return DistanceFromLineSqrd(pt2, pt1, pt3) < distSqrd;
+		else
+	    return DistanceFromLineSqrd(pt3, pt1, pt2) < distSqrd;
+	}
+	else
+	{
+    if ((pt1.Y > pt2.Y) == (pt1.Y < pt3.Y))
+      return DistanceFromLineSqrd(pt1, pt2, pt3) < distSqrd;
+    else if ((pt2.Y > pt1.Y) == (pt2.Y < pt3.Y))
+      return DistanceFromLineSqrd(pt2, pt1, pt3) < distSqrd;
+		else
+      return DistanceFromLineSqrd(pt3, pt1, pt2) < distSqrd;
+	}
 }
 //------------------------------------------------------------------------------
 
@@ -4476,8 +4329,8 @@ void Minkowski(const Path& poly, const Path& path,
       pp.push_back(p);
     }
 
-  Paths quads; 
-  quads.reserve((pathCnt + delta) * (polyCnt + 1));
+  solution.clear();
+  solution.reserve((pathCnt + delta) * (polyCnt + 1));
   for (size_t i = 0; i < pathCnt - 1 + delta; ++i)
     for (size_t j = 0; j < polyCnt; ++j)
     {
@@ -4488,23 +4341,30 @@ void Minkowski(const Path& poly, const Path& path,
       quad.push_back(pp[(i + 1) % pathCnt][(j + 1) % polyCnt]);
       quad.push_back(pp[i % pathCnt][(j + 1) % polyCnt]);
       if (!Orientation(quad)) ReversePath(quad);
-      quads.push_back(quad);
+      solution.push_back(quad);
     }
+}
+//------------------------------------------------------------------------------
 
+void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed)
+{
+  Minkowski(pattern, path, solution, true, pathIsClosed);
   Clipper c;
-  c.AddPaths(quads, ptSubject, true);
+  c.AddPaths(solution, ptSubject, true);
   c.Execute(ctUnion, solution, pftNonZero, pftNonZero);
 }
 //------------------------------------------------------------------------------
 
-void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed)
+void TranslatePath(const Path& input, Path& output, IntPoint delta) 
 {
-  Minkowski(pattern, path, solution, true, pathIsClosed);
+  //precondition: input != output
+  output.resize(input.size());
+  for (size_t i = 0; i < input.size(); ++i)
+    output[i] = IntPoint(input[i].X + delta.X, input[i].Y + delta.Y);
 }
 //------------------------------------------------------------------------------
 
-void MinkowskiSum(const Path& pattern, const Paths& paths, Paths& solution, 
-    PolyFillType pathFillType, bool pathIsClosed)
+void MinkowskiSum(const Path& pattern, const Paths& paths, Paths& solution, bool pathIsClosed)
 {
   Clipper c;
   for (size_t i = 0; i < paths.size(); ++i)
@@ -4512,21 +4372,29 @@ void MinkowskiSum(const Path& pattern, const Paths& paths, Paths& solution,
     Paths tmp;
     Minkowski(pattern, paths[i], tmp, true, pathIsClosed);
     c.AddPaths(tmp, ptSubject, true);
+    if (pathIsClosed)
+    {
+      Path tmp2;
+      TranslatePath(paths[i], tmp2, pattern[0]);
+      c.AddPath(tmp2, ptClip, true);
+    }
   }
-  if (pathIsClosed) c.AddPaths(paths, ptClip, true);
-  c.Execute(ctUnion, solution, pathFillType, pathFillType);
+    c.Execute(ctUnion, solution, pftNonZero, pftNonZero);
 }
 //------------------------------------------------------------------------------
 
 void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution)
 {
   Minkowski(poly1, poly2, solution, false, true);
+  Clipper c;
+  c.AddPaths(solution, ptSubject, true);
+  c.Execute(ctUnion, solution, pftNonZero, pftNonZero);
 }
 //------------------------------------------------------------------------------
 
 enum NodeType {ntAny, ntOpen, ntClosed};
 
-void AddPolyNodeToPolygons(const PolyNode& polynode, NodeType nodetype, Paths& paths)
+void AddPolyNodeToPaths(const PolyNode& polynode, NodeType nodetype, Paths& paths)
 {
   bool match = true;
   if (nodetype == ntClosed) match = !polynode.IsOpen();
@@ -4535,7 +4403,7 @@ void AddPolyNodeToPolygons(const PolyNode& polynode, NodeType nodetype, Paths& p
   if (!polynode.Contour.empty() && match)
     paths.push_back(polynode.Contour);
   for (int i = 0; i < polynode.ChildCount(); ++i)
-    AddPolyNodeToPolygons(*polynode.Childs[i], nodetype, paths);
+    AddPolyNodeToPaths(*polynode.Childs[i], nodetype, paths);
 }
 //------------------------------------------------------------------------------
 
@@ -4543,7 +4411,7 @@ void PolyTreeToPaths(const PolyTree& polytree, Paths& paths)
 {
   paths.resize(0); 
   paths.reserve(polytree.Total());
-  AddPolyNodeToPolygons(polytree, ntAny, paths);
+  AddPolyNodeToPaths(polytree, ntAny, paths);
 }
 //------------------------------------------------------------------------------
 
@@ -4551,7 +4419,7 @@ void ClosedPathsFromPolyTree(const PolyTree& polytree, Paths& paths)
 {
   paths.resize(0); 
   paths.reserve(polytree.Total());
-  AddPolyNodeToPolygons(polytree, ntClosed, paths);
+  AddPolyNodeToPaths(polytree, ntClosed, paths);
 }
 //------------------------------------------------------------------------------
 
@@ -4593,18 +4461,4 @@ std::ostream& operator <<(std::ostream &s, const Paths &p)
 }
 //------------------------------------------------------------------------------
 
-#ifdef use_deprecated
-
-void OffsetPaths(const Paths &in_polys, Paths &out_polys,
-  double delta, JoinType jointype, EndType_ endtype, double limit)
-{
-  ClipperOffset co(limit, limit);
-  co.AddPaths(in_polys, jointype, (EndType)endtype); 
-  co.Execute(out_polys, delta);
-}
-//------------------------------------------------------------------------------
-
-#endif
-
-
 } //ClipperLib namespace
diff --git a/src/saga_core/saga_api/clipper.hpp b/src/saga_core/saga_api/clipper.hpp
index 20791c7..6d84161 100755
--- a/src/saga_core/saga_api/clipper.hpp
+++ b/src/saga_core/saga_api/clipper.hpp
@@ -1,8 +1,8 @@
 /*******************************************************************************
 *                                                                              *
 * Author    :  Angus Johnson                                                   *
-* Version   :  6.1.3a                                                          *
-* Date      :  22 January 2014                                                 *
+* Version   :  6.2.1                                                           *
+* Date      :  31 October 2014                                                 *
 * Website   :  http://www.angusj.com                                           *
 * Copyright :  Angus Johnson 2010-2014                                         *
 *                                                                              *
@@ -34,7 +34,7 @@
 #ifndef clipper_hpp
 #define clipper_hpp
 
-#define CLIPPER_VERSION "6.1.3"
+#define CLIPPER_VERSION "6.2.0"
 
 //use_int32: When enabled 32bit ints are used instead of 64bit ints. This
 //improve performance but coordinate values are limited to the range +/- 46340
@@ -46,8 +46,7 @@
 //use_lines: Enables line clipping. Adds a very minor cost to performance.
 #define use_lines
   
-//use_deprecated: Enables support for the obsolete OffsetPaths() function
-//which has been replace with the ClipperOffset class.
+//use_deprecated: Enables temporary support for the obsolete functions
 //#define use_deprecated  
 
 #include <vector>
@@ -57,6 +56,7 @@
 #include <cstdlib>
 #include <ostream>
 #include <functional>
+#include <queue>
 
 namespace ClipperLib {
 
@@ -69,11 +69,16 @@ enum PolyType { ptSubject, ptClip };
 enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
 
 #ifdef use_int32
-typedef int cInt;
-typedef unsigned int cUInt;
+  typedef int cInt;
+  static cInt const loRange = 0x7FFF;
+  static cInt const hiRange = 0x7FFF;
 #else
-typedef signed long long cInt;
-typedef unsigned long long cUInt;
+  typedef signed long long cInt;
+  static cInt const loRange = 0x3FFFFFFF;
+  static cInt const hiRange = 0x3FFFFFFFFFFFFFFFLL;
+  typedef signed long long long64;     //used by Int128 class
+  typedef unsigned long long ulong64;
+
 #endif
 
 struct IntPoint {
@@ -117,15 +122,12 @@ struct DoublePoint
 //------------------------------------------------------------------------------
 
 #ifdef use_xyz
-typedef void (*TZFillCallback)(IntPoint& z1, IntPoint& z2, IntPoint& pt);
+typedef void (*ZFillCallback)(IntPoint& e1bot, IntPoint& e1top, IntPoint& e2bot, IntPoint& e2top, IntPoint& pt);
 #endif
 
 enum InitOptions {ioReverseSolution = 1, ioStrictlySimple = 2, ioPreserveCollinear = 4};
 enum JoinType {jtSquare, jtRound, jtMiter};
 enum EndType {etClosedPolygon, etClosedLine, etOpenButt, etOpenSquare, etOpenRound};
-#ifdef use_deprecated
-  enum EndType_ {etClosed, etButt = 2, etSquare, etRound};
-#endif
 
 class PolyNode;
 typedef std::vector< PolyNode* > PolyNodes;
@@ -134,6 +136,7 @@ class PolyNode
 { 
 public:
     PolyNode();
+    virtual ~PolyNode(){};
     Path Contour;
     PolyNodes Childs;
     PolyNode* Parent;
@@ -168,11 +171,6 @@ bool Orientation(const Path &poly);
 double Area(const Path &poly);
 int PointInPolygon(const IntPoint &pt, const Path &path);
 
-#ifdef use_deprecated
-  void OffsetPaths(const Paths &in_polys, Paths &out_polys,
-    double delta, JoinType jointype, EndType_ endtype, double limit = 0);
-#endif
-
 void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType = pftEvenOdd);
 void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType = pftEvenOdd);
 void SimplifyPolygons(Paths &polys, PolyFillType fillType = pftEvenOdd);
@@ -183,8 +181,7 @@ void CleanPolygons(const Paths& in_polys, Paths& out_polys, double distance = 1.
 void CleanPolygons(Paths& polys, double distance = 1.415);
 
 void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed);
-void MinkowskiSum(const Path& pattern, const Paths& paths, 
-  Paths& solution, PolyFillType pathFillType, bool pathIsClosed);
+void MinkowskiSum(const Path& pattern, const Paths& paths, Paths& solution, bool pathIsClosed);
 void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution);
 
 void PolyTreeToPaths(const PolyTree& polytree, Paths& paths);
@@ -202,7 +199,7 @@ enum EdgeSide { esLeft = 1, esRight = 2};
 //forward declarations (for stuff used internally) ...
 struct TEdge;
 struct IntersectNode;
-struct LocalMinima;
+struct LocalMinimum;
 struct Scanbeam;
 struct OutPt;
 struct OutRec;
@@ -213,7 +210,6 @@ typedef std::vector < TEdge* > EdgeList;
 typedef std::vector < Join* > JoinList;
 typedef std::vector < IntersectNode* > IntersectList;
 
-
 //------------------------------------------------------------------------------
 
 //ClipperBase is the ancestor to the Clipper class. It should not be
@@ -236,12 +232,14 @@ protected:
   void PopLocalMinima();
   virtual void Reset();
   TEdge* ProcessBound(TEdge* E, bool IsClockwise);
-  void InsertLocalMinima(LocalMinima *newLm);
   void DoMinimaLML(TEdge* E1, TEdge* E2, bool IsClosed);
   TEdge* DescendToMin(TEdge *&E);
   void AscendToMax(TEdge *&E, bool Appending, bool IsClosed);
-  LocalMinima      *m_CurrentLM;
-  LocalMinima      *m_MinimaList;
+
+  typedef std::vector<LocalMinimum> MinimaList;
+  MinimaList::iterator m_CurrentLM;
+  MinimaList           m_MinimaList;
+
   bool              m_UseFullRange;
   EdgeList          m_edges;
   bool             m_PreserveCollinear;
@@ -268,7 +266,7 @@ public:
   void StrictlySimple(bool value) {m_StrictSimple = value;};
   //set the callback function for z value filling on intersections (otherwise Z is 0)
 #ifdef use_xyz
-  void ZFillFunction(TZFillCallback zFillFunc);
+  void ZFillFunction(ZFillCallback zFillFunc);
 #endif
 protected:
   void Reset();
@@ -279,7 +277,8 @@ private:
   JoinList          m_GhostJoins;
   IntersectList     m_IntersectList;
   ClipType          m_ClipType;
-  std::set< cInt, std::greater<cInt> > m_Scanbeam;
+  typedef std::priority_queue<cInt> ScanbeamList;
+  ScanbeamList      m_Scanbeam;
   TEdge           *m_ActiveEdges;
   TEdge           *m_SortedEdges;
   bool             m_ExecuteLocked;
@@ -289,7 +288,7 @@ private:
   bool             m_UsingPolyTree; 
   bool             m_StrictSimple;
 #ifdef use_xyz
-  TZFillCallback   m_ZFill; //custom callback 
+  ZFillCallback   m_ZFill; //custom callback 
 #endif
   void SetWindingCount(TEdge& edge);
   bool IsEvenOddFillType(const TEdge& edge) const;
@@ -308,21 +307,19 @@ private:
   bool IsTopHorz(const cInt XPos);
   void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2);
   void DoMaxima(TEdge *e);
-  void PrepareHorzJoins(TEdge* horzEdge, bool isTopOfScanbeam);
   void ProcessHorizontals(bool IsTopOfScanbeam);
   void ProcessHorizontal(TEdge *horzEdge, bool isTopOfScanbeam);
   void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
   OutPt* AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
   OutRec* GetOutRec(int idx);
   void AppendPolygon(TEdge *e1, TEdge *e2);
-  void IntersectEdges(TEdge *e1, TEdge *e2,
-    const IntPoint &pt, bool protect = false);
+  void IntersectEdges(TEdge *e1, TEdge *e2, IntPoint &pt);
   OutRec* CreateOutRec();
   OutPt* AddOutPt(TEdge *e, const IntPoint &pt);
   void DisposeAllOutRecs();
   void DisposeOutRec(PolyOutList::size_type index);
-  bool ProcessIntersections(const cInt botY, const cInt topY);
-  void BuildIntersectList(const cInt botY, const cInt topY);
+  bool ProcessIntersections(const cInt topY);
+  void BuildIntersectList(const cInt topY);
   void ProcessIntersectList();
   void ProcessEdgesAtTopOfScanbeam(const cInt topY);
   void BuildResult(Paths& polys);
@@ -344,7 +341,7 @@ private:
   void FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec);
   void FixupFirstLefts2(OutRec* OldOutRec, OutRec* NewOutRec);
 #ifdef use_xyz
-  void SetZ(IntPoint& pt, TEdge& e);
+  void SetZ(IntPoint& pt, TEdge& e1, TEdge& e2);
 #endif
 };
 //------------------------------------------------------------------------------
diff --git a/src/saga_core/saga_api/compatibility.h b/src/saga_core/saga_api/compatibility.h
index b4011cf..2a24ab1 100755
--- a/src/saga_core/saga_api/compatibility.h
+++ b/src/saga_core/saga_api/compatibility.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: compatibility.h 1924 2014-01-09 12:12:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/data_manager.cpp b/src/saga_core/saga_api/data_manager.cpp
index 03ef02c..3238266 100755
--- a/src/saga_core/saga_api/data_manager.cpp
+++ b/src/saga_core/saga_api/data_manager.cpp
@@ -470,15 +470,17 @@ bool CSG_Data_Manager::Add(const CSG_String &File, TSG_Data_Object_Type Type)
 //---------------------------------------------------------
 bool CSG_Data_Manager::_Add_External(const CSG_String &File)
 {
+	if( !SG_File_Exists(File) )
+	{
+		return( false );
+	}
+
 	//-----------------------------------------------------
 	bool		bResult	= false;
 
 	CSG_Module	*pImport;
 
-	if( !SG_File_Exists(File) )
-	{
-		return( false );
-	}
+	SG_UI_Msg_Lock(true);
 
 	//-----------------------------------------------------
 	// Image Import
@@ -533,6 +535,8 @@ bool CSG_Data_Manager::_Add_External(const CSG_String &File)
 	}
 
 	//-----------------------------------------------------
+	SG_UI_Msg_Lock(false);
+
 	return( bResult );
 }
 
diff --git a/src/saga_core/saga_api/dataobject.cpp b/src/saga_core/saga_api/dataobject.cpp
index 40d8fb7..a270d3c 100755
--- a/src/saga_core/saga_api/dataobject.cpp
+++ b/src/saga_core/saga_api/dataobject.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dataobject.cpp 2558 2015-08-19 14:56:36Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -112,18 +112,29 @@ CSG_String	SG_Get_DataObject_Name(TSG_Data_Object_Type Type)
 //---------------------------------------------------------
 int		g_History_Depth	= -1;
 
-//---------------------------------------------------------
 void	SG_Set_History_Depth			(int Depth)
 {
 	g_History_Depth	= Depth;
 }
 
-//---------------------------------------------------------
 int		SG_Get_History_Depth			(void)
 {
 	return( g_History_Depth );
 }
 
+//---------------------------------------------------------
+int		g_History_Ignore_Lists	= true;
+
+void	SG_Set_History_Ignore_Lists		(int Ignore)
+{
+	g_History_Ignore_Lists	= Ignore != 0;
+}
+
+int		SG_Get_History_Ignore_Lists		(void)
+{
+	return( g_History_Ignore_Lists );
+}
+
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/saga_core/saga_api/dataobject.h b/src/saga_core/saga_api/dataobject.h
index 2bf2ec1..df856c6 100755
--- a/src/saga_core/saga_api/dataobject.h
+++ b/src/saga_core/saga_api/dataobject.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dataobject.h 2565 2015-09-01 13:34:02Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -154,6 +154,8 @@ SAGA_API_DLL_EXPORT CSG_String	SG_Get_DataObject_Name			(TSG_Data_Object_Type Ty
 //---------------------------------------------------------
 SAGA_API_DLL_EXPORT void		SG_Set_History_Depth			(int Depth);
 SAGA_API_DLL_EXPORT int			SG_Get_History_Depth			(void);
+SAGA_API_DLL_EXPORT void		SG_Set_History_Ignore_Lists		(int Ignore);
+SAGA_API_DLL_EXPORT int			SG_Get_History_Ignore_Lists		(void);
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/geo_classes.cpp b/src/saga_core/saga_api/geo_classes.cpp
index e094e91..fee9b6c 100755
--- a/src/saga_core/saga_api/geo_classes.cpp
+++ b/src/saga_core/saga_api/geo_classes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: geo_classes.cpp 2190 2014-08-12 14:26:06Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/geo_functions.cpp b/src/saga_core/saga_api/geo_functions.cpp
index 091e814..6e48a8e 100755
--- a/src/saga_core/saga_api/geo_functions.cpp
+++ b/src/saga_core/saga_api/geo_functions.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: geo_functions.cpp 2190 2014-08-12 14:26:06Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/geo_tools.h b/src/saga_core/saga_api/geo_tools.h
index 82682fb..24f3f3a 100755
--- a/src/saga_core/saga_api/geo_tools.h
+++ b/src/saga_core/saga_api/geo_tools.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: geo_tools.h 2380 2015-01-29 16:51:02Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/grid.cpp b/src/saga_core/saga_api/grid.cpp
index 80c9e00..9ef80dc 100755
--- a/src/saga_core/saga_api/grid.cpp
+++ b/src/saga_core/saga_api/grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid.cpp 2826 2016-02-25 11:30:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/grid.h b/src/saga_core/saga_api/grid.h
index 0d80771..2f72633 100755
--- a/src/saga_core/saga_api/grid.h
+++ b/src/saga_core/saga_api/grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid.h 2776 2016-02-09 15:35:13Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/grid_io.cpp b/src/saga_core/saga_api/grid_io.cpp
index 39b89b3..6f61640 100755
--- a/src/saga_core/saga_api/grid_io.cpp
+++ b/src/saga_core/saga_api/grid_io.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_io.cpp 2728 2015-12-14 08:52:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/grid_memory.cpp b/src/saga_core/saga_api/grid_memory.cpp
index fa4b2ea..0c62b64 100755
--- a/src/saga_core/saga_api/grid_memory.cpp
+++ b/src/saga_core/saga_api/grid_memory.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_memory.cpp 2593 2015-09-23 07:34:34Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/grid_operation.cpp b/src/saga_core/saga_api/grid_operation.cpp
index 6c8d514..75c6745 100755
--- a/src/saga_core/saga_api/grid_operation.cpp
+++ b/src/saga_core/saga_api/grid_operation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_operation.cpp 2883 2016-04-08 15:17:32Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/grid_pyramid.cpp b/src/saga_core/saga_api/grid_pyramid.cpp
index 2be5072..8ac6539 100755
--- a/src/saga_core/saga_api/grid_pyramid.cpp
+++ b/src/saga_core/saga_api/grid_pyramid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_pyramid.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/grid_pyramid.h b/src/saga_core/saga_api/grid_pyramid.h
index 563de14..dca84e0 100755
--- a/src/saga_core/saga_api/grid_pyramid.h
+++ b/src/saga_core/saga_api/grid_pyramid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_pyramid.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/grid_system.cpp b/src/saga_core/saga_api/grid_system.cpp
index f169c1d..55adf4e 100755
--- a/src/saga_core/saga_api/grid_system.cpp
+++ b/src/saga_core/saga_api/grid_system.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_system.cpp 2677 2015-11-05 08:59:28Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_formula.cpp b/src/saga_core/saga_api/mat_formula.cpp
index ee9f293..83dbea4 100755
--- a/src/saga_core/saga_api/mat_formula.cpp
+++ b/src/saga_core/saga_api/mat_formula.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_formula.cpp 2887 2016-04-11 11:49:04Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_grid_radius.cpp b/src/saga_core/saga_api/mat_grid_radius.cpp
index 9f0a6ab..5c80997 100755
--- a/src/saga_core/saga_api/mat_grid_radius.cpp
+++ b/src/saga_core/saga_api/mat_grid_radius.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_grid_radius.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_indexing.cpp b/src/saga_core/saga_api/mat_indexing.cpp
index e86dbc2..b4e11fe 100755
--- a/src/saga_core/saga_api/mat_indexing.cpp
+++ b/src/saga_core/saga_api/mat_indexing.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_indexing.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_matrix.cpp b/src/saga_core/saga_api/mat_matrix.cpp
index e865ce8..3297a20 100755
--- a/src/saga_core/saga_api/mat_matrix.cpp
+++ b/src/saga_core/saga_api/mat_matrix.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_matrix.cpp 2456 2015-03-23 11:27:09Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_regression.cpp b/src/saga_core/saga_api/mat_regression.cpp
index d13e367..4f6e898 100755
--- a/src/saga_core/saga_api/mat_regression.cpp
+++ b/src/saga_core/saga_api/mat_regression.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_regression.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_regression_multiple.cpp b/src/saga_core/saga_api/mat_regression_multiple.cpp
index f2cf103..beac1ca 100755
--- a/src/saga_core/saga_api/mat_regression_multiple.cpp
+++ b/src/saga_core/saga_api/mat_regression_multiple.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_regression_multiple.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_spline.cpp b/src/saga_core/saga_api/mat_spline.cpp
index 1464e39..dd872a8 100755
--- a/src/saga_core/saga_api/mat_spline.cpp
+++ b/src/saga_core/saga_api/mat_spline.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_spline.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_tools.cpp b/src/saga_core/saga_api/mat_tools.cpp
index e501064..3800104 100755
--- a/src/saga_core/saga_api/mat_tools.cpp
+++ b/src/saga_core/saga_api/mat_tools.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_tools.cpp 2595 2015-09-23 12:32:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_tools.h b/src/saga_core/saga_api/mat_tools.h
index 0a2090c..f4ed0ee 100755
--- a/src/saga_core/saga_api/mat_tools.h
+++ b/src/saga_core/saga_api/mat_tools.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_tools.h 2779 2016-02-10 16:06:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_trend.cpp b/src/saga_core/saga_api/mat_trend.cpp
index aa8a604..5f00df4 100755
--- a/src/saga_core/saga_api/mat_trend.cpp
+++ b/src/saga_core/saga_api/mat_trend.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_trend.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/metadata.cpp b/src/saga_core/saga_api/metadata.cpp
index 74b8ff7..030be0c 100755
--- a/src/saga_core/saga_api/metadata.cpp
+++ b/src/saga_core/saga_api/metadata.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: metadata.cpp 2777 2016-02-10 15:04:57Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/metadata.h b/src/saga_core/saga_api/metadata.h
index e5b3320..905a668 100755
--- a/src/saga_core/saga_api/metadata.h
+++ b/src/saga_core/saga_api/metadata.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: metadata.h 2777 2016-02-10 15:04:57Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module.cpp b/src/saga_core/saga_api/module.cpp
index c706237..e0057a5 100755
--- a/src/saga_core/saga_api/module.cpp
+++ b/src/saga_core/saga_api/module.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module.cpp 2774 2016-02-05 15:38:35Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module.h b/src/saga_core/saga_api/module.h
index 671084e..48387de 100755
--- a/src/saga_core/saga_api/module.h
+++ b/src/saga_core/saga_api/module.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module.h 2412 2015-02-17 22:18:08Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module_chain.cpp b/src/saga_core/saga_api/module_chain.cpp
index 6fd984f..a80ea3e 100755
--- a/src/saga_core/saga_api/module_chain.cpp
+++ b/src/saga_core/saga_api/module_chain.cpp
@@ -248,7 +248,7 @@ bool CSG_Module_Chain::Create(const CSG_String &File)
 
 		case PARAMETER_TYPE_Date             : Parameters.Add_Date           (pParent, ID, Name, Desc, 0.0)->Set_Value(Value);	break;
 
-		case PARAMETER_TYPE_Range            : Parameters.Add_Range          (pParent, ID, Name, Desc, Value.BeforeFirst(';').asDouble(), Value.AfterFirst (';').asDouble(), Min, bMin, Max, bMax);	break;
+		case PARAMETER_TYPE_Range            : Parameters.Add_Range          (pParent, ID, Name, Desc, Value.BeforeFirst(';').asDouble(), Value.AfterFirst(';').asDouble(), Min, bMin, Max, bMax);	break;
 		case PARAMETER_TYPE_Choice           : Parameters.Add_Choice         (pParent, ID, Name, Desc, Parameter.Get_Content("choices"))->Set_Value(Value);	break;
 
 		case PARAMETER_TYPE_String           : Parameters.Add_String         (pParent, ID, Name, Desc, Value, false);	break;
@@ -387,7 +387,7 @@ bool CSG_Module_Chain::Data_Add(const CSG_String &ID, CSG_Parameter *pData)
 		return( true );
 
 	default:
-		return( false );
+		return( true );
 	}
 
 	pParameter->Assign(pData);
@@ -439,19 +439,20 @@ bool CSG_Module_Chain::Data_Initialize(void)
 {
 	m_Data.Set_Manager(NULL);
 
-	bool	bResult	= false;
-
 	for(int i=0; i<Parameters.Get_Count(); i++)
 	{
 		CSG_Parameter	*pParameter	= Parameters(i);
 
-		if( !(pParameter->is_DataObject() && !pParameter->asDataObject()) && Data_Add(pParameter->Get_Identifier(), pParameter) )
+		if( !(pParameter->is_DataObject() && !pParameter->asDataObject()) )
 		{
-			bResult	= true;
+			if( !Data_Add(pParameter->Get_Identifier(), pParameter) )
+			{
+				return( false );
+			}
 		}
 	}
 
-	return( bResult );
+	return( true );
 }
 
 //---------------------------------------------------------
@@ -723,6 +724,8 @@ bool CSG_Module_Chain::Tool_Run(const CSG_MetaData &Tool)
 		Error_Fmt("%s [%s].[%s]", _TL("tool execution failed"             ), pModule->Get_Library().c_str(), pModule->Get_Name().c_str());
 	}
 
+	pModule->On_After_Execution();
+
 	Tool_Finalize(Tool, pModule);
 
 	pModule->Settings_Pop();
diff --git a/src/saga_core/saga_api/module_grid.cpp b/src/saga_core/saga_api/module_grid.cpp
index c4ef4b5..fbba070 100755
--- a/src/saga_core/saga_api/module_grid.cpp
+++ b/src/saga_core/saga_api/module_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_grid.cpp 2759 2016-01-22 13:56:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module_grid_interactive.cpp b/src/saga_core/saga_api/module_grid_interactive.cpp
index e08e7f8..138a9e6 100755
--- a/src/saga_core/saga_api/module_grid_interactive.cpp
+++ b/src/saga_core/saga_api/module_grid_interactive.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_grid_interactive.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module_interactive.cpp b/src/saga_core/saga_api/module_interactive.cpp
index 1457240..62a17c1 100755
--- a/src/saga_core/saga_api/module_interactive.cpp
+++ b/src/saga_core/saga_api/module_interactive.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_interactive.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module_interactive_base.cpp b/src/saga_core/saga_api/module_interactive_base.cpp
index ad58d59..1f64226 100755
--- a/src/saga_core/saga_api/module_interactive_base.cpp
+++ b/src/saga_core/saga_api/module_interactive_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_interactive_base.cpp 2262 2014-09-30 15:23:50Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module_library.cpp b/src/saga_core/saga_api/module_library.cpp
index d92a6ab..b57cfe8 100755
--- a/src/saga_core/saga_api/module_library.cpp
+++ b/src/saga_core/saga_api/module_library.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library.cpp 2810 2016-02-22 11:43:34Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module_library.h b/src/saga_core/saga_api/module_library.h
index 0261a1a..6be512e 100755
--- a/src/saga_core/saga_api/module_library.h
+++ b/src/saga_core/saga_api/module_library.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library.h 2680 2015-11-06 12:27:37Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/module_library_interface.cpp b/src/saga_core/saga_api/module_library_interface.cpp
index 28746e7..97e5aae 100755
--- a/src/saga_core/saga_api/module_library_interface.cpp
+++ b/src/saga_core/saga_api/module_library_interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library_interface.cpp 2378 2015-01-28 19:26:13Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/parameter.cpp b/src/saga_core/saga_api/parameter.cpp
index 5077c07..9bce791 100755
--- a/src/saga_core/saga_api/parameter.cpp
+++ b/src/saga_core/saga_api/parameter.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameter.cpp 2872 2016-03-30 16:28:26Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -571,18 +571,31 @@ const SG_Char * CSG_Parameter::Get_Identifier(void)	const
 }
 
 //---------------------------------------------------------
+bool CSG_Parameter::Set_Name(const CSG_String &Name)
+{
+	m_Name	= Name;
+
+	return( true );
+}
+
 const SG_Char * CSG_Parameter::Get_Name(void)	const
 {
 	return( m_Name );
 }
 
 //---------------------------------------------------------
+bool CSG_Parameter::Set_Description(const CSG_String &Description)
+{
+	m_Description	= Description;
+
+	return( true );
+}
+
 const SG_Char * CSG_Parameter::Get_Description(void)	const
 {
 	return( m_Description );
 }
 
-
 //---------------------------------------------------------
 CSG_String CSG_Parameter::Get_Description(int Flags)	const
 {
diff --git a/src/saga_core/saga_api/parameter_data.cpp b/src/saga_core/saga_api/parameter_data.cpp
index 32c40a1..95ef158 100755
--- a/src/saga_core/saga_api/parameter_data.cpp
+++ b/src/saga_core/saga_api/parameter_data.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameter_data.cpp 2872 2016-03-30 16:28:26Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -814,13 +814,13 @@ CSG_Parameter_Range::CSG_Parameter_Range(CSG_Parameter *pOwner, long Constraint)
 
 	if( (m_Constraint & PARAMETER_INFORMATION) != 0 )
 	{
-		m_pLo	= m_pRange->Add_Info_Value(m_pOwner, SG_T("MIN"), SG_T("Minimum"), m_pOwner->Get_Description(), PARAMETER_TYPE_Double);
-		m_pHi	= m_pRange->Add_Info_Value(m_pOwner, SG_T("MAX"), SG_T("Maximum"), m_pOwner->Get_Description(), PARAMETER_TYPE_Double);
+		m_pLo	= m_pRange->Add_Info_Value(m_pOwner, "MIN", "Minimum", m_pOwner->Get_Description(), PARAMETER_TYPE_Double);
+		m_pHi	= m_pRange->Add_Info_Value(m_pOwner, "MAX", "Maximum", m_pOwner->Get_Description(), PARAMETER_TYPE_Double);
 	}
 	else
 	{
-		m_pLo	= m_pRange->Add_Value     (m_pOwner, SG_T("MIN"), SG_T("Minimum"), m_pOwner->Get_Description(), PARAMETER_TYPE_Double);
-		m_pHi	= m_pRange->Add_Value     (m_pOwner, SG_T("MAX"), SG_T("Maximum"), m_pOwner->Get_Description(), PARAMETER_TYPE_Double);
+		m_pLo	= m_pRange->Add_Value     (m_pOwner, "MIN", "Minimum", m_pOwner->Get_Description(), PARAMETER_TYPE_Double);
+		m_pHi	= m_pRange->Add_Value     (m_pOwner, "MAX", "Maximum", m_pOwner->Get_Description(), PARAMETER_TYPE_Double);
 	}
 }
 
@@ -832,12 +832,18 @@ CSG_Parameter_Range::~CSG_Parameter_Range(void)
 //---------------------------------------------------------
 const SG_Char * CSG_Parameter_Range::asString(void)
 {
-	m_String.Printf(SG_T("[%f] - [%f]"), Get_LoVal(), Get_HiVal());
+	m_String.Printf("%f; %f", Get_LoVal(), Get_HiVal());
 
 	return( m_String );
 }
 
 //---------------------------------------------------------
+bool CSG_Parameter_Range::Set_Value(const CSG_String &Value)
+{
+	return( Set_Range(Value.BeforeFirst(';').asDouble(), Value.AfterFirst(';').asDouble()) );
+}
+
+//---------------------------------------------------------
 bool CSG_Parameter_Range::Set_Range(double loVal, double hiVal)
 {
 	bool	bResult;
@@ -2617,9 +2623,11 @@ bool CSG_Parameter_List::On_Serialize(CSG_MetaData &Entry, bool bSave)
 	}
 	else
 	{
+		Del_Items();
+
 		for(int i=0; i<Entry.Get_Children_Count(); i++)
 		{
-			CSG_Data_Object	*pObject	= m_pOwner->Get_Manager() ? m_pOwner->Get_Manager()->Find(Entry.Get_Content()) : NULL;
+			CSG_Data_Object	*pObject	= m_pOwner->Get_Manager() ? m_pOwner->Get_Manager()->Find(Entry.Get_Content(i), false) : NULL;
 
 			if( pObject )
 			{
diff --git a/src/saga_core/saga_api/parameters.cpp b/src/saga_core/saga_api/parameters.cpp
index 794d1ca..2705a65 100755
--- a/src/saga_core/saga_api/parameters.cpp
+++ b/src/saga_core/saga_api/parameters.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters.cpp 2872 2016-03-30 16:28:26Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -1429,7 +1429,10 @@ bool CSG_Parameters::DataObjects_Synchronize(void)
 		//-------------------------------------------------
 		else
 		{
-			if( p->Get_Type() == PARAMETER_TYPE_Shapes && p->asShapes() && p->asShapes()->Get_Type() == SHAPE_TYPE_Undefined )
+			if( p->Get_Type() == PARAMETER_TYPE_Shapes
+			&&  p->asShapes() != DATAOBJECT_NOTSET
+			&&  p->asShapes() != DATAOBJECT_CREATE
+			&&  p->asShapes()->Get_Type() == SHAPE_TYPE_Undefined )
 			{
 				if( m_pManager && !m_pManager->Delete(p->asShapes()) )
 				{
@@ -1442,7 +1445,9 @@ bool CSG_Parameters::DataObjects_Synchronize(void)
 			//---------------------------------------------
 			if( p->is_Output() )
 			{
-				if( p->is_DataObject() && p->asDataObject() )
+				if( p->is_DataObject()
+				&&  p->asDataObject() != DATAOBJECT_NOTSET
+				&&  p->asDataObject() != DATAOBJECT_CREATE )
 				{
 					CSG_Data_Object	*pObject	= p->asDataObject();
 
@@ -1506,7 +1511,9 @@ bool CSG_Parameters::DataObjects_Get_Projection(CSG_Projection &Projection)	cons
 			}
 			else if( p->is_Input() )
 			{
-				if( p->is_DataObject() && p->asDataObject() )
+				if( p->is_DataObject()
+				&&  p->asDataObject() != DATAOBJECT_NOTSET
+				&&  p->asDataObject() != DATAOBJECT_CREATE )
 				{
 					P	= p->asDataObject()->Get_Projection();
 
@@ -1563,7 +1570,9 @@ bool CSG_Parameters::DataObjects_Set_Projection(const CSG_Projection &Projection
 			}
 			else if( p->is_Output() )
 			{
-				if( p->is_DataObject() && p->asDataObject() )
+				if( p->is_DataObject()
+				&&  p->asDataObject() != DATAOBJECT_NOTSET
+				&&  p->asDataObject() != DATAOBJECT_CREATE )
 				{
 					p->asDataObject()->Get_Projection()	= Projection;
 				}
@@ -1619,9 +1628,9 @@ bool CSG_Parameters::Msg_String(bool bOptionsOnly)
 
 	if( Get_String(s, bOptionsOnly) )
 	{
-		SG_UI_Msg_Add_Execution(SG_T("\n"), false);
+		SG_UI_Msg_Add_Execution("\n", false);
 		SG_UI_Msg_Add_Execution(bOptionsOnly ? _TL("Options") : _TL("Parameters"), false);
-		SG_UI_Msg_Add_Execution(SG_T("\n"), false);
+		SG_UI_Msg_Add_Execution("\n", false);
 		SG_UI_Msg_Add_Execution(s, false, SG_UI_MSG_STYLE_01);
 
 		return( true );
@@ -1716,9 +1725,11 @@ bool CSG_Parameters::Set_History(CSG_MetaData &MetaData, bool bOptions, bool bDa
 					{
 						pObject	= p->asList()->asDataObject(j);
 
-						pEntry	= pList->Add_Child(*pList, false); pEntry->Set_Name("INPUT");
+						pEntry	= pList->Add_Child(*pList, false);
 
-						if( pObject->Get_History().Get_Children_Count() > 0 )
+						pEntry->Set_Name(pObject->Get_Name());
+						
+						if( !SG_Get_History_Ignore_Lists() && pObject->Get_History().Get_Children_Count() > 0 )
 						{
 							pEntry->Add_Children(pObject->Get_History());
 						}
diff --git a/src/saga_core/saga_api/parameters.h b/src/saga_core/saga_api/parameters.h
index d592d34..d5cfbd3 100755
--- a/src/saga_core/saga_api/parameters.h
+++ b/src/saga_core/saga_api/parameters.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters.h 2872 2016-03-30 16:28:26Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -488,6 +488,8 @@ public:
 
 	virtual TSG_Parameter_Type	Get_Type				(void)	const	{	return( PARAMETER_TYPE_Range );		}
 
+	virtual bool				Set_Value				(const CSG_String &Value);
+
 	virtual const SG_Char *		asString				(void);
 
 	bool						Set_Range				(double loVal, double hiVal);
@@ -1290,8 +1292,10 @@ public:
 	class CSG_Data_Manager *	Get_Manager				(void)	const;
 
 	const SG_Char *				Get_Identifier			(void)	const;
+	bool						Set_Name				(const CSG_String &Name);
 	const SG_Char *				Get_Name				(void)	const;
 	const SG_Char *				Get_Description			(void)	const;
+	bool						Set_Description			(const CSG_String &Description);
 	CSG_String					Get_Description			(int Flags)								const;
 	CSG_String					Get_Description			(int Flags, const SG_Char *Separator)	const;
 
diff --git a/src/saga_core/saga_api/pointcloud.cpp b/src/saga_core/saga_api/pointcloud.cpp
index 4983040..3ee3efe 100755
--- a/src/saga_core/saga_api/pointcloud.cpp
+++ b/src/saga_core/saga_api/pointcloud.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pointcloud.cpp 2700 2015-11-24 17:18:29Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/pointcloud.h b/src/saga_core/saga_api/pointcloud.h
index cb4de04..f861481 100755
--- a/src/saga_core/saga_api/pointcloud.h
+++ b/src/saga_core/saga_api/pointcloud.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pointcloud.h 2700 2015-11-24 17:18:29Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -156,6 +156,10 @@ public:
 	virtual bool					Get_Value			(            int iField, CSG_String    &Value)	const	{	return( _Get_Field_Value(m_Cursor, iField, Value) );	}
 	virtual bool					Set_Value			(int iPoint, int iField, const SG_Char *Value)			{	return( _Set_Field_Value(iPoint >= 0 && iPoint < m_nRecords ? m_Points[iPoint] : NULL, iField, Value) );	}
 	virtual bool					Get_Value			(int iPoint, int iField, CSG_String    &Value)	const	{	return( _Get_Field_Value(iPoint >= 0 && iPoint < m_nRecords ? m_Points[iPoint] : NULL, iField, Value) );	}
+	virtual bool					Set_Attribute		(            int iField, const SG_Char *Value)			{	return( Set_Value(iField + 3, Value) );			}
+	virtual bool					Get_Attribute		(            int iField, CSG_String    &Value)	const	{	return( Get_Value(iField + 3, Value) );			}
+	virtual bool					Set_Attribute		(int iPoint, int iField, const SG_Char *Value)			{	return( Set_Value(iPoint, iField + 3, Value) );	}
+	virtual bool					Get_Attribute		(int iPoint, int iField, CSG_String    &Value)	const	{	return( Get_Value(iPoint, iField + 3, Value) );	}
 
 	TSG_Point_Z						Get_Point			(void)			const;
 	TSG_Point_Z						Get_Point			(int iPoint)	const;
diff --git a/src/saga_core/saga_api/projections.cpp b/src/saga_core/saga_api/projections.cpp
index 7da0228..d84d386 100755
--- a/src/saga_core/saga_api/projections.cpp
+++ b/src/saga_core/saga_api/projections.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: projections.cpp 2714 2015-12-04 11:51:33Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/quadtree.cpp b/src/saga_core/saga_api/quadtree.cpp
index 6b3a73f..bc289cf 100755
--- a/src/saga_core/saga_api/quadtree.cpp
+++ b/src/saga_core/saga_api/quadtree.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: quadtree.cpp 2593 2015-09-23 07:34:34Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/saga_api.cpp b/src/saga_core/saga_api/saga_api.cpp
index 9ecae39..7a56309 100755
--- a/src/saga_core/saga_api/saga_api.cpp
+++ b/src/saga_core/saga_api/saga_api.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_api.cpp 2283 2014-10-10 09:59:30Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/saga_api.h b/src/saga_core/saga_api/saga_api.h
index cdc1e44..829af6c 100755
--- a/src/saga_core/saga_api/saga_api.h
+++ b/src/saga_core/saga_api/saga_api.h
@@ -127,9 +127,9 @@
 
 //---------------------------------------------------------
 #define SAGA_MAJOR_VERSION		2
-#define SAGA_MINOR_VERSION		2
-#define SAGA_RELEASE_NUMBER		7
-#define SAGA_VERSION			SG_T("2.2.7")
+#define SAGA_MINOR_VERSION		3
+#define SAGA_RELEASE_NUMBER		0
+#define SAGA_VERSION			SG_T("2.3.0")
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shape.cpp b/src/saga_core/saga_api/shape.cpp
index 82304fa..88a7adb 100755
--- a/src/saga_core/saga_api/shape.cpp
+++ b/src/saga_core/saga_api/shape.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape.cpp 2181 2014-07-09 16:56:37Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shape_line.cpp b/src/saga_core/saga_api/shape_line.cpp
index 3481c00..c07343a 100755
--- a/src/saga_core/saga_api/shape_line.cpp
+++ b/src/saga_core/saga_api/shape_line.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape_line.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shape_part.cpp b/src/saga_core/saga_api/shape_part.cpp
index fbdf950..1be97ef 100755
--- a/src/saga_core/saga_api/shape_part.cpp
+++ b/src/saga_core/saga_api/shape_part.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape_part.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shape_point.cpp b/src/saga_core/saga_api/shape_point.cpp
index c66f343..6c1a073 100755
--- a/src/saga_core/saga_api/shape_point.cpp
+++ b/src/saga_core/saga_api/shape_point.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape_point.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shape_points.cpp b/src/saga_core/saga_api/shape_points.cpp
index 04895de..4f9b807 100755
--- a/src/saga_core/saga_api/shape_points.cpp
+++ b/src/saga_core/saga_api/shape_points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape_points.cpp 2486 2015-05-06 12:02:12Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shape_polygon.cpp b/src/saga_core/saga_api/shape_polygon.cpp
index 9bb9cf3..9b7abb1 100755
--- a/src/saga_core/saga_api/shape_polygon.cpp
+++ b/src/saga_core/saga_api/shape_polygon.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shape_polygon.cpp 2288 2014-10-15 16:08:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shapes.cpp b/src/saga_core/saga_api/shapes.cpp
index 730ca1e..e9d39f1 100755
--- a/src/saga_core/saga_api/shapes.cpp
+++ b/src/saga_core/saga_api/shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes.cpp 2751 2016-01-15 15:22:53Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shapes.h b/src/saga_core/saga_api/shapes.h
index ae8535a..ce51e3d 100755
--- a/src/saga_core/saga_api/shapes.h
+++ b/src/saga_core/saga_api/shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes.h 2475 2015-04-22 18:39:29Z oconrad $
+ * Version $Id$
  *********************************************************/
 ///////////////////////////////////////////////////////////
 //                                                       //
diff --git a/src/saga_core/saga_api/shapes_io.cpp b/src/saga_core/saga_api/shapes_io.cpp
index 0059acb..e337471 100755
--- a/src/saga_core/saga_api/shapes_io.cpp
+++ b/src/saga_core/saga_api/shapes_io.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_io.cpp 2769 2016-02-03 09:56:16Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shapes_ogis.cpp b/src/saga_core/saga_api/shapes_ogis.cpp
index 0d3b4c6..8776b48 100755
--- a/src/saga_core/saga_api/shapes_ogis.cpp
+++ b/src/saga_core/saga_api/shapes_ogis.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_ogis.cpp 2182 2014-07-10 07:59:03Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shapes_search.cpp b/src/saga_core/saga_api/shapes_search.cpp
index 036a0e7..1f74497 100755
--- a/src/saga_core/saga_api/shapes_search.cpp
+++ b/src/saga_core/saga_api/shapes_search.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_search.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shapes_selection.cpp b/src/saga_core/saga_api/shapes_selection.cpp
index 52174c3..d8ac101 100755
--- a/src/saga_core/saga_api/shapes_selection.cpp
+++ b/src/saga_core/saga_api/shapes_selection.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes_selection.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/table.cpp b/src/saga_core/saga_api/table.cpp
index cb18d5e..76a1d8d 100755
--- a/src/saga_core/saga_api/table.cpp
+++ b/src/saga_core/saga_api/table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table.cpp 2751 2016-01-15 15:22:53Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -1118,7 +1118,7 @@ bool CSG_Table::Set_Index(int Field_1, TSG_Table_Index_Order Order_1, int Field_
 
 			if( pRecord && pRecord->is_Selected() )
 			{
-				_Set_Selection(n++, pRecord->Get_Index());
+				_Set_Selection(pRecord->Get_Index(), n++);
 			}
 		}
 	}
diff --git a/src/saga_core/saga_api/table.h b/src/saga_core/saga_api/table.h
index d296243..f834a53 100755
--- a/src/saga_core/saga_api/table.h
+++ b/src/saga_core/saga_api/table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table.h 2713 2015-12-04 11:50:53Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/table_dbase.cpp b/src/saga_core/saga_api/table_dbase.cpp
index 63a29cb..b8c4183 100755
--- a/src/saga_core/saga_api/table_dbase.cpp
+++ b/src/saga_core/saga_api/table_dbase.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_dbase.cpp 2769 2016-02-03 09:56:16Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/table_dbase.h b/src/saga_core/saga_api/table_dbase.h
index b7d496d..57c9cde 100755
--- a/src/saga_core/saga_api/table_dbase.h
+++ b/src/saga_core/saga_api/table_dbase.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_dbase.h 2769 2016-02-03 09:56:16Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/table_io.cpp b/src/saga_core/saga_api/table_io.cpp
index 167e924..54221c6 100755
--- a/src/saga_core/saga_api/table_io.cpp
+++ b/src/saga_core/saga_api/table_io.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_io.cpp 2766 2016-01-28 15:41:28Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/table_record.cpp b/src/saga_core/saga_api/table_record.cpp
index db23590..45a2475 100755
--- a/src/saga_core/saga_api/table_record.cpp
+++ b/src/saga_core/saga_api/table_record.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_record.cpp 2431 2015-03-03 17:21:59Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/table_selection.cpp b/src/saga_core/saga_api/table_selection.cpp
index 4461126..956b518 100755
--- a/src/saga_core/saga_api/table_selection.cpp
+++ b/src/saga_core/saga_api/table_selection.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_selection.cpp 2700 2015-11-24 17:18:29Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -131,14 +131,9 @@ bool CSG_Table::_Destroy_Selection(void)
 {
 	if( Get_Selection_Count() > 0 )
 	{
-		for(size_t iRecord=0; iRecord<Get_Selection_Count(); iRecord++)
+		for(size_t iRecord=0; iRecord<m_nRecords; iRecord++)
 		{
-			CSG_Table_Record	*pRecord	= Get_Selection(iRecord);
-
-			if( pRecord )
-			{
-				pRecord->Set_Selected(false);
-			}
+			m_Records[iRecord]->Set_Selected(false);
 		}
 
 		m_Selection.Set_Array(0);
diff --git a/src/saga_core/saga_api/table_value.h b/src/saga_core/saga_api/table_value.h
index 068203f..9e04c36 100755
--- a/src/saga_core/saga_api/table_value.h
+++ b/src/saga_core/saga_api/table_value.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_value.h 2431 2015-03-03 17:21:59Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/tin.cpp b/src/saga_core/saga_api/tin.cpp
index 602b91c..4a4d444 100755
--- a/src/saga_core/saga_api/tin.cpp
+++ b/src/saga_core/saga_api/tin.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: tin.cpp 2558 2015-08-19 14:56:36Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/tin.h b/src/saga_core/saga_api/tin.h
index a2e0f85..193d671 100755
--- a/src/saga_core/saga_api/tin.h
+++ b/src/saga_core/saga_api/tin.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: tin.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/tin_elements.cpp b/src/saga_core/saga_api/tin_elements.cpp
index edb10e5..226a2ae 100755
--- a/src/saga_core/saga_api/tin_elements.cpp
+++ b/src/saga_core/saga_api/tin_elements.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: tin_elements.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/tin_triangulation.cpp b/src/saga_core/saga_api/tin_triangulation.cpp
index 77c4e12..db96fe8 100755
--- a/src/saga_core/saga_api/tin_triangulation.cpp
+++ b/src/saga_core/saga_api/tin_triangulation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: tin_triangulation.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_cmd/Makefile.am b/src/saga_core/saga_cmd/Makefile.am
index 9e36715..eee95dc 100755
--- a/src/saga_core/saga_cmd/Makefile.am
+++ b/src/saga_core/saga_cmd/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2857 2016-03-23 14:22:48Z oconrad $
+# $Id$
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
diff --git a/src/saga_core/saga_cmd/Makefile.in b/src/saga_core/saga_cmd/Makefile.in
index aa232ab..2983a62 100644
--- a/src/saga_core/saga_cmd/Makefile.in
+++ b/src/saga_core/saga_cmd/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,10 +90,9 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = saga_cmd$(EXEEXT)
 subdir = src/saga_core/saga_cmd
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -93,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -202,6 +212,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -260,6 +271,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -278,6 +296,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -367,6 +386,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -377,7 +397,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2857 2016-03-23 14:22:48Z oconrad $
+# $Id$
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 MLIBPATH = "MODULE_LIBRARY_PATH=\"$(libdir)/saga\""
@@ -410,7 +430,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/saga_core/saga_cmd/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/saga_core/saga_cmd/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -801,6 +820,8 @@ uninstall-am: uninstall-binPROGRAMS
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
 	uninstall-am uninstall-binPROGRAMS
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/saga_core/saga_cmd/callback.cpp b/src/saga_core/saga_cmd/callback.cpp
index 4348a33..e5deeab 100755
--- a/src/saga_core/saga_cmd/callback.cpp
+++ b/src/saga_core/saga_cmd/callback.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: callback.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_cmd/callback.h b/src/saga_core/saga_cmd/callback.h
index 3c007bb..5f0e7dc 100755
--- a/src/saga_core/saga_cmd/callback.h
+++ b/src/saga_core/saga_cmd/callback.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: callback.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_cmd/man/Makefile.in b/src/saga_core/saga_cmd/man/Makefile.in
index 4f406cb..2442640 100644
--- a/src/saga_core/saga_cmd/man/Makefile.in
+++ b/src/saga_core/saga_cmd/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,10 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/saga_core/saga_cmd/man
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(dist_man_MANS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -91,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -146,6 +156,7 @@ am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
 MANS = $(dist_man_MANS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -179,6 +190,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -197,6 +215,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -286,6 +305,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -310,7 +330,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/saga_core/saga_cmd/man/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/saga_core/saga_cmd/man/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -534,6 +553,8 @@ uninstall-man: uninstall-man1
 	ps ps-am tags-am uninstall uninstall-am uninstall-man \
 	uninstall-man1
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/saga_core/saga_cmd/module_library.cpp b/src/saga_core/saga_cmd/module_library.cpp
index e02e1de..f92bb17 100755
--- a/src/saga_core/saga_cmd/module_library.cpp
+++ b/src/saga_core/saga_cmd/module_library.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library.cpp 2886 2016-04-08 15:23:40Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -289,6 +289,17 @@ bool CCMD_Module::_Set_Parameters(CSG_Parameters *pParameters)
 	{
 		CSG_Parameter	*pParameter	= pParameters->Get_Parameter(i);
 
+		//-------------------------------------------------
+		if( pParameter->is_DataObject() )	// reset data object parameters, avoids problems when tool is called more than once without un-/reloading
+		{
+			pParameter->Set_Value(DATAOBJECT_NOTSET);
+		}
+		else if( pParameter->is_DataObject_List() )
+		{
+			pParameter->asList()->Del_Items();
+		}
+
+		//-------------------------------------------------
 		if( pParameter->do_UseInCMD() == false )
 		{
 			continue;
@@ -305,6 +316,7 @@ bool CCMD_Module::_Set_Parameters(CSG_Parameters *pParameters)
 			m_CMD.AddOption(_Get_ID(pParameter), wxEmptyString, Description, wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR|wxCMD_LINE_PARAM_OPTIONAL);
 		}
 
+		//-------------------------------------------------
 		else if( pParameter->is_Option() && !pParameter->is_Information() )
 		{
 			switch( pParameter->Get_Type() )
@@ -405,7 +417,12 @@ bool CCMD_Module::_Get_Options(CSG_Parameters *pParameters, bool bInitialize)
 	{
 		CSG_Parameter	*pParameter	= pParameters->Get_Parameter(i);
 
-		if( pParameter->is_Input() )
+		if( pParameter->do_UseInCMD() == false )
+		{
+			// ignore here
+		}
+
+		else if( pParameter->is_Input() )
 		{
 			// nop now, loading options first
 		}
diff --git a/src/saga_core/saga_cmd/module_library.h b/src/saga_core/saga_cmd/module_library.h
index a8ca282..1d00ab7 100755
--- a/src/saga_core/saga_cmd/module_library.h
+++ b/src/saga_core/saga_cmd/module_library.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library.h 2708 2015-12-01 16:16:14Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_cmd/saga_cmd.cpp b/src/saga_core/saga_cmd/saga_cmd.cpp
index e931355..e477579 100755
--- a/src/saga_core/saga_cmd/saga_cmd.cpp
+++ b/src/saga_core/saga_cmd/saga_cmd.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_cmd.cpp 2834 2016-02-29 08:06:28Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -339,7 +339,7 @@ bool		Execute_Script(const CSG_String &Script)
 {
 	if( CMD_Get_Show_Messages() )
 	{
-		CMD_Print(CSG_String::Format(SG_T("%s: %s"), _TL("Running Script"), Script.c_str()));
+		CMD_Print(CSG_String::Format("%s: %s", _TL("Running Script"), Script.c_str()));
 	}
 
 	CSG_File	Stream;
@@ -408,6 +408,7 @@ bool		Load_Libraries(void)
 		}
 
 		wxSetEnv("GDAL_DRIVER_PATH", DLL_Path);
+		wxSetEnv("GDAL_DATA"       , DLL_Path + "\\gdal-data");
 
 		Load_Libraries(SG_File_Make_Path(CMD_Path, SG_T("modules")));
     #endif
@@ -483,11 +484,11 @@ bool		Check_Flags		(const CSG_String &Argument)
 #endif
 
 	//-----------------------------------------------------
-	CSG_String	s(Argument.BeforeFirst(SG_T('=')));
+	CSG_String	s(Argument.BeforeFirst('='));
 
 	if( !s.CmpNoCase("-f") || !s.CmpNoCase("--flags") )
 	{
-		s	= CSG_String(Argument).AfterFirst(SG_T('='));
+		s	= CSG_String(Argument).AfterFirst('=');
 
 		CMD_Set_Show_Progress(s.Find('q') < 0 && s.Find('s') < 0);	// q, s: no progress report
 		CMD_Set_Show_Messages(s.Find('r') < 0 && s.Find('s') < 0);	// r, s: no messages report
diff --git a/src/saga_core/saga_gdi/Makefile.in b/src/saga_core/saga_gdi/Makefile.in
index 9e9aea9..3bcaacc 100644
--- a/src/saga_core/saga_gdi/Makefile.in
+++ b/src/saga_core/saga_gdi/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -16,7 +16,17 @@
 
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,10 +90,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/saga_core/saga_gdi
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(otherinclude_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -93,6 +102,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(otherinclude_HEADERS) \
+	$(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -219,6 +230,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -252,6 +264,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -270,6 +289,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -359,6 +379,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -419,7 +440,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/saga_core/saga_gdi/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/saga_core/saga_gdi/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -750,6 +770,8 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-otherincludeHEADERS
 	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
 	uninstall-otherincludeHEADERS
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/saga_core/saga_gdi/saga_gdi.cpp b/src/saga_core/saga_gdi/saga_gdi.cpp
index c0ec251..5b38d93 100755
--- a/src/saga_core/saga_gdi/saga_gdi.cpp
+++ b/src/saga_core/saga_gdi/saga_gdi.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_gdi.cpp 1925 2014-01-09 12:15:18Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gdi/saga_gdi.h b/src/saga_core/saga_gdi/saga_gdi.h
index a3b28c4..fce36a4 100755
--- a/src/saga_core/saga_gdi/saga_gdi.h
+++ b/src/saga_core/saga_gdi/saga_gdi.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_gdi.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gdi/sgdi_diagram.cpp b/src/saga_core/saga_gdi/sgdi_diagram.cpp
index 6befe24..fbb2e34 100755
--- a/src/saga_core/saga_gdi/sgdi_diagram.cpp
+++ b/src/saga_core/saga_gdi/sgdi_diagram.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: sgdi_diagram.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gdi/sgdi_diagram.h b/src/saga_core/saga_gdi/sgdi_diagram.h
index f278776..a777795 100755
--- a/src/saga_core/saga_gdi/sgdi_diagram.h
+++ b/src/saga_core/saga_gdi/sgdi_diagram.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: sgdi_diagram.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gdi/sgdi_dialog.cpp b/src/saga_core/saga_gdi/sgdi_dialog.cpp
index fbad647..15f31c8 100755
--- a/src/saga_core/saga_gdi/sgdi_dialog.cpp
+++ b/src/saga_core/saga_gdi/sgdi_dialog.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: sgdi_dialog.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -118,13 +118,13 @@ CSGDI_Dialog::CSGDI_Dialog(const wxString &Name, int Style)
 
 	if( Style & SGDI_DLG_STYLE_CTRLS_RIGHT )
 	{
-		pSizer->Add(m_pSizer_Output	, 1, wxALIGN_RIGHT|wxALL|wxEXPAND, SGDI_CTRL_SPACE);
-		pSizer->Add(m_pSizer_Ctrl	, 0, wxALIGN_LEFT |wxALL|wxEXPAND, SGDI_CTRL_SPACE);
+		pSizer->Add(m_pSizer_Output	, 1, wxALL|wxEXPAND, SGDI_CTRL_SPACE);
+		pSizer->Add(m_pSizer_Ctrl	, 0, wxALL|wxEXPAND, SGDI_CTRL_SPACE);
 	}
 	else
 	{
-		pSizer->Add(m_pSizer_Ctrl	, 0, wxALIGN_LEFT |wxALL|wxEXPAND, SGDI_CTRL_SPACE);
-		pSizer->Add(m_pSizer_Output	, 1, wxALIGN_RIGHT|wxALL|wxEXPAND, SGDI_CTRL_SPACE);
+		pSizer->Add(m_pSizer_Ctrl	, 0, wxALL|wxEXPAND, SGDI_CTRL_SPACE);
+		pSizer->Add(m_pSizer_Output	, 1, wxALL|wxEXPAND, SGDI_CTRL_SPACE);
 	}
 
 	pSizer->FitInside(this);
@@ -178,7 +178,7 @@ wxButton * CSGDI_Dialog::Add_Button(const wxString &Name, int ID, const wxSize &
 {
 	wxButton	*pButton	= new wxButton(this, ID, Name, wxDefaultPosition, Size);
 
-	m_pSizer_Ctrl->Add(pButton, 0, wxALIGN_CENTER|wxALL|wxEXPAND, SGDI_CTRL_SMALLSPACE);
+	m_pSizer_Ctrl->Add(pButton, 0, wxALL|wxEXPAND, SGDI_CTRL_SMALLSPACE);
 
 	return( pButton );
 }
@@ -192,8 +192,8 @@ wxChoice * CSGDI_Dialog::Add_Choice(const wxString &Name, const wxArrayString &C
 	pLabel	->SetForegroundColour(m_Ctrl_Color);
 	pChoice	->SetSelection(iSelect);
 
-	m_pSizer_Ctrl->Add(pLabel , 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP   |wxEXPAND, SGDI_CTRL_SMALLSPACE);
-	m_pSizer_Ctrl->Add(pChoice, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, SGDI_CTRL_SMALLSPACE);
+	m_pSizer_Ctrl->Add(pLabel , 0, wxLEFT|wxRIGHT|wxTOP   |wxEXPAND, SGDI_CTRL_SMALLSPACE);
+	m_pSizer_Ctrl->Add(pChoice, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, SGDI_CTRL_SMALLSPACE);
 
 	return( pChoice );
 }
@@ -222,7 +222,7 @@ wxTextCtrl * CSGDI_Dialog::Add_TextCtrl(const wxString &Name, int Style, const w
 	pLabel	->SetForegroundColour(m_Ctrl_Color);
 
 	m_pSizer_Ctrl->Add(pLabel   ,       0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP            , SGDI_CTRL_SMALLSPACE);
-	m_pSizer_Ctrl->Add(pTextCtrl, Stretch, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, SGDI_CTRL_SMALLSPACE);
+	m_pSizer_Ctrl->Add(pTextCtrl, Stretch,                wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, SGDI_CTRL_SMALLSPACE);
 
 	if( Style & wxTE_READONLY )
 	{
@@ -252,7 +252,7 @@ CSGDI_Slider * CSGDI_Dialog::Add_Slider(const wxString &Name, double Value, doub
 
 	m_pSizer_Ctrl	->Add(pLabel , 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP            , SGDI_CTRL_SMALLSPACE);
 //	m_pSizer_Ctrl	->Add(pSizer_, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, SGDI_CTRL_SMALLSPACE);
-	m_pSizer_Ctrl	->Add(pSlider, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, SGDI_CTRL_SMALLSPACE);
+	m_pSizer_Ctrl	->Add(pSlider, 0,                wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, SGDI_CTRL_SMALLSPACE);
 
 	return( pSlider );
 }
diff --git a/src/saga_core/saga_gdi/sgdi_dialog.h b/src/saga_core/saga_gdi/sgdi_dialog.h
index 2e75786..adeec37 100755
--- a/src/saga_core/saga_gdi/sgdi_dialog.h
+++ b/src/saga_core/saga_gdi/sgdi_dialog.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: sgdi_dialog.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gdi/sgdi_helper.cpp b/src/saga_core/saga_gdi/sgdi_helper.cpp
index a06a5d9..02df8fa 100755
--- a/src/saga_core/saga_gdi/sgdi_helper.cpp
+++ b/src/saga_core/saga_gdi/sgdi_helper.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: sgdi_helper.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gdi/sgdi_helper.h b/src/saga_core/saga_gdi/sgdi_helper.h
index 7016eef..f5651d2 100755
--- a/src/saga_core/saga_gdi/sgdi_helper.h
+++ b/src/saga_core/saga_gdi/sgdi_helper.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: sgdi_helper.h 2114 2014-05-08 15:31:17Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/Makefile.am b/src/saga_core/saga_gui/Makefile.am
index bddf3a1..e4adfeb 100755
--- a/src/saga_core/saga_gui/Makefile.am
+++ b/src/saga_core/saga_gui/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 INCS = -I.. -I.
 if DEBUG
@@ -223,7 +223,7 @@ dist_applications_DATA = res/saga.desktop
 pixmapdir = $(datadir)/pixmaps
 dist_pixmap_DATA = res/saga.png
 
-ICON_SIZES = 8 16 24 32 48 64 72 80 96 128 192
+ICON_SIZES = 8 16 22 24 32 48 64 72 80 96 128 192
 
 install-icons:
 	@for size in $(ICON_SIZES); do \
diff --git a/src/saga_core/saga_gui/Makefile.in b/src/saga_core/saga_gui/Makefile.in
index 1b323d0..3851393 100644
--- a/src/saga_core/saga_gui/Makefile.in
+++ b/src/saga_core/saga_gui/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -16,7 +16,17 @@
 
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -81,12 +91,9 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = saga_gui$(EXEEXT)
 subdir = src/saga_core/saga_gui
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp $(dist_appdata_DATA) \
-	$(dist_applications_DATA) $(dist_pixmap_DATA) \
-	$(dist_pkgdata_DATA)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -96,6 +103,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(dist_appdata_DATA) \
+	$(dist_applications_DATA) $(dist_pixmap_DATA) \
+	$(dist_pkgdata_DATA) $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -284,6 +294,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -342,6 +353,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -360,6 +378,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -449,6 +468,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -459,7 +479,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2848 2016-03-15 17:05:42Z reklov_w $
+# $Id$
 #
 INCS = -I.. -I.
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
@@ -672,7 +692,7 @@ applicationsdir = $(datadir)/applications
 dist_applications_DATA = res/saga.desktop
 pixmapdir = $(datadir)/pixmaps
 dist_pixmap_DATA = res/saga.png
-ICON_SIZES = 8 16 24 32 48 64 72 80 96 128 192
+ICON_SIZES = 8 16 22 24 32 48 64 72 80 96 128 192
 appdatadir = $(datadir)/appdata
 dist_appdata_DATA = res/saga.appdata.xml
 dist_pkgdata_DATA = res/saga_tip.txt res/saga_dic.txt res/saga_srs.txt
@@ -693,7 +713,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/saga_core/saga_gui/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/saga_core/saga_gui/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -1278,6 +1297,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_appdataDATA \
 	uninstall-dist_applicationsDATA uninstall-dist_pixmapDATA \
 	uninstall-dist_pkgdataDATA
 
+.PRECIOUS: Makefile
+
 
 install-icons:
 	@for size in $(ICON_SIZES); do \
diff --git a/src/saga_core/saga_gui/active.cpp b/src/saga_core/saga_gui/active.cpp
index 6ed19fa..c0fe922 100755
--- a/src/saga_core/saga_gui/active.cpp
+++ b/src/saga_core/saga_gui/active.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active.cpp 2809 2016-02-22 11:40:22Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active.h b/src/saga_core/saga_gui/active.h
index 4a6c5b4..18b896c 100755
--- a/src/saga_core/saga_gui/active.h
+++ b/src/saga_core/saga_gui/active.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_attributes.cpp b/src/saga_core/saga_gui/active_attributes.cpp
index e19edbc..62b31dc 100755
--- a/src/saga_core/saga_gui/active_attributes.cpp
+++ b/src/saga_core/saga_gui/active_attributes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_attributes.cpp 2709 2015-12-01 16:39:59Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_attributes.h b/src/saga_core/saga_gui/active_attributes.h
index 6f1f2c6..6d335dc 100755
--- a/src/saga_core/saga_gui/active_attributes.h
+++ b/src/saga_core/saga_gui/active_attributes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_attributes.h 2694 2015-11-20 16:43:15Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_attributes_control.cpp b/src/saga_core/saga_gui/active_attributes_control.cpp
index 06d834c..6e7f283 100755
--- a/src/saga_core/saga_gui/active_attributes_control.cpp
+++ b/src/saga_core/saga_gui/active_attributes_control.cpp
@@ -488,7 +488,11 @@ void CActive_Attributes_Control::On_Field_Open(wxCommandEvent &event)
 //---------------------------------------------------------
 bool CActive_Attributes_Control::_Get_DataSource(wxString &Source)
 {
-	if( Source.Find("PGSQL:") == 0 || wxFileExists(Source) )
+	if( Source.Find("PGSQL:" ) == 0
+	||	Source.Find("ftp://" ) == 0
+	||	Source.Find("http://") == 0
+	||	Source.Find("file://") == 0
+	||  wxFileExists(Source) )
 	{
 		return( true );
 	}
diff --git a/src/saga_core/saga_gui/active_description.cpp b/src/saga_core/saga_gui/active_description.cpp
index 7dafcc5..cc51865 100755
--- a/src/saga_core/saga_gui/active_description.cpp
+++ b/src/saga_core/saga_gui/active_description.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_description.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_description.h b/src/saga_core/saga_gui/active_description.h
index 219598d..98c1a8a 100755
--- a/src/saga_core/saga_gui/active_description.h
+++ b/src/saga_core/saga_gui/active_description.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_description.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_history.cpp b/src/saga_core/saga_gui/active_history.cpp
index c23458b..8787ea9 100755
--- a/src/saga_core/saga_gui/active_history.cpp
+++ b/src/saga_core/saga_gui/active_history.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_history.cpp 2873 2016-03-31 09:37:32Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_history.h b/src/saga_core/saga_gui/active_history.h
index 2ecea20..1b6996f 100755
--- a/src/saga_core/saga_gui/active_history.h
+++ b/src/saga_core/saga_gui/active_history.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_history.h 2239 2014-09-19 14:39:23Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_legend.cpp b/src/saga_core/saga_gui/active_legend.cpp
index d8ee8ec..3cfd4a3 100755
--- a/src/saga_core/saga_gui/active_legend.cpp
+++ b/src/saga_core/saga_gui/active_legend.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_legend.cpp 2042 2014-03-05 16:11:03Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_legend.h b/src/saga_core/saga_gui/active_legend.h
index ce263bd..11cf5d1 100755
--- a/src/saga_core/saga_gui/active_legend.h
+++ b/src/saga_core/saga_gui/active_legend.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_legend.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_parameters.cpp b/src/saga_core/saga_gui/active_parameters.cpp
index eb371b6..1bfd3e9 100755
--- a/src/saga_core/saga_gui/active_parameters.cpp
+++ b/src/saga_core/saga_gui/active_parameters.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_parameters.cpp 2002 2014-02-19 17:06:08Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/active_parameters.h b/src/saga_core/saga_gui/active_parameters.h
index 50727a6..758c513 100755
--- a/src/saga_core/saga_gui/active_parameters.h
+++ b/src/saga_core/saga_gui/active_parameters.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: active_parameters.h 2002 2014-02-19 17:06:08Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/callback.cpp b/src/saga_core/saga_gui/callback.cpp
index 69a9549..40f3fc5 100755
--- a/src/saga_core/saga_gui/callback.cpp
+++ b/src/saga_core/saga_gui/callback.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: callback.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/callback.h b/src/saga_core/saga_gui/callback.h
index 8fc13df..e39a369 100755
--- a/src/saga_core/saga_gui/callback.h
+++ b/src/saga_core/saga_gui/callback.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: callback.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/data_source_files.cpp b/src/saga_core/saga_gui/data_source_files.cpp
index e7fa81b..83b4d2f 100755
--- a/src/saga_core/saga_gui/data_source_files.cpp
+++ b/src/saga_core/saga_gui/data_source_files.cpp
@@ -130,8 +130,8 @@ CData_Source_Files::CData_Source_Files(wxWindow *pParent)
 	//-----------------------------------------------------
 	wxBoxSizer	*Sizer	= new wxBoxSizer(wxVERTICAL);
 
-	Sizer->Add(m_pControl, wxSizerFlags(1).Align(wxALIGN_TOP   ).Expand());
-	Sizer->Add(m_pFilter , wxSizerFlags(0).Align(wxALIGN_BOTTOM).Expand());
+	Sizer->Add(m_pControl, wxSizerFlags(1).Expand());
+	Sizer->Add(m_pFilter , wxSizerFlags(0).Expand());
 
 	SetSizerAndFit(Sizer);
 }
diff --git a/src/saga_core/saga_gui/data_source_pgsql.cpp b/src/saga_core/saga_gui/data_source_pgsql.cpp
index 1c176b2..27db650 100755
--- a/src/saga_core/saga_gui/data_source_pgsql.cpp
+++ b/src/saga_core/saga_gui/data_source_pgsql.cpp
@@ -382,6 +382,7 @@ BEGIN_EVENT_TABLE(CData_Source_PgSQL, wxTreeCtrl)
 	EVT_MENU					(ID_CMD_DB_SOURCE_CLOSE_ALL		, CData_Source_PgSQL::On_Sources_Close)
 	EVT_MENU					(ID_CMD_DB_SOURCE_DELETE		, CData_Source_PgSQL::On_Source_Delete)
 	EVT_MENU					(ID_CMD_DB_TABLE_OPEN			, CData_Source_PgSQL::On_Table_Open)
+	EVT_MENU					(ID_CMD_DB_TABLE_FROM_QUERY		, CData_Source_PgSQL::On_Table_From_Query)
 	EVT_MENU					(ID_CMD_DB_TABLE_RENAME			, CData_Source_PgSQL::On_Table_Rename)
 	EVT_MENU					(ID_CMD_DB_TABLE_INFO			, CData_Source_PgSQL::On_Table_Info)
 	EVT_MENU					(ID_CMD_DB_TABLE_DELETE			, CData_Source_PgSQL::On_Table_Drop)
@@ -580,6 +581,12 @@ void CData_Source_PgSQL::On_Table_Open(wxCommandEvent &WXUNUSED(event))
 }
 
 //---------------------------------------------------------
+void CData_Source_PgSQL::On_Table_From_Query(wxCommandEvent &WXUNUSED(event))
+{
+	Table_From_Query(GetSelection());
+}
+
+//---------------------------------------------------------
 void CData_Source_PgSQL::On_Table_Rename(wxCommandEvent &WXUNUSED(event))
 {
 	Table_Rename(GetSelection());
@@ -1181,6 +1188,32 @@ void CData_Source_PgSQL::Table_Open(const wxTreeItemId &Item)
 }
 
 //---------------------------------------------------------
+void CData_Source_PgSQL::Table_From_Query(const wxTreeItemId &Item)
+{
+	CData_Source_PgSQL_Data	*pData	= Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL )	return;
+
+	CSG_Module	*pModule	= SG_Get_Module_Library_Manager().Get_Module("db_pgsql", DB_PGSQL_Table_Query);
+
+	SG_UI_Msg_Lock(true);
+
+	if(	pModule && pModule->On_Before_Execution() )
+	{
+		if( pData->Get_Type() == TYPE_SERVER )
+		{
+			pModule->Set_Parameter("PG_HOST", pData->Get_Host());
+			pModule->Set_Parameter("PG_PORT", pData->Get_Port());
+		}
+
+		if( DLG_Parameters(pModule->Get_Parameters()) )
+		{
+			pModule->Execute();
+		}
+	}
+
+	SG_UI_Msg_Lock(false);
+}
+
+//---------------------------------------------------------
 void CData_Source_PgSQL::Table_Rename(const wxTreeItemId &Item)
 {
 	CData_Source_PgSQL_Data	*pData	= Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL )	return;
diff --git a/src/saga_core/saga_gui/data_source_pgsql.h b/src/saga_core/saga_gui/data_source_pgsql.h
index 9a57fa8..b4382f9 100755
--- a/src/saga_core/saga_gui/data_source_pgsql.h
+++ b/src/saga_core/saga_gui/data_source_pgsql.h
@@ -125,6 +125,7 @@ private:
 	void						On_Sources_Close	(wxCommandEvent &event);
 	void						On_Source_Delete	(wxCommandEvent &event);
 	void						On_Table_Open		(wxCommandEvent &event);
+	void						On_Table_From_Query	(wxCommandEvent &event);
 	void						On_Table_Rename		(wxCommandEvent &event);
 	void						On_Table_Info		(wxCommandEvent &event);
 	void						On_Table_Drop		(wxCommandEvent &event);
@@ -136,6 +137,7 @@ private:
 	void						Source_Close		(const wxTreeItemId &Item, bool bDelete);
 	void						Sources_Close		(void);
 	void						Table_Open			(const wxTreeItemId &Item);
+	void						Table_From_Query	(const wxTreeItemId &Item);
 	void						Table_Rename		(const wxTreeItemId &Item);
 	void						Table_Info			(const wxTreeItemId &Item);
 	void						Table_Drop			(const wxTreeItemId &Item);
diff --git a/src/saga_core/saga_gui/dc_helper.cpp b/src/saga_core/saga_gui/dc_helper.cpp
index 0f03236..aef814d 100755
--- a/src/saga_core/saga_gui/dc_helper.cpp
+++ b/src/saga_core/saga_gui/dc_helper.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dc_helper.cpp 2329 2014-11-05 19:32:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -100,11 +100,11 @@ void		Draw_Edge(wxDC &dc, int Edge_Style, int ax, int ay, int bx, int by)
 	case EDGE_STYLE_SUNKEN:
 		oldPen	= dc.GetPen();
 
-		dc.SetPen(wxPen(SYS_Get_Color(wxSYS_COLOUR_BTNHIGHLIGHT), 0, wxSOLID));
+		dc.SetPen(wxPen(SYS_Get_Color(wxSYS_COLOUR_BTNHIGHLIGHT), 0, wxPENSTYLE_SOLID));
 		dc.DrawLine(bx, ay, bx, by);
 		dc.DrawLine(bx, by, ax, by);
 
-		dc.SetPen(wxPen(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW   ), 0, wxSOLID));
+		dc.SetPen(wxPen(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW   ), 0, wxPENSTYLE_SOLID));
 		dc.DrawLine(ax, by, ax, ay);
 		dc.DrawLine(ax, ay, bx, ay);
 
@@ -115,11 +115,11 @@ void		Draw_Edge(wxDC &dc, int Edge_Style, int ax, int ay, int bx, int by)
 	case EDGE_STYLE_RAISED:
 		oldPen	= dc.GetPen();
 
-		dc.SetPen(wxPen(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW   ), 0, wxSOLID));
+		dc.SetPen(wxPen(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW   ), 0, wxPENSTYLE_SOLID));
 		dc.DrawLine(bx, ay, bx, by);
 		dc.DrawLine(bx, by, ax, by);
 
-		dc.SetPen(wxPen(SYS_Get_Color(wxSYS_COLOUR_BTNHIGHLIGHT), 0, wxSOLID));
+		dc.SetPen(wxPen(SYS_Get_Color(wxSYS_COLOUR_BTNHIGHLIGHT), 0, wxPENSTYLE_SOLID));
 		dc.DrawLine(ax, by, ax, ay);
 		dc.DrawLine(ax, ay, bx, ay);
 
diff --git a/src/saga_core/saga_gui/dc_helper.h b/src/saga_core/saga_gui/dc_helper.h
index 8474b37..797bc42 100755
--- a/src/saga_core/saga_gui/dc_helper.h
+++ b/src/saga_core/saga_gui/dc_helper.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dc_helper.h 2329 2014-11-05 19:32:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_about.cpp b/src/saga_core/saga_gui/dlg_about.cpp
index d5e0619..dbf9509 100755
--- a/src/saga_core/saga_gui/dlg_about.cpp
+++ b/src/saga_core/saga_gui/dlg_about.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_about.cpp 2879 2016-03-31 16:07:02Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_about.h b/src/saga_core/saga_gui/dlg_about.h
index 34ca91d..2f2aba8 100755
--- a/src/saga_core/saga_gui/dlg_about.h
+++ b/src/saga_core/saga_gui/dlg_about.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_about.h 2675 2015-11-04 10:39:23Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_about_logo.cpp b/src/saga_core/saga_gui/dlg_about_logo.cpp
index b29949b..da900dc 100755
--- a/src/saga_core/saga_gui/dlg_about_logo.cpp
+++ b/src/saga_core/saga_gui/dlg_about_logo.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_about_logo.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_about_logo.h b/src/saga_core/saga_gui/dlg_about_logo.h
index ebee7db..44add0c 100755
--- a/src/saga_core/saga_gui/dlg_about_logo.h
+++ b/src/saga_core/saga_gui/dlg_about_logo.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_about_logo.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_base.cpp b/src/saga_core/saga_gui/dlg_base.cpp
index facaf14..c281ae2 100755
--- a/src/saga_core/saga_gui/dlg_base.cpp
+++ b/src/saga_core/saga_gui/dlg_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_base.cpp 2002 2014-02-19 17:06:08Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_base.h b/src/saga_core/saga_gui/dlg_base.h
index dcff762..8283af4 100755
--- a/src/saga_core/saga_gui/dlg_base.h
+++ b/src/saga_core/saga_gui/dlg_base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_base.h 2002 2014-02-19 17:06:08Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_colors.cpp b/src/saga_core/saga_gui/dlg_colors.cpp
index 44fae10..56fae0e 100755
--- a/src/saga_core/saga_gui/dlg_colors.cpp
+++ b/src/saga_core/saga_gui/dlg_colors.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_colors.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_colors.h b/src/saga_core/saga_gui/dlg_colors.h
index d641df5..2b65f34 100755
--- a/src/saga_core/saga_gui/dlg_colors.h
+++ b/src/saga_core/saga_gui/dlg_colors.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_colors.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_colors_control.cpp b/src/saga_core/saga_gui/dlg_colors_control.cpp
index c775537..ed70f6e 100755
--- a/src/saga_core/saga_gui/dlg_colors_control.cpp
+++ b/src/saga_core/saga_gui/dlg_colors_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_colors_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_colors_control.h b/src/saga_core/saga_gui/dlg_colors_control.h
index 1d61c51..8989e55 100755
--- a/src/saga_core/saga_gui/dlg_colors_control.h
+++ b/src/saga_core/saga_gui/dlg_colors_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_colors_control.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_base.cpp b/src/saga_core/saga_gui/dlg_list_base.cpp
index a513076..754aa73 100755
--- a/src/saga_core/saga_gui/dlg_list_base.cpp
+++ b/src/saga_core/saga_gui/dlg_list_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_base.cpp 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_base.h b/src/saga_core/saga_gui/dlg_list_base.h
index 7b750fe..1bcc04b 100755
--- a/src/saga_core/saga_gui/dlg_list_base.h
+++ b/src/saga_core/saga_gui/dlg_list_base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_base.h 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_grid.cpp b/src/saga_core/saga_gui/dlg_list_grid.cpp
index 44e9a41..f91df71 100755
--- a/src/saga_core/saga_gui/dlg_list_grid.cpp
+++ b/src/saga_core/saga_gui/dlg_list_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_grid.cpp 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_grid.h b/src/saga_core/saga_gui/dlg_list_grid.h
index 927f5af..6e387ba 100755
--- a/src/saga_core/saga_gui/dlg_list_grid.h
+++ b/src/saga_core/saga_gui/dlg_list_grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_grid.h 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_pointcloud.cpp b/src/saga_core/saga_gui/dlg_list_pointcloud.cpp
index 5972fa9..72300d7 100755
--- a/src/saga_core/saga_gui/dlg_list_pointcloud.cpp
+++ b/src/saga_core/saga_gui/dlg_list_pointcloud.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_pointcloud.cpp 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_pointcloud.h b/src/saga_core/saga_gui/dlg_list_pointcloud.h
index fedf5f4..a7963a8 100755
--- a/src/saga_core/saga_gui/dlg_list_pointcloud.h
+++ b/src/saga_core/saga_gui/dlg_list_pointcloud.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_pointcloud.h 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_shapes.cpp b/src/saga_core/saga_gui/dlg_list_shapes.cpp
index a83912a..81b4f6d 100755
--- a/src/saga_core/saga_gui/dlg_list_shapes.cpp
+++ b/src/saga_core/saga_gui/dlg_list_shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_shapes.cpp 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_shapes.h b/src/saga_core/saga_gui/dlg_list_shapes.h
index 2a6aab1..264224c 100755
--- a/src/saga_core/saga_gui/dlg_list_shapes.h
+++ b/src/saga_core/saga_gui/dlg_list_shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_shapes.h 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_table.cpp b/src/saga_core/saga_gui/dlg_list_table.cpp
index 59579da..360d75d 100755
--- a/src/saga_core/saga_gui/dlg_list_table.cpp
+++ b/src/saga_core/saga_gui/dlg_list_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_table.cpp 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_table.h b/src/saga_core/saga_gui/dlg_list_table.h
index 1ebb86b..9072f62 100755
--- a/src/saga_core/saga_gui/dlg_list_table.h
+++ b/src/saga_core/saga_gui/dlg_list_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_table.h 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_tin.cpp b/src/saga_core/saga_gui/dlg_list_tin.cpp
index 7bf5c34..64f55c3 100755
--- a/src/saga_core/saga_gui/dlg_list_tin.cpp
+++ b/src/saga_core/saga_gui/dlg_list_tin.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_tin.cpp 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_list_tin.h b/src/saga_core/saga_gui/dlg_list_tin.h
index effb50c..5c19f8b 100755
--- a/src/saga_core/saga_gui/dlg_list_tin.h
+++ b/src/saga_core/saga_gui/dlg_list_tin.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_list_tin.h 1964 2014-02-04 16:25:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_parameters.cpp b/src/saga_core/saga_gui/dlg_parameters.cpp
index d8499c1..57a0ced 100755
--- a/src/saga_core/saga_gui/dlg_parameters.cpp
+++ b/src/saga_core/saga_gui/dlg_parameters.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_parameters.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_parameters.h b/src/saga_core/saga_gui/dlg_parameters.h
index 79b6b49..bb896ed 100755
--- a/src/saga_core/saga_gui/dlg_parameters.h
+++ b/src/saga_core/saga_gui/dlg_parameters.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_parameters.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_table.cpp b/src/saga_core/saga_gui/dlg_table.cpp
index e7f4b06..14e7efd 100755
--- a/src/saga_core/saga_gui/dlg_table.cpp
+++ b/src/saga_core/saga_gui/dlg_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_table.cpp 2694 2015-11-20 16:43:15Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_table.h b/src/saga_core/saga_gui/dlg_table.h
index b315886..ffc0d3a 100755
--- a/src/saga_core/saga_gui/dlg_table.h
+++ b/src/saga_core/saga_gui/dlg_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_table.h 2694 2015-11-20 16:43:15Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_text.cpp b/src/saga_core/saga_gui/dlg_text.cpp
index 7183234..68c0b42 100755
--- a/src/saga_core/saga_gui/dlg_text.cpp
+++ b/src/saga_core/saga_gui/dlg_text.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_text.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/dlg_text.h b/src/saga_core/saga_gui/dlg_text.h
index 0fb8f1c..8ed0c84 100755
--- a/src/saga_core/saga_gui/dlg_text.h
+++ b/src/saga_core/saga_gui/dlg_text.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dlg_text.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/helper.cpp b/src/saga_core/saga_gui/helper.cpp
index 782944f..9fcd240 100755
--- a/src/saga_core/saga_gui/helper.cpp
+++ b/src/saga_core/saga_gui/helper.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: helper.cpp 2880 2016-03-31 16:10:03Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/helper.h b/src/saga_core/saga_gui/helper.h
index 2ea9da0..85cdff5 100755
--- a/src/saga_core/saga_gui/helper.h
+++ b/src/saga_core/saga_gui/helper.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: helper.h 2772 2016-02-05 15:25:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/info.cpp b/src/saga_core/saga_gui/info.cpp
index e4ead4d..ac6d10f 100755
--- a/src/saga_core/saga_gui/info.cpp
+++ b/src/saga_core/saga_gui/info.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: info.cpp 2860 2016-03-24 10:33:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/info.h b/src/saga_core/saga_gui/info.h
index b98d4d5..2695389 100755
--- a/src/saga_core/saga_gui/info.h
+++ b/src/saga_core/saga_gui/info.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: info.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/info_messages.cpp b/src/saga_core/saga_gui/info_messages.cpp
index 1882626..db6c59f 100755
--- a/src/saga_core/saga_gui/info_messages.cpp
+++ b/src/saga_core/saga_gui/info_messages.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: info_messages.cpp 2616 2015-09-29 13:48:28Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/info_messages.h b/src/saga_core/saga_gui/info_messages.h
index 4503e95..1dada01 100755
--- a/src/saga_core/saga_gui/info_messages.h
+++ b/src/saga_core/saga_gui/info_messages.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: info_messages.h 2375 2015-01-28 19:18:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/man/Makefile.in b/src/saga_core/saga_gui/man/Makefile.in
index fefcfe5..bd9031e 100644
--- a/src/saga_core/saga_gui/man/Makefile.in
+++ b/src/saga_core/saga_gui/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,10 +88,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = src/saga_core/saga_gui/man
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(dist_man_MANS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_gdal.m4 \
+	$(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/m4/ax_pkg_swig.m4 \
 	$(top_srcdir)/m4/ax_python_devel.m4 \
 	$(top_srcdir)/m4/ax_swig_enable_cxx.m4 \
@@ -91,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_postgresql.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -146,6 +156,7 @@ am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
 MANS = $(dist_man_MANS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -179,6 +190,13 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GDAL2FLAGS = @GDAL2FLAGS@
+GDAL_CFLAGS = @GDAL_CFLAGS@
+GDAL_CONFIG = @GDAL_CONFIG@
+GDAL_DEP_LDFLAGS = @GDAL_DEP_LDFLAGS@
+GDAL_LDFLAGS = @GDAL_LDFLAGS@
+GDAL_OGR_ENABLED = @GDAL_OGR_ENABLED@
+GDAL_VERSION = @GDAL_VERSION@
 GOMPFLAGS = @GOMPFLAGS@
 GREP = @GREP@
 HARU_LIB = @HARU_LIB@
@@ -197,6 +215,7 @@ LN_S = @LN_S@
 LOCAL_INCS = @LOCAL_INCS@
 LOCAL_LIBS = @LOCAL_LIBS@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
@@ -286,6 +305,7 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pyexecdir = @pyexecdir@
 pythondir = @pythondir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -310,7 +330,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/saga_core/saga_gui/man/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/saga_core/saga_gui/man/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -534,6 +553,8 @@ uninstall-man: uninstall-man1
 	ps ps-am tags-am uninstall uninstall-am uninstall-man \
 	uninstall-man1
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/saga_core/saga_gui/parameters_control.cpp b/src/saga_core/saga_gui/parameters_control.cpp
index 5814b1a..eaeb8cc 100755
--- a/src/saga_core/saga_gui/parameters_control.cpp
+++ b/src/saga_core/saga_gui/parameters_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters_control.cpp 2873 2016-03-31 09:37:32Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/parameters_control.h b/src/saga_core/saga_gui/parameters_control.h
index 552a3e6..e4f1307 100755
--- a/src/saga_core/saga_gui/parameters_control.h
+++ b/src/saga_core/saga_gui/parameters_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters_control.h 2873 2016-03-31 09:37:32Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/parameters_properties.cpp b/src/saga_core/saga_gui/parameters_properties.cpp
index 3810424..3574d57 100755
--- a/src/saga_core/saga_gui/parameters_properties.cpp
+++ b/src/saga_core/saga_gui/parameters_properties.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters_properties.cpp 1947 2014-01-16 15:03:57Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/parameters_properties.h b/src/saga_core/saga_gui/parameters_properties.h
index f4b902a..e3ab5e7 100755
--- a/src/saga_core/saga_gui/parameters_properties.h
+++ b/src/saga_core/saga_gui/parameters_properties.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameters_properties.h 1947 2014-01-16 15:03:57Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/project.cpp b/src/saga_core/saga_gui/project.cpp
index d2b77ab..30e44c1 100755
--- a/src/saga_core/saga_gui/project.cpp
+++ b/src/saga_core/saga_gui/project.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: project.cpp 2794 2016-02-17 11:14:04Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/project.h b/src/saga_core/saga_gui/project.h
index 26a3895..ebe6255 100755
--- a/src/saga_core/saga_gui/project.h
+++ b/src/saga_core/saga_gui/project.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: project.h 2674 2015-11-03 17:03:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/res/resource.h b/src/saga_core/saga_gui/res/resource.h
index e3c55ab..a7a528d 100644
--- a/src/saga_core/saga_gui/res/resource.h
+++ b/src/saga_core/saga_gui/res/resource.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: resource.h 911 2011-02-14 16:38:15Z reklov_w $
+ * Version $Id$
  *********************************************************/
 //{{NO_DEPENDENCIES}}
 // Microsoft Developer Studio generated include file.
diff --git a/src/saga_core/saga_gui/res/saga.bra.txt b/src/saga_core/saga_gui/res/saga.bra.txt
index 4800068..4632483 100644
--- a/src/saga_core/saga_gui/res/saga.bra.txt
+++ b/src/saga_core/saga_gui/res/saga.bra.txt
@@ -174,7 +174,6 @@ TEXT	TRANSLATION
 "3D Image"	"Imagem 3D"
 "3D Image Height"	"Altura da imagem 3D"
 "3D Image Width"	"Largura da imagem 3D"
-"3D Points"	"3D Pontos"
 "3D Shapes Viewer"	"Visualiza��o 3D de shapes"
 "3D View"	"Visualiza��o 3D"
 "3D View Sequencer"	"Sequ�ncia de visualiza��o 3D"
@@ -228,10 +227,12 @@ TEXT	TRANSLATION
 "A"	"A"
 "A SAGA module to create transects through polygon files."	"Um m�dulo SAGA para criar transectos atrav�s de arquivos de pol�gonos."
 "A Simple Litter System"	"Um Sistema Simples de Maca"
+"A grid providing information about the channel network. It is assumed that no-data cells are not part of the channel network. Vice versa all others cells are recognised as channel network members."	""
 "A grid that contains elevation data."	"Uma grade que cont�m dados de eleva��o."
 "A set of basic SAGA module programming examples."	"Um conjunto de exemplos b�sicos de programa��o do m�dulo SAGA."
 "A space separated list of key-value pairs (K=V)."	"Uma lista separada de espa�o de pares chave-valor (K = V)."
 "A text file with the full path to an input point cloud on each line"	"Um arquivo de texto com o caminho completo para um ponto de nuvem de entrada em cada linha"
+"A threshold between 0 and 1 used to save computational time. Set this parameter to 0 to turn off this functionality."	""
 "A3 Landscape"	"A3 Paisagem"
 "A3 Portrait"	"A3 Retrato"
 "A4 Landscape"	"A4 Paisagem"
@@ -245,6 +246,7 @@ TEXT	TRANSLATION
 "A:Grid|Tools"	"A:Grade|Ferramentas"
 "A:Grid|Values"	"A:Grade|Valores"
 "A:Imagery|Classification"	"A:Imagens|Classifica��o"
+"A:Imagery|Classification|Machine Learning (OpenCV)"	""
 "A:Imagery|Fourier Analysis"	"A:Imagens|An�lise de Fourier"
 "A:Imagery|Segmentation"	"A:Imagens|Segmenta��o"
 "A:Imagery|Tools"	"A:Imagens|Ferramentas"
@@ -274,6 +276,7 @@ TEXT	TRANSLATION
 "AOI does not intersect bounding box of SPCVF, nothing to do!"	"AOI n�o se cruza com o quadro de SPCVF, nada a ver com na delimita��o!"
 "AOI does not intersect with any bounding box of the SPCVF datasets, nothing to do!"	"AOI n�o cruza com qualquer caixa delimitadora dos conjuntos de dados SPCVF, nada a fazer!"
 "AOI does not intersect with any point of the SPCVF datasets, nothing to do!"	"AOI n�o se cruza com qualquer ponto dos conjuntos de dados SPCVF, nada a fazer!"
+"AOI_Cutter"	""
 "AQ("	"AQ("
 "AREA"	"�REA"
 "AS("	"AS("
@@ -319,7 +322,9 @@ TEXT	TRANSLATION
 "Action"	"A��o"
 "Activate Grid File Cache?"	"Ative o arquivo grade de cache?"
 "Activate file caching automatically, if memory size exceeds the threshold value."	"Ativar o cache de arquivos automaticamente, se o tamanho da mem�ria exceder o valor limite."
+"Activation Function"	""
 "Activation function"	"fun��o de ativa��o"
+"Active Variable Count"	""
 "Add"	"Adicionar"
 "Add All"	"Adicionar todos"
 "Add All Fields"	"Adicionar todos os campos"
@@ -385,6 +390,7 @@ TEXT	TRANSLATION
 "Albers Equal Area Conic"	"�reas c�nicas equivalentes de Albers"
 "Alessandro Perego"	"Alessandro Perego"
 "Algorithm"	"Algoritmo"
+"Algorithm Type"	""
 "Algorithm for the detection of Surface Specific Points"	"Algoritmo para a detec��o de superf�cies espec�ficas de observa��es"
 "Alignment"	"Alinhamento"
 "All"	"Tudo"
@@ -407,6 +413,7 @@ TEXT	TRANSLATION
 "Allows writing cell values from additional grids to the output"	""
 "Alpha"	"Alfa"
 "Alpha Max (Degree)"	"Alfa m�ximo (Graus)"
+"Alphanumeric Sorting"	""
 "Alternatives"	"Alternativas"
 "Altura de llama"	"Altura de lhama"
 "Altura de llama (m)"	"Altura de lhama (m)"
@@ -433,6 +440,8 @@ TEXT	TRANSLATION
 "Angular Step Size (Degree)"	"Passo Tamanho Angular (Grau)"
 "Annual"	"Anual"
 "Annual Course of Daily Insolation"	"Curso Anual de insola��o di�ria"
+"Annual Mean Temperature"	""
+"Annual Precipitation"	""
 "Appearance"	""
 "Append Fields from another Table"	"Anexar campos de outra tabela"
 "Append Rows from ..."	"Acrescente linhas de ..."
@@ -469,6 +478,7 @@ TEXT	TRANSLATION
 "Arithmetic mean (version 1)"	"M�dia aritm�tica (Vers�o 1)"
 "Arithmetic mean (version 2)"	"M�dia aritm�tica (Vers�o 2)"
 "Arrange Icons"	"Organizar �cones"
+"Artificial Neural Network Classification (OpenCV)"	""
 "Aspect"	"Aspecto"
 "Aspect Units"	"Unidades de aspecto"
 "Aspect grid, in radians and 360 degree from north."	"Grade de aspecto, em radianos e 360 graus ao norte."
@@ -615,10 +625,12 @@ TEXT	TRANSLATION
 "Binary Encoding"	"Codifica��o bin�ria"
 "Binary Erosion-Reconstruction"	"Reconstru��o de eros�o bin�ria"
 "Binary object mask"	"M�scara de objeto bin�rio"
+"Bioclimatic Variables"	""
 "Birth Rate of Fishes"	"Taxa de de natalidade dos Peixes"
 "Birth Rate of Sharks"	"Taxa de natalidade de tubar�es"
 "Blending Distance"	"Dist�ncia de mesclagem"
 "Block Kriging"	"Bloco de kringagem"
+"Block Matching"	""
 "Block Size"	"Tamanho do bloco"
 "Blocks"	"Blocos"
 "Blue"	"Azul"
@@ -629,6 +641,8 @@ TEXT	TRANSLATION
 "Boehner's Simple Language (BSL) is a macro script language for grid based calculations."	"Linguagem simples de Boehner (BSL) � uma linguagem de macro script para c�lculos baseados em grade."
 "Bonne"	"Bom"
 "Boolean"	"Booleano"
+"Boost Type"	""
+"Boosting Classification (OpenCV)"	""
 "Border"	"Borda"
 "Border Color"	"Cor da borda"
 "Borders"	"Bordas"
@@ -653,7 +667,6 @@ TEXT	TRANSLATION
 "Buffer Size [MB]"	"Tamanho do buffer [MB]"
 "Buffer distance"	"Dist�ncia do buffer"
 "Buffer distance (grid units)."	"Dist�ncia do buffer (Unidades da grade)."
-"Buffer distance [map units]."	"Dist�ncia do buffer [unidades do mapa]."
 "Build Histogram..."	"Construir Histograma ..."
 "Buildings"	"Constru��es"
 "Bulk density top layer"	"Densidade aparente de camada superior"
@@ -686,6 +699,7 @@ TEXT	TRANSLATION
 "CRS Dictionary"	"Dicion�rio CRS"
 "CSV Files (*.csv)"	"Arquivos CSV "
 "CUMUL"	"CUMUL"
+"CV Folds"	""
 "Cache"	"Cache"
 "Cache Directory"	"Diret�rio do cache"
 "Cache Size"	"Tamanho do cache"
@@ -720,6 +734,7 @@ TEXT	TRANSLATION
 "Catchment Area Calculation"	"C�lculo da �rea de capta��o"
 "Catchment area"	"�rea de capta��o"
 "Catchment slope"	"inclina��o de capta��o"
+"Categorical Coincidence"	""
 "Categorical Features"	"Fei��es categorizadas"
 "Categorical Grids"	"Grades categorizadas"
 "Categories"	"Categorias"
@@ -729,6 +744,7 @@ TEXT	TRANSLATION
 "Cell Count (X)"	"Contagem de c�lula"
 "Cell Count (Y)"	"Contagem de c�lula"
 "Cell Height"	"Altura da c�lula"
+"Cell Reference"	""
 "Cell Size"	"Tamanho da C�lula"
 "Cell Sizes"	"Tamanhos das c�lulas"
 "Cell size"	"Tamanho da c�lula"
@@ -762,6 +778,7 @@ TEXT	TRANSLATION
 "Change Time Format"	"Alterar formato de tempo"
 "Change Vector"	"Alterar vetor"
 "Change Vector Analysis"	"An�lises de altera��o de vetor"
+"Change a Grid's No-Data Value"	""
 "Change all values within radius."	"Alterar todos os valores dentro do raio."
 "Changed"	"Alterado"
 "Changed Grid"	"Grade alterado"
@@ -884,6 +901,7 @@ TEXT	TRANSLATION
 "Clipping Options"	"Op��es de corte"
 "Close"	"Fechar"
 "Close All"	"Fechar Tudo"
+"Close All But This"	""
 "Close Gaps"	"Fechar lacunas"
 "Close Gaps with Spline"	"Fechar lacunas com ranhura/estrias"
 "Close Gaps with Stepwise Resampling"	"Fechar lacunas com reamostragem passo a passo"
@@ -901,11 +919,15 @@ TEXT	TRANSLATION
 "Cluster Analysis (Shapes)"	"An�lises de aglomerado (Shapes)"
 "Cluster Analysis PC"	"An�lises de aglomerado PC"
 "Cluster Analysis for Point Clouds"	"An�lises de aglomerado para nuvem de pontos"
+"Cluster possible values of a categorical variable into K<=maxCategories clusters to find a suboptimal split."	""
 "ClusterID"	"AglomeradoID"
 "Clusters"	"Aglomerados"
 "Clusters, which are closer than this distance to each other, are merged."	"Agrupamentos, que est�o mais pr�ximos do que esta dist�ncia uns dos outros, s�o fundidos."
 "Coarse Resolution"	""
+"Coefficient 0"	""
 "Coefficient of Determination"	"Coeficiente de determina��o"
+"Coefficient of Variation"	""
+"Coincidence"	""
 "Cold Cloud"	"Nuvem fria"
 "Collect values"	"Colete os valores"
 "Collpase Options"	"Op��es de colapso"
@@ -967,6 +989,7 @@ TEXT	TRANSLATION
 "Cone (Up)"	"Cone (Acima)"
 "Cone (down)"	"Cone (baixo)"
 "Cone (up)"	"Cone (acima)"
+"Confirm"	""
 "Confirm file caching"	"Confirme o cache de arquivos"
 "Confusion"	"Confus�o"
 "Confusion Index"	"�ndice de confus�o"
@@ -1058,6 +1081,7 @@ TEXT	TRANSLATION
 "Copy Map to Clipboard [Ctrl+C]"	"Copiar mapa para a �rea de transfer�ncia[Ctrl+C]"
 "Copy Project to Database"	"Copiar projeto para o banco de dados"
 "Copy Project to..."	"Copiar projeto para..."
+"Copy Selected Shapes"	""
 "Copy Selection"	"Copiar sele��o"
 "Copy Selection to New Shapes Layer"	"Copiar sele��o para a nova camada shape"
 "Copy Settings from other Layer"	"Copiar configura��es para outra camada"
@@ -1092,7 +1116,6 @@ TEXT	TRANSLATION
 "Cosine Correction (Teillet et al. 1982)"	"Cosseno de corre��o (Teillet et al. 1982)"
 "Cost Analysis"	"An�lise de custos"
 "Could not connect to data source."	"N�o foi poss�vel conectar-se a fonte de dados."
-"Could not create data source."	"N�o foi poss�vel criar fonte de dados."
 "Could not create dataset."	"N�o foi poss�vel criar dataset."
 "Could not initialize grid projection."	"N�o foi poss�vel inicializar proje��o da grade."
 "Could not load project."	"N�o foi poss�vel carregar projeto."
@@ -1170,7 +1193,6 @@ TEXT	TRANSLATION
 "Curvature tolerance that defines 'planar' surface"	"Toler�ncia de curvatura que define a superf�cie plana"
 "Curve Number"	"N�mero de curvatura"
 "Cut"	"Cortar"
-"Cut Shapes Layer"	"Cortar camadas shapes"
 "Cuts"	"Cortes"
 "Cutting %s resulted in an empty point cloud, skipping output!"	"O corte de %s resultou em uma nuvem de pontos vazia, pulando para a sa�da!"
 "Cycles"	"Ciclos"
@@ -1260,9 +1282,11 @@ TEXT	TRANSLATION
 "Decimals"	"Decimais"
 "Decision"	"Decis�o"
 "Decision Tree"	"�rvore de Decis�o"
+"Decision Tree Classification (OpenCV)"	""
 "Decrease Diagram Size"	"Diminua o tamanho do diagrama"
 "Decrease Exaggeration [F1]"	"Diminuir exagero [F1]"
 "Decrease Eye Distance"	"Diminuir dist�ncia de vis�o"
+"Decrease Factor"	""
 "Decrease Legend Size"	"Diminuir tamanho da legenda"
 "Decrease Perspectivic Distance [F5]"	"Diminuir dist�ncia da perspectiva [F5]"
 "Decrease Size Scaling Factor [F7]"	"Diminuir tamanho do fator de escala[F7]"
@@ -1272,6 +1296,7 @@ TEXT	TRANSLATION
 "Deepen Drainage Routes"	"Aprofundar rotas de drenagem"
 "Default"	"Padr�o"
 "Default Filter Matrix (3x3)"	"Matriz de filtro padr�o (3x3)"
+"Default Number of Neighbours"	""
 "Default Reference Height"	"Altura Padr�o de Refer�ncia "
 "Default Rotation"	"Rota��o padr�o"
 "Default Size"	"Tamanho padr�o"
@@ -1384,6 +1409,7 @@ TEXT	TRANSLATION
 "Direction [Degree]"	"Dire��o [grau]"
 "Direction into which the wind blows, starting with 0 for North and increasing clockwise."	"Dire��o em que o vento sopra, come�ando com 0 para o Norte e crescente no sentido hor�rio."
 "Direction of Maximum Cost"	"Dire��o de custo m�ximo"
+"Direction of Measurement"	""
 "Direction of Minimum Standard Deviation"	"Dire��o de Desvio Padr�o M�nimo"
 "Direction of Plane [Degree]"	"Dire��o de Plano [Grau]"
 "Direction of the light source, measured in degree clockwise from the north direction."	"Dire��o da fonte de luz, medida em graus no sentido hor�rio a partir da dire��o norte."
@@ -1396,10 +1422,13 @@ TEXT	TRANSLATION
 "Disconnect All"	"Desconectar todos"
 "Disconnect from ODBC Source"	"Desligar da Fonte ODBC"
 "Disconnect from PostgreSQL"	"Desconectar do PostgreSQL"
+"Discrete AdaBoost"	""
 "Discrete Colors"	"Cores discretas"
 "Discretization"	"Discretiza��o"
 "Discretization Threshold"	"Limiar de discretiza��o"
 "Disparity Image"	"Disparidade de imagem"
+"Disparity Smoothness Parameter 1"	""
+"Disparity Smoothness Parameter 2"	""
 "Displacement Vector"	"Deslocamento de vetor"
 "Displacement vectors between correlated points"	"Deslocamento de vetores entre os pontos correlacionados"
 "Display"	"Mostrar"
@@ -1439,6 +1468,7 @@ TEXT	TRANSLATION
 "Do you want to delete the selection?"	"Voc� deseja apagar a sele��o?"
 "Do you want to exit SAGA?"	"Voc� deseja sair do SAGA?"
 "Dominance"	"Domin�ncia"
+"Dominance of Majority"	""
 "Dot And Dash"	"Ponto e tra�o"
 "Dot and dash style"	"Estilo do ponto e tra�o"
 "Dotted"	"Pontilhado"
@@ -1562,6 +1592,7 @@ TEXT	TRANSLATION
 "Error"	"Erro"
 "Error : Wrong table. Check table dimensions"	"Erro: tabela errada. Verificar as dimens�es da tabela"
 "Error : Wrong weights table. Check table dimensions"	"Erro: pesos errados da tabela. Verifique as dimens�es da tabela"
+"Error Change (Epsilon)"	""
 "Error change (epsilon)"	"Erro de altera��o (Epsilo)"
 "Error in Formula"	"Erro na f�rmula"
 "Error in Trend Calculation"	"Erro no c�lculo de tend�ncia"
@@ -1638,6 +1669,7 @@ TEXT	TRANSLATION
 "Export to File"	"Exportar para arquivo"
 "Expression"	"Express�o"
 "Extended Neighourhood"	"Vizinhan�a estendida"
+"Extension"	""
 "Extensions"	"Extens�es"
 "Extent"	"Extens�o"
 "Extent Definition"	""
@@ -1789,8 +1821,8 @@ TEXT	TRANSLATION
 "Fixed Time Span (minutes)"	"Intervalo de Tempo corrigido (minutos)"
 "Fixed Time Span Offset (minutes)"	"Intervalo de tempo de deslocamento corrigido (minutos)"
 "Fixed angle"	"�ngulo corrigido"
+"Fixed buffer distance given in map units."	""
 "Fixed value to be replaced"	"Valor corrigido para ser substituido"
-"Fixed|Cell value|"	"Corrigido!valor da c�lula!"
 "Flaechenverbrauch-Auswahl (FvA)"	"Flaechenverbrauch-Auswahl (FvA)"
 "Flame Length"	"Comprimento da chama"
 "Flame Length (m)"	"Comprimento da chama (m)"
@@ -1848,6 +1880,8 @@ TEXT	TRANSLATION
 "Focal Length [mm]"	"Dist�ncia Focal [mm]"
 "Folder"	"Pasta"
 "Folder for PDF Files"	"Pasta para arquivos PDF"
+"Following raster formats are currently supported:"	""
+"Following vector formats are currently supported:"	""
 "Font"	"Fonte"
 "Font size given as percentage of map size."	"Tamanho da fonte dado em porcentagem do tamanho do mapa."
 "Foot Hollow"	"Cavidade de base"
@@ -1891,6 +1925,8 @@ TEXT	TRANSLATION
 "Function Parameters"	"Par�metros da Fun��o"
 "Function Plotter"	"Fun��o plotadora"
 "Function failed because no attributes are available"	"A fun��o falhou porque h� atributos que n�o est�o dispon�veis"
+"Function's Alpha"	""
+"Function's Beta"	""
 "Fuzzified"	"Fuzificado"
 "Fuzzified Grid"	"Grade fuzificado"
 "Fuzzify"	"Fuzifica��o"
@@ -1957,6 +1993,7 @@ TEXT	TRANSLATION
 "Generalized Surface"	"Superf�cie generalizada"
 "Generate Shapes"	"Gerar shapes"
 "Generated Shapefile."	"Arquivos de shapes gerado"
+"Gentle AdaBoost"	""
 "Geo-Reference"	"Georefer�ncia"
 "GeoTIFF (*.tif)"	"GeoTIFF (*.tif)"
 "GeoTIFF Files"	"Arquivos GeoTIFF"
@@ -2034,7 +2071,6 @@ TEXT	TRANSLATION
 "Grid Manager"	"Gerenciador de grade"
 "Grid Masking"	"Mascara de grade"
 "Grid Normalisation"	"Normaliza��o de grade"
-"Grid Project"	"Projeto de grade"
 "Grid Proximity Buffer"	"Buffer de proximidade para grade"
 "Grid Skeletonization"	"Setoriza��o de grade"
 "Grid Spacing (Map Units)"	"Espa�amento da grade (unidades do mapa)"
@@ -2074,7 +2110,6 @@ TEXT	TRANSLATION
 "Grid with category of nearest source cell [Category]"	"Grade com categoria de c�lula de origem mais pr�xima [da categoria]"
 "Grid with euclidian distance to nearest source cell [grid units]"	"Grade com dist�ncia euclidiana a c�lula de origem mais pr�xima [unidades do raster]"
 "Grid with features to be buffered [Category/NoData]"	"Grade com fei��es que devem ser colocados o buffer [Categoria/SemDados]"
-"Grid with features to be buffered."	"Grade com fei��es a terem o buffer"
 "Grid with the input values to accumulate."	"Grade com valores de entrada para acumular."
 "Grid(s)"	"Grade(s)"
 "Gridding"	"Grindagem"
@@ -2103,6 +2138,7 @@ TEXT	TRANSLATION
 "Grow Factor"	"Fator de crescimento"
 "Gs"	"Gs"
 "Gz"	"Gz"
+"HH"	""
 "HTML"	"HTML"
 "Hafer"	"Hafer"
 "Half the size of the moving window [vertex count], controls smoothing sensitivity."	"Metade do tamanho da janela m�vel [contagem dev�rtice], controles de suaviza��o de sensibilidade."
@@ -2161,6 +2197,7 @@ TEXT	TRANSLATION
 "Horizontal Overland Flow Distance"	"Fluxo da dist�ncia horizontal terrestre"
 "Horizontal Range"	"Faixa Horizontal"
 "Horizontal hatch"	"Hachura horizontal"
+"Horizontally"	""
 "Host"	"Hospedeiro"
 "Hourly Data"	"Dados hora por hora"
 "How many trees to create?"	"Criar quantas �rvores?"
@@ -2209,6 +2246,7 @@ TEXT	TRANSLATION
 "Ice"	"Gelo"
 "Identifier"	"Identificador"
 "Identity"	"Identidade"
+"If CVFolds > 1 then algorithms prunes the built decision tree using K-fold cross-validation procedure where K is equal to CVFolds. Default value is 10."	""
 "If checked the snow module is active"	"Se selecionado, o m�dulo de neve est� ativo"
 "If checked, it means there is no external inflow to the subbasin"	"Se marcada, significa que n�o existe um influxo externo � sub-bacia"
 "If checked, snow-melt module is used."	"Se selecionado, o m�dulo de derretimento de neve � usado."
@@ -2221,8 +2259,13 @@ TEXT	TRANSLATION
 "If not specified the cache will be created in the current user's temporary directory."	"Se n�o for especificado, o cache ser� criado no diret�rio tempor�rio do usu�rio atual."
 "If set, output is given about the number of fields a flow path visits downhill. For D8 only."	"Se definido, a sa�da � dada sobre o n�mero de campos de uma via de fluxo visitada de declive. Somente para D8."
 "If table exists..."	"Se a tabela existe ..."
+"If the number of samples in a node is less than this parameter then the node will not be split."	""
+"If true then a pruning will be harsher. This will make a tree more compact and more resistant to the training data noise but a bit less accurate."	""
+"If true then pruned branches are physically removed from the tree. Otherwise they are retained and it is possible to get results from the original unpruned (or pruned less aggressively) tree."	""
+"If true then surrogate splits will be built. These splits allow to work with missing data and compute variable importance correctly."	""
 "Ignition Points"	"Pontos de igni��o "
 "Ignore Defaults"	"Ignorar padr�es"
+"Ignore Input Lists"	""
 "Ignore Lakes"	"Ignorar lagos"
 "Ignore No Data"	"Ignore sem-dados"
 "Illumination calculation"	"C�lculo de ilumina��o"
@@ -2316,6 +2359,7 @@ TEXT	TRANSLATION
 "Increase Diagram Size"	"Aumentar tamanho do diagrama"
 "Increase Exaggeration [F2]"	"Aumentar Exagero [F2]"
 "Increase Eye Distance"	"Aumentar dist�ncia de vis�o"
+"Increase Factor"	""
 "Increase Legend Size"	"Aumentar tamanho da legenda"
 "Increase Perspectivic Distance [F6]"	"Aumentar dist�ncia de perspectiva [F6]"
 "Increase Size Scaling Factor [F8]"	"Aumentar tamanho do fator de escala [F8]"
@@ -2341,6 +2385,7 @@ TEXT	TRANSLATION
 "Initial Number of Sharks [%]"	"N�mero inicial de tubar�es [%]"
 "Initial State"	"Estado inicial"
 "Initial Threshold for Slope"	"Limiar inicial para declive"
+"Initial Update Value"	""
 "Initial root zone storage deficit [m]"	"Zona inicial com d�ficit de armazenagem de raiz [m]"
 "Initial subsurface flow per unit area [m/h]"	"Escoamento subsuperficial inicial por unidade de �rea [m/h]"
 "Initial update value"	"Valor inicial de atualiza��o "
@@ -2445,6 +2490,7 @@ TEXT	TRANSLATION
 "Is the subbasin upstream (no external inflow)"	"� a sub-bacia a montante (sem fluxo externo)"
 "Isochrones Constant Speed"	"Velocidade is�crona constante"
 "Isochrones Variable Speed"	"Velocidade is�crona vari�vel"
+"Isothermality"	""
 "Iteration"	"Intera��o"
 "Iterationen"	"Intera��es"
 "Iterations"	"Intera��es"
@@ -2474,7 +2520,10 @@ TEXT	TRANSLATION
 "June"	"junho"
 "K Factor"	"Fator K"
 "K-Means Clustering for Grids"	"Clusteriza��o de grades por M�dias-K"
+"K-Nearest Neighbours Classification (OpenCV)"	""
+"KD Tree"	""
 "KE"	"KE"
+"KML file creation failed"	""
 "KML files (*.kml)"	"Arquivos KML (*.kml)"
 "KML/KMZ File"	"Arquivo KML/KMZ"
 "KML/KMZ Files"	"Arquivos KML/KMZ "
@@ -2659,6 +2708,7 @@ TEXT	TRANSLATION
 "Linke Turbidity Coefficient"	"Coeficiente de Turbidez de Linke"
 "List"	"Lista"
 "List ODBC Servers"	"Lista de servidores ODBC"
+"List Order"	""
 "List PostgreSQL Connections"	"Lista de conex�es PostgreSQL"
 "List Table Fields"	"Lista de campos da tabela"
 "List Tables"	"Lista de tabelas"
@@ -2724,6 +2774,7 @@ TEXT	TRANSLATION
 "Logarithmic Transformation"	"Transforma��o logar�tmica"
 "Logarithmic: a + b * ln(x)"	"Logar�tmica: a + b * ln(x)"
 "Login"	"Conecte-se"
+"LogitBoost"	""
 "Logo"	"Logotipo"
 "Lon. Down"	"Lon. Baixa"
 "Long Dashed"	"Long tracejada"
@@ -2763,6 +2814,7 @@ TEXT	TRANSLATION
 "Lower"	"Inferior"
 "Lower Border (Y)"	"Borda inferior (Y)"
 "Lower Tolerance"	"Baixa toler�ncia"
+"Lower Value Update Limit"	""
 "Lower left corner"	"Canto inferior esquerdo"
 "Loxodrome"	"Loxodrome"
 "Loxodromes"	"Loxodromes"
@@ -2829,6 +2881,7 @@ TEXT	TRANSLATION
 "MapQuest"	"MapQuest"
 "Maps"	"Mapas"
 "March"	"Mar�o"
+"Margin in percentage by which the best (minimum) computed cost function value should \"	""
 "Mark Highest Neighbour"	"Marcar maior vizinhan�a"
 "Mask"	"M�scara"
 "Mask Grid"	"Grade de m�scara"
@@ -2855,12 +2908,13 @@ TEXT	TRANSLATION
 "Maximimum Number of Samples"	"N�mero m�ximo de amostras"
 "Maximum"	"M�ximo"
 "Maximum Angle"	"�ngulo m�ximo"
+"Maximum Categories"	""
 "Maximum Cells (C Correction Analysis)"	"M�ximo de C�lulas (C An�lise de Corre��o)"
 "Maximum Contour Value"	"Valor m�ximo do contorno"
 "Maximum Curvature"	"Curvatura m�xima"
 "Maximum Deviation between estimated excess rainfall and observed streamflow volumes"	"Desvio m�ximo entre excesso estimado de chuvas e volumes de vaz�es observadas"
 "Maximum Deviation: ExcessRain-Streamflow [%]"	"Desvio m�ximo: ExcessRain-Streamflow [%]"
-"Maximum Disparity"	"Disparidade M�xima"
+"Maximum Disparity Difference"	""
 "Maximum Distance"	"Dist�ncia m�xima"
 "Maximum Distance [Cells]"	"Dist�ncia m�xima [c�lulas]"
 "Maximum Entropy"	"Entropia M�xima"
@@ -2868,6 +2922,7 @@ TEXT	TRANSLATION
 "Maximum Entropy Presence Prediction"	"Previs�o m�xima de presen�a de entropia"
 "Maximum Expansion Distance"	""
 "Maximum Flow Distance"	"Dist�ncia de fluxo m�ximo"
+"Maximum Flow Path Length"	""
 "Maximum Height"	"Altura m�xima"
 "Maximum Iterations"	"Intera��es m�ximas"
 "Maximum Level"	"N�vel m�ximo"
@@ -2886,13 +2941,18 @@ TEXT	TRANSLATION
 "Maximum Standard Deviation within a Cluster"	"Desvio padr�o m�ximo dentro de um cluster"
 "Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"	"Soma m�xima de superestimado excesso de chuvas totais em [%]"
 "Maximum Temperature"	"Temperatura m�xima"
+"Maximum Temperature of Warmest Month"	""
 "Maximum Time Span (Seconds)"	"Intervalo m�ximo de tempo (segundos)"
 "Maximum Total Order"	"Ordem m�xima total"
+"Maximum Tree Depth"	""
 "Maximum Value"	"Valor m�ximo"
 "Maximum X Order"	"Ordem m�xima de X"
 "Maximum Y Order"	"Ordem m�xima de Y"
+"Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check."	""
 "Maximum angular difference as degree between adjacent segment points."	"Diferen�a angular m�xima de grau entre os pontos de segmentos adjacentes."
 "Maximum deviation allowed between original and simplified curve [map units]."	"Desvio m�ximo permitido entre a curva original e simplificada [mapa de unidades]."
+"Maximum disparity minus minimum disparity. The value is always greater than zero."	""
+"Maximum disparity variation within each connected component. If you do speckle filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. Normally, 1 or 2 is good enough."	""
 "Maximum distance parameter is ignored if set to zero (default)."	"O par�metro da dist�ncia m�xima � ignorada se definido como zero (padr�o)."
 "Maximum entropy based classification and prediction."	"Classifica��o de entropia baseado na previs�o m�xima."
 "Maximum number of classes in entire grid."	"N�mero m�ximo de classes na grade inteira."
@@ -2903,6 +2963,7 @@ TEXT	TRANSLATION
 "Maximum resolution as percentage of the diameter of the DEM."	"Resolu��o m�xima em percentagem do di�metro do MDE."
 "Maximum root zone storage deficit [m]"	"D�ficit de armazenagem da zona m�xima de ra�zes [m]"
 "Maximum size"	"Tamanho m�ximo"
+"Maximum size of smooth disparity regions to consider their noise speckles and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the 50-200 range."	""
 "Maximum temperature:"	"Temperatura m�xima:"
 "Maximum value of the range to be reclassified."	"Valor m�ximo do intervalo que ser� reclassificado."
 "Maximun"	"M�ximo"
@@ -2911,12 +2972,17 @@ TEXT	TRANSLATION
 "Mean Average"	"M�dia da M�dia"
 "Mean Centre"	"Centro m�dia"
 "Mean Distance"	"Dist�ncia m�dia"
+"Mean Diurnal Range"	""
 "Mean Elevation"	"Eleva��o m�dia"
 "Mean Elevation [m.a.s.l]"	"Eleva��o m�dia [m.a.s.l]"
 "Mean Flow Distance"	"Dist�ncia m�dia de fluxo"
 "Mean Solar Irradiance"	"M�dia de irradi�ncia solar"
 "Mean Squared Error"	"Erro m�dio de enquadramento"
 "Mean Temperature"	"Temperatura m�dia"
+"Mean Temperature of Coldest Quarter"	""
+"Mean Temperature of Driest Quarter"	""
+"Mean Temperature of Warmest Quarter"	""
+"Mean Temperature of Wettest Quarter"	""
 "Mean Value"	"Valor m�dio"
 "Mean Value (cell area weighted)"	"M�dia do Valor (�rea celular ponderada)"
 "Mean less Standard Deviation"	"M�dia menos desvio padr�o"
@@ -2984,6 +3050,7 @@ TEXT	TRANSLATION
 "Minimum Curvature"	"Curvatura m�nima"
 "Minimum Density [Percent]"	"Densidade m�nima [por cento]"
 "Minimum Density for Interior Forest [Percent]"	"Densidade m�nima para Interior Floresta [por cento]"
+"Minimum Disparity"	""
 "Minimum Distance"	"Dist�ncia M�nima"
 "Minimum Distance Analysis"	"An�lise Dist�ncia M�nima"
 "Minimum Exaggeration [%]"	"Exagero m�nimo [%]"
@@ -2997,15 +3064,18 @@ TEXT	TRANSLATION
 "Minimum Number of Dark Object Cells"	"N�mero M�nimo de Objeto celas escuras"
 "Minimum Number of Points"	"N�mero m�nimo de pontos"
 "Minimum Number of Samples in a Cluster"	"N�mero m�nimo de amostras em um cluster"
+"Minimum Overlap"	""
 "Minimum Probability"	"Probabilidade m�nimo"
 "Minimum Redundancy Feature Selection"	"Sele��o de recursos de redund�ncia m�nimo"
 "Minimum Resolution (Degree)"	"Resolu��o M�nima (Grau)"
+"Minimum Sample Count"	""
 "Minimum Segment Length (Cells)"	"Comprimento m�nimo Segmento (Cells)"
 "Minimum Size [%]"	"Tamanho m�nimo [%]"
 "Minimum Slope"	"Inclina��o m�nima"
 "Minimum Slope [Degree]"	"Inclina��o m�nima [Grau]"
 "Minimum Standard Deviation"	"Desvio Padr�o M�nimo"
 "Minimum Temperature"	"Temperatura M�nima"
+"Minimum Temperature of Coldest Month"	""
 "Minimum Threshold"	"Limite m�nimo"
 "Minimum Value"	"Valor m�nimo"
 "Minimum Weight"	""
@@ -3017,6 +3087,7 @@ TEXT	TRANSLATION
 "Minimum number of neighbouring potential edge cells with similar direction."	"N�mero m�nimo de c�lulas de ponta potenciais vizinhos com sentido similar."
 "Minimum of Darkness DN Cells"	"M�nimo de Escurid�o DN Cells"
 "Minimum pixels to consider digital number as dark object"	"Pixels m�nimos para considerar o n�mero digital como objeto escuro"
+"Minimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly."	""
 "Minimum probability to accept a classification result for a cell."	"Probabilidade m�nima para aceitar um resultado de classifica��o para uma c�lula."
 "Minimum shade brightness must be lower than maximum shade brightness!"	"Brilho m�nimo sombra deve ser menor do que o brilho m�ximo sombra!"
 "Minimum size"	"Tamanho m�nimo"
@@ -3058,11 +3129,13 @@ TEXT	TRANSLATION
 "Modifed Quadratic Shepard"	"Modifed quadr�tica Shepard"
 "Modified"	"Modificado"
 "Modified Catchment Area"	"�rea de Capta��o de modifica��o"
+"Modified Hirschmuller"	""
 "Modify: post-processing..."	"Modificar: p�s-processamento ..."
 "Modify: pre-processing..."	"Modificar: pr�-processamento ..."
 "Module Library Template"	"Template Library Module"
 "Module My_Module"	"M�dulo My_Module"
 "Mollweide"	"Mollweide"
+"Moment Term"	""
 "Moment [h]"	"Momento [h]"
 "Moment term"	"Termo Moment"
 "Month"	"M�s"
@@ -3168,7 +3241,6 @@ TEXT	TRANSLATION
 "Neumann"	"Neumann"
 "Neumann (4)"	"Neumann (4)"
 "Neumann: the four horizontally and vertically neighboured cells; Moore: all eight adjacent cells"	"Neumann: as quatro c�lulas horizontal e vertical vizinhas; Moore: todas as oito c�lulas adjacentes"
-"Neural Networks (OpenCV)"	"Redes Neurais (OpenCV)"
 "New"	"Novo"
 "New Shapes Layer"	"Nova camada shapes"
 "New Table"	"Nova tabela"
@@ -3216,6 +3288,7 @@ TEXT	TRANSLATION
 "No sinks have been detected."	"Sem dissipadores detectados."
 "No translation set by user"	"Nenhuma tradu��o definida pelo usu�rio"
 "No-Data Value"	""
+"No-Data Value Range"	""
 "NoData Output Grid"	"Grade SemDados de sa�da"
 "NoData Value"	"Valor SemDados"
 "NoData Value: %.6f"	"NoData Valor:% .6f"
@@ -3228,6 +3301,7 @@ TEXT	TRANSLATION
 "Non-Sibsonian"	""
 "None"	"Nenhum"
 "Normal"	"Normal"
+"Normal Bayes Classification (OpenCV)"	""
 "Normal Updating"	"Atualiza��o normal"
 "Normal escarpment"	"Escarpa normal"
 "Normalisation"	"Normaliza��o"
@@ -3252,6 +3326,7 @@ TEXT	TRANSLATION
 "Nothing to do: there is no intersection with additional grid."	""
 "November"	"Novembro"
 "No|Yes|"	"N�o|Sim|"
+"Nu"	""
 "Number in Latitudinal Direction"	"N�mero de Dire��o Latitudinal"
 "Number in Meridional Direction"	"N�mero de Dire��o Meridional"
 "Number of Attributes"	"N�mero de Atributos"
@@ -3269,6 +3344,7 @@ TEXT	TRANSLATION
 "Number of Data Sets"	"N�mero de conjuntos de dados"
 "Number of Different Classes"	"N�mero de classes diferentes"
 "Number of Directions"	"N�mero de dire��es"
+"Number of Disparities"	""
 "Number of Distance Classes"	"N�mero de classes de dist�ncia"
 "Number of Elements"	"N�mero de elementos"
 "Number of Events"	"N�mero de Eventos"
@@ -3281,7 +3357,9 @@ TEXT	TRANSLATION
 "Number of Iterations"	"N�mero de itera��es"
 "Number of Iterations for Normal Updating"	"N�mero de itera��es para atualiza��o normal"
 "Number of Iterations for Vertex Updating"	"N�mero de itera��es para Atualiza��o Vertex"
+"Number of Layers"	""
 "Number of Maps"	"N�mero de mapas"
+"Number of Neurons"	""
 "Number of No-Data Cells"	"N�mero de c�lulas SemDados"
 "Number of Numeric Value Classes"	"N�mero de classes de valor num�rico"
 "Number of Pairs"	"N�mero de pares"
@@ -3484,6 +3562,7 @@ TEXT	TRANSLATION
 "Overview"	"Vis�o geral"
 "Overview Content"	"Vis�o geral do conte�do"
 "Overwrite"	"Sobrescrever"
+"P"	""
 "P/A"	"P/A"
 "P/sqrt(A)"	"P/sqrt(A)"
 "PATB"	"PATB"
@@ -3526,6 +3605,7 @@ TEXT	TRANSLATION
 "Parameter (p)"	"Par�metro (p)"
 "Parameter (p) [lower bound]"	"Par�metro (p) [limite inferior]"
 "Parameter (p) [upper bound]"	"Par�metro (p) [limite superior]"
+"Parameter for KD Tree implementation"	""
 "Parameter settings for No-Data and all other values."	"Ajustes de par�metros para Sem-dados e todos os outros valores."
 "Parameter settings for the NoData value of the output grid (header)."	"Ajustes de par�metros para o valor SemDados da grade de sa�da (cabe�alho)."
 "Parameters"	"Par�metros"
@@ -3729,8 +3809,15 @@ TEXT	TRANSLATION
 "Pre-defined Formulas"	"F�rmulas pr�-definidas"
 "Precipitation"	"Precipita��o"
 "Precipitation Column"	"Precipitation Coluna"
+"Precipitation Seasonality"	""
 "Precipitation [m / dt]"	"Precipita��o [m / dt]"
 "Precipitation [mm]"	"Precipita��o [mm]"
+"Precipitation of Coldest Quarter"	""
+"Precipitation of Driest Month"	""
+"Precipitation of Driest Quarter"	""
+"Precipitation of Warmest Quarter"	""
+"Precipitation of Wettest Month"	""
+"Precipitation of Wettest Quarter"	""
 "Precise Datum Conversion"	"Precise Datum Convers�o"
 "Precise Tracing"	"Rastreamento preciso"
 "Precision"	""
@@ -3747,6 +3834,9 @@ TEXT	TRANSLATION
 "Predictors"	"Preditores"
 "Preferred Routing"	"Encaminhamento preferencial"
 "Preferred Target Grid Type"	"Tipo preferencial da grade alvo"
+"Prefilter Size"	""
+"Prefilter Truncation Value"	""
+"Prefilter Type"	""
 "Preliminary scene analysis:"	"An�lise preliminar cena:"
 "Preprocessed DEM"	"DEM preprocessed"
 "Preprocessed DEM. If this is not set changes will be stored in the original DEM grid."	"MDE processado. Se isso n�o for definido, altera��es ser�o armazenadas na grade MDE original."
@@ -3900,6 +3990,7 @@ TEXT	TRANSLATION
 "Random"	"Rand�mico"
 "Random Field"	"Campo aleat�rio"
 "Random Forest Classification"	"Classifica��o aleat�ria de Floresta"
+"Random Forest Classification (OpenCV)"	""
 "Random Forest Classification (ViGrA)"	"Classifica��o aleat�ria de floresta (ViGrA)"
 "Random Forest Options"	"Op��es aleat�rias de floresta"
 "Random Forest Presence Prediction (ViGrA)"	"Predi��o aleat�ria de floresta (VIGrA)"
@@ -3933,6 +4024,7 @@ TEXT	TRANSLATION
 "Rayleigh atmosphere (diffuse sky irradiance)"	"Atmosfera de Rayleigh (irradi�ncia difusa do c�u)"
 "Rc"	"Rc"
 "Real"	"Real"
+"Real AdaBoost"	""
 "Real Surface Area"	"�rea real de superf�cie"
 "Real-valued Numerical Features"	"Fei��es Num�ricas com valor de reais"
 "Recalculate"	"Recalcular"
@@ -3963,6 +4055,7 @@ TEXT	TRANSLATION
 "Refresh"	"Atualizar"
 "Region of Interest"	"Regi�o de Interesse"
 "Regression"	"Regress�o"
+"Regression Accuracy"	""
 "Regression Analysis"	"An�lise de regress�o"
 "Regression Analysis (Points and Predictor Grid)"	"An�lise de regress�o (Pontos e grade preditor)"
 "Regression Details"	"Detalhes de Regress�o"
@@ -4047,6 +4140,7 @@ TEXT	TRANSLATION
 "Resulting Point Cloud."	"Nuvem de pontos resultante."
 "Resulting Value"	"Valor resultante"
 "Results"	"Resultados"
+"Returns resulting grid's no-data value"	""
 "Returns the floating point remainder of x/y"	"Retorna o resto de ponto flutuante de x/y"
 "Returns the integer part of floating point value x"	"Retorna a parte inteira de um valor em ponto flutuante x"
 "Returns the value of Pi"	"Retorna o valor de Pi"
@@ -4127,6 +4221,7 @@ TEXT	TRANSLATION
 "SAGA: Print Map"	"SAGA: Imprimir Mapa"
 "SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0"	"SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0"
 "SECTIONS"	"SE��ES"
+"SGBM 3 Way"	""
 "SHALSTAB"	"SHALSTAB"
 "SIZE"	"TAMANHO"
 "SL, estimation of mean soil loss [kg]"	"SL, a estimativa de perda m�dia de solo [kg]"
@@ -4325,6 +4420,8 @@ TEXT	TRANSLATION
 "Selection"	"Sele��o"
 "Selection Color"	"Sele��o de Cores"
 "Selection Method"	"M�todo de sele��o"
+"Semi-Global Block Matching"	""
+"Semicolon separated list of band indexes. Do not set to select all bands for import."	""
 "Semimajor Axis (a)"	"Semi-eixo (a)"
 "Semimajor Axis and Eccentricity"	"Semi-eixo e excentricidade"
 "Semimajor Axis and Eccentricity Squared"	"Semi-eixo e excentricidade esquadriada"
@@ -4448,6 +4545,7 @@ TEXT	TRANSLATION
 "Show Vertical Legend"	"Mostrar legenda vertical"
 "Show Vertices"	"Mostrar v�rtices"
 "Show a Composite"	"Mostrar um compositor"
+"Show a confirmation dialog before selection is performed"	""
 "Show at all scales"	"Mostrar em todas as escalas"
 "Show data sources tab for file system. Disabling might speed up start-up. Changes take effect after restart."	"Exibir fontes de dados guia para o sistema de arquivos. A desativa��o pode acelerar a inicializa��o. As altera��es t�m efeito ap�s o rein�cio do SAGA."
 "Shrink"	"Encolher"
@@ -4563,6 +4661,7 @@ TEXT	TRANSLATION
 "Snap to..."	"Atrair � ..."
 "Snow Module Parameters"	"Par�metros de m�dulo de neve"
 "Snow Module on/off"	"M�dulo de Neve on/off"
+"Sobel"	""
 "Soil"	"Solo"
 "Soil Adjusted Vegetation Index"	"�ndice de ajuste de vegeta��o do solo"
 "Soil Adjustment Factor"	"Fator de Ajuste do solo"
@@ -4638,6 +4737,8 @@ TEXT	TRANSLATION
 "Specifies stratification strategy. Either none, equal amount of class samples, or proportional to fraction of class samples."	"Especificar a estrat�gia de estratifica��o. Ou nenhuma, igual a quantidade de amostras de classes, ou proporcional � fra��o das amostras de classe."
 "Specifies the fraction of the total number of samples used per tree for learning."	"Especificar a frac��o do n�mero total de amostras usadas por �rvore para a aprendizagem."
 "Specify a threshold value as minimum difference between neighboured segments."	"Especificar um valor limiar de diferen�a m�nima entre os segmentos de vizinhan�a."
+"Speckle Range"	""
+"Speckle Window Size"	""
 "Spectral"	"Espectral"
 "Spectral Angle Mapping"	"Mapeamento de �ngulo espectral"
 "Spectral Angle Threshold (Degree)"	"Limiar de �ngulo espectral (Grau)"
@@ -4765,6 +4866,7 @@ TEXT	TRANSLATION
 "Supervised Classification for Shapes"	"Classifica��o supervisionado para shapes"
 "Supervised Classification for Tables"	"Classifica��o supervisionada para tabelas"
 "Support Vector Machine"	"Suporte para m�quina vetorial"
+"Support Vector Machine Classification (OpenCV)"	""
 "Surface"	"Superf�cie"
 "Surface Approximation Threshold"	"Limiar de aproxima��o da superf�cie"
 "Surface Area"	"�rea da superf�cie"
@@ -4875,12 +4977,14 @@ TEXT	TRANSLATION
 "Tasseled Cap Transformation"	"Transforma��o da tampa de borlas"
 "Temperature"	"Temperatura"
 "Temperature (2pm) [DegreeC]"	"Temperatura (14:00h) [graus C]"
+"Temperature Annual Range"	""
 "Temperature Column"	"Coluna da temperatura"
 "Temperature Gradient [Deg.Celsius/km]"	"Gradiente de temperatura[grau.Celsius/km]"
 "Temperature K1"	"K1 temperatura"
 "Temperature K2"	"K2 temperatura"
 "Temperature Modulation Factor (f)"	"Fator de modu��o de temperatura (f)"
 "Temperature Modulation Factor f"	"Fator de modula��o de temperatura f"
+"Temperature Seasonality"	""
 "Temperature Threshold for Melting"	"Limite de temperatura para fus�o"
 "Temperature Threshold for Melting (lower bound)"	"Limite de temperatura para fus�o (limite inferior)"
 "Temperature Threshold for Melting (upper bound)"	"Limite de temperatura para fus�o (limite superior)"
@@ -4894,6 +4998,7 @@ TEXT	TRANSLATION
 "Temporary files"	"Arquivos tempor�rios"
 "Tension Threshold"	"Limiar de tens�o"
 "Tension Threshold [Percentage of Cell Size]"	"Limiar de tens�o [porcentagem do tamanho celular]"
+"Termination criteria for regression trees. If all absolute differences between an estimated value in a node and values of train samples in this node are less than this parameter then the node will not be split further."	""
 "Termination criteria of the training algorithm. You can specify how much the error could change between the iterations to make the algorithm continue (epsilon)."	"Crit�rios de termina��o do algoritmo de treinamento. Voc� pode especificar o quanto o erro poderia mudar entre as itera��es para fazer o algoritmo continuar (epsilon)."
 "Termination criteria of the training algorithm. You can specify the maximum number of iterations."	"Crit�rios de termina��o do algoritmo de treinamento. Voc� pode especificar o n�mero m�ximo de itera��es."
 "Terrain"	"Terreno"
@@ -4929,6 +5034,7 @@ TEXT	TRANSLATION
 "Textdatei (*.txt)|*.txt|All Files|*.*"	"Textdatei (*.txt)|*.txt|Todos os arquivos|*.*"
 "Textdatei|*.txt|All Files|*.*"	"Textdatei|*.txt|Todos os arquivos|*.*"
 "Texture"	"Textura"
+"Texture Threshold"	""
 "The (numeric) fields to calculate the statistics for."	"Campos (num�ricos) para calculo das estat�sticas."
 "The GDAL dataset to be created."	"Conjunto de dados GDAL a ser criado."
 "The GDAL datatype of the created dataset."	"Tipo de dados GDAL do conjunto de dados criado."
@@ -4990,7 +5096,11 @@ TEXT	TRANSLATION
 "The input table"	"Tabela de entrada"
 "The input table."	"Tabela de entrada."
 "The inverse selection is not implemented for input shapefiles with more than one polygon!"	"Sele��o inversa n�o � implementada para shapefiles de entrada com mais de um pol�gono!"
+"The larger the value, the smoother the disparity. Parameter 1 is the penalty on the disparity change by plus or minus 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1."	""
+"The larger the value, the smoother the disparity. Parameter 2 is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1."	""
 "The length of the Gaussian window is too small, please provide a larger sigma."	"O comprimento da janela Gaussian � muito pequeno, por favor fornecer um sigma maior."
+"The linear size of the blocks compared by the algorithm. Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher chance for algorithm to find a wrong correspondence."	""
+"The maximum possible depth of the tree. That is the training algorithms attempts to split a node while its depth is less than maxDepth. The root node has zero depth."	""
 "The merged point cloud."	"Nuvem de pontos resultante da fus�o."
 "The method used to identify surface specific points."	"M�todo utilizado para identificar pontos espec�ficos da superf�cie."
 "The name to use for each field, separated by semicolon, e.g. \"	"Nome a ser usado para cada campo, separados por ponto e v�rgula, por exemplo, \"
@@ -4998,6 +5108,7 @@ TEXT	TRANSLATION
 "The number of smoothing iterations [-]."	"N�mero de itera��es de suaviza��o [-]."
 "The number of supplied grids exceeds the number of variables in formula."	"O n�mero de grades fornecidas excede o n�mero de vari�veis ??na f�rmula."
 "The number of supplied grids is less than the number of variables in formula."	"O n�mero de grades fornecidas � menos do que o n�mero de vari�veis ??na f�rmula."
+"The number of weak classifiers."	""
 "The numbers (starting from 1) of the fields to export, separated by semicolon, e.g. \"	"Os n�meros (a partir de 1) dos campos para exportar, separados por ponto e v�rgula, por exemplo, \"
 "The numbers (starting from 1) of the fields to import, separated by semicolon, e.g. \"	"Os n�meros (a partir de 1) dos campos para importar, separados por ponto e v�rgula, por exemplo, \"
 "The output grid(s)"	"Grade(s) de sa�da"
@@ -5016,6 +5127,7 @@ TEXT	TRANSLATION
 "The shaded DTM."	"DTM sombreado."
 "The shapefile to convert."	"Shapefile convers�o."
 "The shapefile to use for clipping."	"Shapefile a ser usado para recorte."
+"The size of the randomly selected subset of features at each tree node and that are used to find the best split(s). If you set it to 0 then the size will be set to the square root of the total number of features."	""
 "The smoothed output line shapefile."	"Shapefile de linhas de sa�da suavizadas."
 "The smoothing preservation factor [-]."	"Factor de preserva��o de alisamento [-]."
 "The start value to use for the identifier."	"Valor inicial a ser usado para o identificador."
@@ -5209,6 +5321,7 @@ TEXT	TRANSLATION
 "Train INPUT"	"Treinar ENTRADA"
 "Training Areas"	"�reas de forma��o"
 "Training Classes"	"Classes de treinamento"
+"Training Method"	""
 "Training Options"	"Op��es de treinamento"
 "Training method"	"M�todo de treinamento"
 "Transactions"	"Transa��es"
@@ -5260,6 +5373,9 @@ TEXT	TRANSLATION
 "True Latitude 1"	"Latitude de verdadeiro1"
 "True Latitude 2"	"Latitude verdadeiro2"
 "True Scale Latitude"	"Latitude de verdadeira escala "
+"Truncate Pruned Trees"	""
+"Truncation value for the prefiltered image pixels."	""
+"Truncation value for the prefiltered image pixels. The algorithm first computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. The result values are passed to the Birchfield-Tomasi pixel cost function."	""
 "TwFAC("	"TwFAC("
 "Two Parallel Storages"	"Dois armaz�ns paralelos"
 "Two Storages in Series"	"Dois armaz�ns em s�rie"
@@ -5300,6 +5416,7 @@ TEXT	TRANSLATION
 "Uniform"	"Uniforme"
 "Union"	"Uni�o"
 "Unique"	"�nico"
+"Uniqueness Ratio"	""
 "Unit"	"Unidade"
 "Unit Name"	"Nome da unidade"
 "Units"	"Unidades"
@@ -5315,6 +5432,7 @@ TEXT	TRANSLATION
 "Unreferenced Grids"	"Grades n�o referenciadas"
 "Unsaturated zone time delay per unit storage deficit [h]"	"Zona insaturada de tempo de atraso por d�ficit de armazenagem de unidade [h]"
 "Unsorted tool chains"	"Cadeias de ferramentas n�o triadas"
+"Unsplit"	""
 "Unsupervised"	"Sem supervis�o"
 "Up"	"Para cima"
 "Up [-]"	"Acima [-]"
@@ -5327,7 +5445,6 @@ TEXT	TRANSLATION
 "Update Shapes SRID"	"Atualizar shapes SRID"
 "Update View"	"Atualizar vista"
 "Update Views"	"Atualizar visualiza��es"
-"Update cluster view while clustering."	"Atualizar vista cluster enquanto agrupamento."
 "Update the network weights"	"Atualizar os pesos da rede"
 "Update values lower limit"	"Atualizar de valores do-limite mais baixo"
 "Update values upper limit"	"Atualizar valores do limite superior"
@@ -5338,6 +5455,7 @@ TEXT	TRANSLATION
 "Upper Slopes"	"Encostas superiores"
 "Upper Slopes, Mesas"	"Encostas superiores, Mesas"
 "Upper Tolerance"	"Toler�ncia superior"
+"Upper Value Update Limit"	""
 "Upscaling Method"	"M�todo de aumento de resolu��o"
 "Upslope Area"	"�reas aplainadas"
 "Upslope Basins"	"Bacias aplainadas"
@@ -5350,6 +5468,7 @@ TEXT	TRANSLATION
 "Upslope Weighting"	"Pondera��o de aclive "
 "Upslope and Downslope Curvature"	"Curvatura de aclive e declive"
 "Urban"	"Urbano"
+"Use 1SE Rule"	""
 "Use 5 percent confidence interval"	"Usar intervalo de confian�a de 5 por cento"
 "Use Confidence Interval"	"Usar Intervalo de confian�a"
 "Use Flow Threshold"	"Usar limiar de fluxo"
@@ -5359,6 +5478,7 @@ TEXT	TRANSLATION
 "Use Offset"	"Usar deslocamento"
 "Use Pyramids"	"Usar pir�mides"
 "Use Surfer's No-Data Value"	"Usar valores SemDados de surfista"
+"Use Surrogates"	""
 "Use Target Area Polygon"	"Usar �rea do pol�gono alvo"
 "Use Z-Range"	"Usar o alcance-Z"
 "Use a user-specified elevation range instead of min/max of the input dataset"	"Usar um intervalo eleva��o especificado pelo usu�rio em vez de min/max do conjunto de dados de entrada"
@@ -5428,6 +5548,7 @@ TEXT	TRANSLATION
 "Value as RGB Code"	"Valor como c�digo RGB"
 "Value in Grid 1"	"Valor na grade 1"
 "Value in Grid 2"	"Valor na grade 2"
+"Value of Majority"	""
 "Value of Target Function"	"Valor da fun��o de destino"
 "Value of right cells in the Mask Grid"	"Valor de c�lulas da direita na grade de m�scara"
 "Value range"	"Faixa de valores"
@@ -5487,6 +5608,7 @@ TEXT	TRANSLATION
 "Vertical Scaling"	"Escala vertical"
 "Vertical hatch"	"Escotilha vertical"
 "Vertical scaling factor"	"Fator de escala vertical"
+"Vertically"	""
 "Vertices"	"V�rtices"
 "Vertikale Zufluesse"	"Vertikale Zufluesse"
 "ViGrA"	"ViGrA"
@@ -5550,9 +5672,12 @@ TEXT	TRANSLATION
 "Watershed Basins (Extended)"	"Bacias hidrogr�ficas (Extendidas)"
 "Watershed Segmentation"	"Segmenta��o de bacias hidrogr�ficas"
 "Watershed Segmentation (ViGrA)"	"Segmenta��o de Bacias Hidrogr�ficas (ViGrA)"
+"Weak Count"	""
 "Weather Records"	"Registros do Tempo"
 "Web Service Data Access"	"Acesso a dados Web Service"
 "Weight"	"Peso"
+"Weight Gradient Term"	""
+"Weight Trim Rate"	""
 "Weight for grid "	"Peso para grade"
 "Weight gradient term"	"Peso termo gradiente"
 "Weighted"	"Pesada"
@@ -5668,6 +5793,7 @@ TEXT	TRANSLATION
 "Year [ka]"	"Ano [ka]"
 "Yoshimasa Tsuruoka"	"Yoshimasa Tsuruoka"
 "You can specify the number of layers in the network (including input and output layer)."	"Voc� pode especificar o n�mero de camadas na rede (incluindo a camada de entrada e sa�da)."
+"You can specify the number of layers in the network (not including input and output layer)."	""
 "You can specify the number of neurons in each layer of the network."	"Voc� pode especificar o n�mero de neur�nios de cada camada na rede."
 "You canceled printing"	"Voc� cancelou a impress�o"
 "You must specify a reclass table with a minimium (field 1), a maximum (field 2) and a code value (field 3)!\n"	"Voc� apenas especifica uma tabela de reclassifica��o dom o m�nimo (campo 1), um m�ximo (campo 2) e um valor de c�digo (campo 3)!\n"
@@ -5717,6 +5843,7 @@ TEXT	TRANSLATION
 "[FLD] Index Layer"	"[FLD] �ndice da camada"
 "[FLD] SVG File"	"[FLD] Arquivo SVG "
 "[MSG] Save as Interactive SVG"	"[MSG] Salvar como arquivo Interativo SVG"
+"[deprecated] Neural Networks (OpenCV)"	""
 "[deprecated] Point Cloud Viewer"	"[obsoleta] Visualizador de nuvem de pontos"
 "[deprecated] TIN Viewer"	"[obsoleta] Visualizador TIN "
 "[not set]|"	"[n�o definida] |"
@@ -5808,6 +5935,7 @@ TEXT	TRANSLATION
 "b(q)"	"b(q)"
 "b(q) [lower bound]"	"b(q) [limite inferior]"
 "b(q) [upper bound]"	"b(q) [limite superior]"
+"back propagation"	""
 "backward"	"para tr�s"
 "band transformation"	"transforma��o de banda"
 "band width search"	"busca de largura de banda"
@@ -5830,7 +5958,6 @@ TEXT	TRANSLATION
 "blend boundary"	"limite de mistura"
 "blending distance given in map units"	"dist�ncia de mistura dada em unidades do mapa"
 "blue channel color"	"cor do canal azul "
-"bm"	"bm"
 "both"	"ambos"
 "bottom"	"inferior"
 "bottom / left"	"inferior / esquerdo"
@@ -5841,10 +5968,12 @@ TEXT	TRANSLATION
 "bottom-right"	"inferior direito"
 "bounding box for clipping"	""
 "bright - dark"	"claro - escuro"
+"brute force"	""
 "built-in"	"constru�das em"
 "by area size"	"por tamanho da �rea"
 "by number of cells"	"por n�mero de c�lulas"
 "c, Percentage clays [%]"	"c, argilas percentuais [%]"
+"c-support vector classification"	""
 "cache memory size in MB"	"tamanho do cache de mem�ria em MB"
 "calculate averages"	"calcular m�dias"
 "calculate from grid system"	"calcular, a partir do sistema da grade"
@@ -5863,12 +5992,11 @@ TEXT	TRANSLATION
 "cell size of target grid"	""
 "cell size to bottom-top extent"	""
 "cell size to left-right extent"	""
+"cell's value"	""
 "cells"	"c�lulas"
 "cells in process"	"C�lulas no processo"
-"cellsize and lower left center coordinates"	"tamano da c�lula e coordenadas menores do centro-esquerda"
-"cellsize and lower left corner coordinates"	"tamanho da c�lula ecoordenadas canto inferior esquerdo"
-"cellsize and upper left center coordinates"	"tamanho da c�lula e cotas do centro superior esquerdo"
-"cellsize and upper left corner coordinates"	"tamanho da c�lula e coordenadas do canto superior esquerdo"
+"cellsize and lower left cell coordinates"	""
+"cellsize and upper left cell coordinates"	""
 "center"	"centro"
 "center cell's aspect direction"	"dire��o do aspecto da c�lula central"
 "centered"	"centralisado"
@@ -5945,7 +6073,6 @@ TEXT	TRANSLATION
 "could not connect ODBC source"	"n�o foi poss�vel se conectar � fonte ODBC"
 "could not connect to PostgreSQL source"	"n�o foi poss�vel se conectar � fonte de PostgreSQL"
 "could not connect to database."	"n�o poderia estar conectado � base de dados."
-"could not create KML file"	"n�o foi poss�vel criar arquivo KML"
 "could not create distance grid"	"n�o conseguiu criar grade de dist�ncia"
 "could not create geometry field"	"n�o foi poss�vel criar campo da geometria"
 "could not create index on observations"	"n�o foi poss�vel criar �ndice em observa��es"
@@ -6002,6 +6129,7 @@ TEXT	TRANSLATION
 "cross"	"atravessar"
 "cubic convolution"	"convolu��o c�bica"
 "cubic surface"	"superf�cie c�bica"
+"custom"	""
 "cyan - white"	"ciano - branco"
 "dX"	"dX"
 "dX (Map Units)"	"dX (Mapa de unidades)"
@@ -6017,6 +6145,7 @@ TEXT	TRANSLATION
 "dark object subtraction 4"	"subtra��o de objetoescuro 4"
 "data / no-data"	"dados / SemDados"
 "data file could not be openend"	"arquivo de dados n�o p�de ser aberto"
+"data set creation failed"	""
 "data set has no attributes"	"conjunto de dados n�o tem atributos"
 "database table does not exist"	"a tabela de banco do dados n�o existe"
 "date"	"data"
@@ -6025,8 +6154,7 @@ TEXT	TRANSLATION
 "dbf read: could not read header"	"leitura dbf: n�o foi poss�vel ler o cabe�alho"
 "dbf write: could open file"	"escrita dbf: p�de abrir arquivo"
 "dbf write: invalid table"	"escrita dbf: tabela inv�lida"
-"dd.mm.yy"	"dd.mm.yy"
-"dd:mm:yy"	"dd:mm:yy"
+"dd:mm:yyyy"	""
 "ddmmyy, fix size"	"ddmmyy, corrigir tamanho"
 "ddmmyyyy, fix size"	"ddmmyyyy, fix size"
 "default"	"padr�o"
@@ -6058,6 +6186,7 @@ TEXT	TRANSLATION
 "distance"	"dist�ncia"
 "distance weighted average catchment slope"	"inclina��o de dist�ncia m�dia ponderada de capta��o "
 "distance weighted average of the number of different categories for distance classes"	"diferentes categorias para as classes de dist�ncia"
+"distribution estimation (one class)"	""
 "do not confirm"	"n�o confirmam"
 "do not join"	"n�o aderir"
 "do not show"	"n�o mostrar"
@@ -6065,6 +6194,7 @@ TEXT	TRANSLATION
 "do not update"	"n�o atualizar"
 "down"	"diminui��o"
 "downscaling"	"diminui��o gradual"
+"downstream"	""
 "dragging a box"	"arrastando uma caixa"
 "driver not found."	"o controlador n�o foi encontrado."
 "dropping table"	"soltar tabela"
@@ -6091,6 +6221,7 @@ TEXT	TRANSLATION
 "empty or corrupted file"	"arquivo vazio ou corrompido"
 "enumeration"	"enumera��o"
 "epsilon in loss function of epsilon-SVR"	"epsilon em fun��o de perda de epsilon-SVR"
+"epsilon support vector regression"	""
 "epsilon-SVR"	"epsilon-SVR"
 "equal"	"igual"
 "equal intervals"	"intervalos iguais"
@@ -6110,6 +6241,7 @@ TEXT	TRANSLATION
 "explained cumulative variance"	"vari�ncia acumulada explicada"
 "explained variance"	"vari�ncia explicada"
 "exponential"	"exponencial"
+"exponential chi2"	""
 "export grid"	"exportar grade"
 "extent of lake, coded with local water depth"	"extens�o do lago, codificado com profundidade de �gua local"
 "extent of lake, coded with water depth"	"extens�o do lago, codificado com profundidade de �gua"
@@ -6121,6 +6253,7 @@ TEXT	TRANSLATION
 "failed to create polygon clipping mask"	"n�o foi poss�vel criar m�scara de corte de pol�gono"
 "failed to create searche engine"	"n�o foi poss�vel criar motor de pesquisa"
 "failed to estimate target extent"	"n�o foi possivel estimar extens�o alvo"
+"failed to import subset"	""
 "failed to initialise search engine"	"falhou ao inicializar motor de busca"
 "failed to initialize target grid"	"Falha ao inicializar a grade alvo"
 "failed to launch default application"	"n�o foi poss�vel lan�ar o aplicativo padr�o"
@@ -6132,6 +6265,8 @@ TEXT	TRANSLATION
 "failed to project target grid"	"n�o conseguiu projetar grade alvo"
 "failed to retrieve map image data"	"n�o foi poss�vel recuperar dados de imagem do mapa"
 "failed to set radius"	"Falha ao definir raio"
+"failed to store data"	""
+"failed to write data"	""
 "failed: could not find a suitable import driver"	"falhou: n�o foi poss�vel encontrar um controlador de importa��o adequado"
 "fat"	"gordo/expesso"
 "feathering"	"difus�o"
@@ -6217,13 +6352,13 @@ TEXT	TRANSLATION
 "heads and mouths..."	"cabe�as e bocas ..."
 "height"	"altura"
 "height of sun above horizon (degree)"	"altura do sol acima do horizonte (grau)"
-"hh"	"hh"
 "hh.mm.ss"	"hh.mm.ss"
 "hh:mm:ss"	"hh: mm: ss"
 "hhmmss, fix size"	"hhmmss, corrigir tamanho"
 "high"	"altura"
 "highest"	"mais alta"
 "highest z"	"maior z"
+"histogram intersection"	""
 "histogram match"	"combinar histograma"
 "horizontal"	"horizontal"
 "horizontally"	"horizontal"
@@ -6261,6 +6396,7 @@ TEXT	TRANSLATION
 "initialisation error"	"erro de inicializa��o"
 "initialization"	"inicializa��o"
 "initialization failed"	"falha na inicializa��o"
+"initializing"	""
 "input"	"entrada"
 "input file"	"Arquivo de entrada"
 "instable (thawing)"	"inst�vel (descongela��o)"
@@ -6362,7 +6498,6 @@ TEXT	TRANSLATION
 "loaded tool libraries"	"bibliotecas de ferramentas carregadas"
 "loading"	"carregando"
 "loading OSM data"	"carregamento de dados OSM"
-"loading band"	"banda de carregamento"
 "loading building parts"	"partes de constru��o de carregamento"
 "loading failed"	"o carregamento falhou"
 "loading spatial reference system database"	"carregando banco de dados do sistema de refer�ncia espacial"
@@ -6378,9 +6513,9 @@ TEXT	TRANSLATION
 "lower and upper thresholds for semantic import model, planar vs. sloped areas"	"limiares inferiores e superiores para o modelo de importa��o sem�ntica, planar vs. �reas inclinadas"
 "lower and upper thresholds for semantic import model, straight vs. curved areas"	"limiares inferiores e superiores para o modelo de importa��o sem�ntica, �reas vs. curvado retas"
 "lower cell's value to neighbours minimum value minus epsilon"	"menor valor da c�lula para os vizinhos valor m�nimo menos epsilon"
-"lower left and upper right center coordinates"	"coordenadas centro-direita para a esquerda e superiores mais baixas"
 "lower left and upper right coordinates"	""
-"lower left and upper right corner coordinates"	"mais baixas coordenadas do canto direito esquerdo e superior"
+"lower left cell coordinates and left to right range"	""
+"lower left cell coordinates and lower to upper range"	""
 "lower left coordinate and number of rows and columns"	""
 "lowest"	"menor"
 "lowest z"	"menor z"
@@ -6437,6 +6572,7 @@ TEXT	TRANSLATION
 "minimum"	"m�nimo"
 "minimum number of points to use"	"n�mero m�nimo de pontos para utiliza��o"
 "minimum number of upslope contributing cells to start a channel"	"n�mero m�nimo de c�lulas aplainadas contribuindo para iniciar um canal"
+"minimum overlapping area as percentage of the total size of the input shape. applies to polygon layers only."	""
 "minimum requirement"	"requerimento m�nimo"
 "minimum slope angle preserved from one cell to the next, zero results in flat areas [Degree]"	"�ngulo de inclina��o m�nimo preservado de uma c�lula para as pr�ximas, zero resultados em �reas planas [Grau]"
 "minimum value"	"valor m�nimo"
@@ -6550,6 +6686,7 @@ TEXT	TRANSLATION
 "nonlinear"	"n�o-linear"
 "normalize (0-1)"	"normalizar (0-1)"
 "normalized"	"normalizada"
+"normalized response"	""
 "normal|down under|"	"normal|embaixo|"
 "not a PostGIS database"	"n�o um banco de dados PostGIS"
 "not a valid PostGIS database!"	"n�o � um banco de dados PostGIS v�lido!"
@@ -6567,6 +6704,8 @@ TEXT	TRANSLATION
 "nothing to do: input format is same as output format"	"nada a fazer: o formato de entrada � o mesmo que o formato de sa�da"
 "nothing to do: no data in selection"	"nada a fazer: n�o h� dados na sele��o"
 "nothing to do: original and desired field types are identical"	"nada a fazer: originais e campo desejado tipos s�o id�nticos"
+"nu support vector classification"	""
+"nu support vector regression"	""
 "nu-SVC"	"nu-SVC"
 "nu-SVR"	"nu-SVR"
 "number of added polygons"	"n�mero de pol�gonos adicionadas"
@@ -6685,6 +6824,7 @@ TEXT	TRANSLATION
 "post-processing..."	"p�s-processamento..."
 "power of distance"	"inicializa��o de dist�ncia"
 "prediction"	"predi��o"
+"preparing"	""
 "preparing distance calculation..."	"preparar o c�lculo de dist�ncia ..."
 "press any key"	"aperte qualquer tecla"
 "processed DEM"	"MDE processado"
@@ -6727,6 +6867,7 @@ TEXT	TRANSLATION
 "redonda-ovaloredonda"	"redonda-ovaloredonda"
 "regression"	"regress�o"
 "regression analysis could not detect a significant predictor"	"A an�lise de regress�o n�o conseguiu detectar um preditor significativo"
+"regression model"	""
 "regression model applied to predictor grids"	"modelo de regress�o aplicado �s grades de previs�o"
 "regression model applied to predictor grids with interpolated residuals added"	"modelo de regress�o aplicado ao preditor de grades com res�duos interpolados adicionados"
 "relative"	"relativo"
@@ -6741,6 +6882,7 @@ TEXT	TRANSLATION
 "resampling"	"reamostragem"
 "resampling cell size is too large"	"o tamanho da c�lula de reamostragem � demasiado grande"
 "rescale to 0 - 255"	"redimensionar para 0 - 255"
+"resilient propagation"	""
 "resolution"	"resolu��o"
 "resolution has to be greater than zero"	"a resolu��o tem de ser maior que zero"
 "resolution measured in screen pixels"	""
@@ -6798,7 +6940,6 @@ TEXT	TRANSLATION
 "set"	"conjunto"
 "set greater one for line smoothing"	"definir mais um para a suaviza��o de linha"
 "set input"	"entrada de ajuste"
-"sgbm"	"SGBM"
 "shading"	"sombreamento"
 "shading (fixed light source)"	"sombreamento (fonte luminosa fixa)"
 "shape file could not be opened."	"arquivo de shape n�o p�de ser aberto."
@@ -6825,6 +6966,7 @@ TEXT	TRANSLATION
 "single"	"solteira"
 "single class"	"classe �nica"
 "single flow direction"	"dire��o de fluxo �nico"
+"single value"	""
 "single|range|simple table|user supplied table|"	"simples|alcance|tabela simples|tabela fornecida pelo usu�rio|"
 "size range as percentage of step"	"faixa de tamanho de percentagem da etapa"
 "slim"	"esbelto/fino"
@@ -6887,6 +7029,7 @@ TEXT	TRANSLATION
 "target's spatial reference system is undefined"	"o sistema de refer�ncia espacial do alvo � indefinido"
 "text"	"texto"
 "the lower this value is the stronger is the suction effect"	"quanto menor este valor �, mais forte � o efeito de suc��o"
+"there has to be one input grid for each month"	""
 "theta"	"theta"
 "thick"	"espesso"
 "thin"	"fino"
@@ -6921,6 +7064,7 @@ TEXT	TRANSLATION
 "training"	"treinamento"
 "training failed"	"a forma��o falhou"
 "transaction started"	"transa��o iniciada"
+"translation"	""
 "triangle (down)"	"tri�ngulo (para baixo)"
 "triangle (up)"	"tri�ngulo (para cima)"
 "trying to drop table"	"tentando largar tabela"
@@ -6942,7 +7086,6 @@ TEXT	TRANSLATION
 "unknown projection"	"proje��o desconhecida"
 "unkown"	"desconhecido"
 "unmatched parentheses"	"par�nteses n�o-casados"
-"unnamed"	"an�nimo"
 "unsigned 1 byte integer"	"Inteiro n�o assinado de 1 byte"
 "unsigned 2 byte integer"	"inteiro de 2 bytes n�o assinado"
 "unsigned 4 byte integer"	"inteiro de 4 byte n�o assinado"
@@ -6956,6 +7099,7 @@ TEXT	TRANSLATION
 "up"	"acima"
 "upscaling of predictors"	"escalonamento de preditores"
 "upsetting model domain"	"modelo de dom�nio perturbador"
+"upstream"	""
 "use a zero value for hillslopes, any other value for channel cells."	"usar um valor zero para encostas, qualquer outro valor para as c�lulas do canal."
 "use more averaged elevations when looking at increasing distances"	"usar eleva��es mais m�dias quando se observa para dist�ncias cada vez maiores"
 "use old version for constant wind direction (no acceleration and averaging option)"	"usar a vers�o antiga para a dire��o do vento constante (sem acelera��o e uma m�dia de op��o)"
@@ -6969,7 +7113,7 @@ TEXT	TRANSLATION
 "using cellsize"	"usando tamano da c�lula"
 "valid data cells match original grid extent"	"c�lulas de dados v�lidos correspondem a extens�o da grade inicial"
 "value at mouse position"	"valor na posi��o do mouse"
-"var"	"var"
+"value range"	""
 "variable and height levels have to be of same number"	"n�veis de vari�veis ??de altura e tem que ser do mesmo n�mero"
 "variable type"	"tipo de vari�vel"
 "variable type + original name"	"tipo de vari�vel + nome original"
@@ -7011,9 +7155,8 @@ TEXT	TRANSLATION
 "yellow > green"	"amarelo > verde"
 "yellow > red"	"amarelo > vermelho"
 "yes"	"sim"
-"yy.mm.dd"	"yy.mm.dd"
-"yy:mm:dd"	"yy:mm:dd"
 "yymmdd, fix size"	"yymmdd, corrigir tamanho"
+"yyyy:mm:dd"	""
 "yyyymmdd, fix size"	"yyyymmdd, corrigir tamanho"
 "z values"	"z valores"
 "z, Percentage silt [%]"	"Z, Percentagem de silt [%]"
diff --git a/src/saga_core/saga_gui/res/saga.ger.txt b/src/saga_core/saga_gui/res/saga.ger.txt
index e942786..00f6108 100644
--- a/src/saga_core/saga_gui/res/saga.ger.txt
+++ b/src/saga_core/saga_gui/res/saga.ger.txt
@@ -174,7 +174,6 @@ TEXT	TRANSLATION
 "3D Image"	"3D Bild"
 "3D Image Height"	"3D Bild H�he"
 "3D Image Width"	"3D Bild Breite"
-"3D Points"	""
 "3D Shapes Viewer"	"3D Vektorbetrachter"
 "3D View"	"3D Ansicht"
 "3D View Sequencer"	""
@@ -228,10 +227,12 @@ TEXT	TRANSLATION
 "A"	"A"
 "A SAGA module to create transects through polygon files."	"Ein SAGA Modul zum Erzeugen von Transsekten durch Polygonvektoren."
 "A Simple Litter System"	"Ein einfaches Lebensdauersystem"
+"A grid providing information about the channel network. It is assumed that no-data cells are not part of the channel network. Vice versa all others cells are recognised as channel network members."	""
 "A grid that contains elevation data."	"Eine Rasterdatei die H�hendaten enth�lt."
 "A set of basic SAGA module programming examples."	"Ein Satz grundlegender Beispiele f�r die Modulprogrammierung."
 "A space separated list of key-value pairs (K=V)."	""
 "A text file with the full path to an input point cloud on each line"	""
+"A threshold between 0 and 1 used to save computational time. Set this parameter to 0 to turn off this functionality."	""
 "A3 Landscape"	"A3 Querformat"
 "A3 Portrait"	"A3 Hochformat"
 "A4 Landscape"	"A4 Querformat"
@@ -245,6 +246,7 @@ TEXT	TRANSLATION
 "A:Grid|Tools"	""
 "A:Grid|Values"	""
 "A:Imagery|Classification"	"A:Bildverarbeitung|Klassifizierung"
+"A:Imagery|Classification|Machine Learning (OpenCV)"	""
 "A:Imagery|Fourier Analysis"	""
 "A:Imagery|Segmentation"	""
 "A:Imagery|Tools"	"A:Bildverarbeitung|Werkzeuge"
@@ -274,6 +276,7 @@ TEXT	TRANSLATION
 "AOI does not intersect bounding box of SPCVF, nothing to do!"	""
 "AOI does not intersect with any bounding box of the SPCVF datasets, nothing to do!"	""
 "AOI does not intersect with any point of the SPCVF datasets, nothing to do!"	""
+"AOI_Cutter"	""
 "AQ("	""
 "AREA"	"FL�CHE"
 "AS("	""
@@ -319,7 +322,9 @@ TEXT	TRANSLATION
 "Action"	""
 "Activate Grid File Cache?"	"Dateipuffer f�r Raster aktivieren?"
 "Activate file caching automatically, if memory size exceeds the threshold value."	"Dateipuffer f�r Raster automatisch aktivieren, wenn Speicherbedarf Schwellenwert �berschreitet."
+"Activation Function"	""
 "Activation function"	""
+"Active Variable Count"	""
 "Add"	""
 "Add All"	""
 "Add All Fields"	""
@@ -385,6 +390,7 @@ TEXT	TRANSLATION
 "Albers Equal Area Conic"	"Albers fl�chentreue Kegelprojektion"
 "Alessandro Perego"	""
 "Algorithm"	""
+"Algorithm Type"	""
 "Algorithm for the detection of Surface Specific Points"	"Algorithmus f�r die Erfassung charakteristischer Oberfl�chenpunkte"
 "Alignment"	""
 "All"	""
@@ -407,6 +413,7 @@ TEXT	TRANSLATION
 "Allows writing cell values from additional grids to the output"	""
 "Alpha"	""
 "Alpha Max (Degree)"	"Alpha Max (Grad)"
+"Alphanumeric Sorting"	""
 "Alternatives"	""
 "Altura de llama"	""
 "Altura de llama (m)"	""
@@ -433,6 +440,8 @@ TEXT	TRANSLATION
 "Angular Step Size (Degree)"	""
 "Annual"	""
 "Annual Course of Daily Insolation"	""
+"Annual Mean Temperature"	""
+"Annual Precipitation"	""
 "Appearance"	""
 "Append Fields from another Table"	""
 "Append Rows from ..."	""
@@ -469,6 +478,7 @@ TEXT	TRANSLATION
 "Arithmetic mean (version 1)"	"arithmetriisches Mittel (Version 1)"
 "Arithmetic mean (version 2)"	"Arithmetrisches Mittel (Version 2)"
 "Arrange Icons"	""
+"Artificial Neural Network Classification (OpenCV)"	""
 "Aspect"	"Standpunkt"
 "Aspect Units"	""
 "Aspect grid, in radians and 360 degree from north."	""
@@ -615,10 +625,12 @@ TEXT	TRANSLATION
 "Binary Encoding"	"bin�res Verschl�sseln"
 "Binary Erosion-Reconstruction"	""
 "Binary object mask"	""
+"Bioclimatic Variables"	""
 "Birth Rate of Fishes"	"Geburtsrate von Fischen"
 "Birth Rate of Sharks"	"Geburtsrate von Haien"
 "Blending Distance"	""
 "Block Kriging"	"Block Kriging"
+"Block Matching"	""
 "Block Size"	"Block Gr��e"
 "Blocks"	"Bl�cke"
 "Blue"	"Blau"
@@ -629,6 +641,8 @@ TEXT	TRANSLATION
 "Boehner's Simple Language (BSL) is a macro script language for grid based calculations."	"Boehner`s Simple Language (BSL) ist eine Macroscriptsprache f�r rasterbasierte Berechnungen."
 "Bonne"	""
 "Boolean"	""
+"Boost Type"	""
+"Boosting Classification (OpenCV)"	""
 "Border"	"Grenze"
 "Border Color"	""
 "Borders"	"Grenzen"
@@ -653,7 +667,6 @@ TEXT	TRANSLATION
 "Buffer Size [MB]"	"Puffergr��e [MB]"
 "Buffer distance"	"Pufferdistanz"
 "Buffer distance (grid units)."	"Pufferdistanz (Rastereinheiten)."
-"Buffer distance [map units]."	"Pufferdistanz [Karteneinheiten]."
 "Build Histogram..."	""
 "Buildings"	""
 "Bulk density top layer"	""
@@ -686,6 +699,7 @@ TEXT	TRANSLATION
 "CRS Dictionary"	"CRS Verzeichnis"
 "CSV Files (*.csv)"	"CSV Dateien (*.csv)"
 "CUMUL"	""
+"CV Folds"	""
 "Cache"	""
 "Cache Directory"	""
 "Cache Size"	""
@@ -720,6 +734,7 @@ TEXT	TRANSLATION
 "Catchment Area Calculation"	""
 "Catchment area"	"Einzugsbereich Fl�che"
 "Catchment slope"	"Einzugsbereich Gef�lle"
+"Categorical Coincidence"	""
 "Categorical Features"	""
 "Categorical Grids"	""
 "Categories"	""
@@ -729,6 +744,7 @@ TEXT	TRANSLATION
 "Cell Count (X)"	"Zellen Z�hlen (X)"
 "Cell Count (Y)"	"Zellen Z�hlen (Y)"
 "Cell Height"	"Zellenh�he"
+"Cell Reference"	""
 "Cell Size"	"Zellen Gr��e"
 "Cell Sizes"	"Zellengr��e"
 "Cell size"	"Zellgr��e"
@@ -762,6 +778,7 @@ TEXT	TRANSLATION
 "Change Time Format"	"�nder Zeitformat"
 "Change Vector"	"�ndere Vektor"
 "Change Vector Analysis"	"Ver�nderungsvektor Analyse"
+"Change a Grid's No-Data Value"	""
 "Change all values within radius."	""
 "Changed"	""
 "Changed Grid"	"Ge�ndertes Raster"
@@ -884,6 +901,7 @@ TEXT	TRANSLATION
 "Clipping Options"	"Ausschneide Optionen"
 "Close"	"Schlie�en"
 "Close All"	"Alles Schlie�en"
+"Close All But This"	""
 "Close Gaps"	"Schlie�e L�cken"
 "Close Gaps with Spline"	"Schlie�e L�cken mit Spline"
 "Close Gaps with Stepwise Resampling"	""
@@ -901,11 +919,15 @@ TEXT	TRANSLATION
 "Cluster Analysis (Shapes)"	""
 "Cluster Analysis PC"	"Clusteranalyse f�r Punktwolken"
 "Cluster Analysis for Point Clouds"	"Clusteranalyse f�r Punktwolken"
+"Cluster possible values of a categorical variable into K<=maxCategories clusters to find a suboptimal split."	""
 "ClusterID"	"Cluster ID"
 "Clusters"	"Cluster"
 "Clusters, which are closer than this distance to each other, are merged."	""
 "Coarse Resolution"	""
+"Coefficient 0"	""
 "Coefficient of Determination"	"Bestimmtheitsma�"
+"Coefficient of Variation"	""
+"Coincidence"	""
 "Cold Cloud"	""
 "Collect values"	"Sammele Werte"
 "Collpase Options"	""
@@ -967,6 +989,7 @@ TEXT	TRANSLATION
 "Cone (Up)"	"Kegel (aufw�rts)"
 "Cone (down)"	"Kegel (abw�rts)"
 "Cone (up)"	"Kegel (aufw�rts)"
+"Confirm"	""
 "Confirm file caching"	"Dateipufferaktivierung jedesmal best�tigen"
 "Confusion"	""
 "Confusion Index"	""
@@ -1058,6 +1081,7 @@ TEXT	TRANSLATION
 "Copy Map to Clipboard [Ctrl+C]"	""
 "Copy Project to Database"	""
 "Copy Project to..."	""
+"Copy Selected Shapes"	""
 "Copy Selection"	""
 "Copy Selection to New Shapes Layer"	"Kopiere Auswahl zu Neuer Vektorebene"
 "Copy Settings from other Layer"	""
@@ -1092,7 +1116,6 @@ TEXT	TRANSLATION
 "Cosine Correction (Teillet et al. 1982)"	"Kosinus-Korrektur (Teillet et al. 1982)"
 "Cost Analysis"	""
 "Could not connect to data source."	""
-"Could not create data source."	"Datenquelle kann nicht erstellt werden."
 "Could not create dataset."	"Datensatz kann nicht erzeugt werden."
 "Could not initialize grid projection."	""
 "Could not load project."	"Kann Projekt nicht laden."
@@ -1170,7 +1193,6 @@ TEXT	TRANSLATION
 "Curvature tolerance that defines 'planar' surface"	""
 "Curve Number"	"Kurve Nummer"
 "Cut"	"Schnitt"
-"Cut Shapes Layer"	"Schneide Vektorebene zu"
 "Cuts"	"Schnitte"
 "Cutting %s resulted in an empty point cloud, skipping output!"	""
 "Cycles"	"Zyklen"
@@ -1260,9 +1282,11 @@ TEXT	TRANSLATION
 "Decimals"	""
 "Decision"	""
 "Decision Tree"	""
+"Decision Tree Classification (OpenCV)"	""
 "Decrease Diagram Size"	""
 "Decrease Exaggeration [F1]"	""
 "Decrease Eye Distance"	""
+"Decrease Factor"	""
 "Decrease Legend Size"	""
 "Decrease Perspectivic Distance [F5]"	""
 "Decrease Size Scaling Factor [F7]"	""
@@ -1272,6 +1296,7 @@ TEXT	TRANSLATION
 "Deepen Drainage Routes"	"Vertiefen der Entw�sserungsrouten"
 "Default"	"Voreinstellung"
 "Default Filter Matrix (3x3)"	"Voreinstellung Filter Matrix (3x3)"
+"Default Number of Neighbours"	""
 "Default Reference Height"	""
 "Default Rotation"	""
 "Default Size"	"Vorgegebene Gr��e"
@@ -1384,6 +1409,7 @@ TEXT	TRANSLATION
 "Direction [Degree]"	"Richtung [Grad]"
 "Direction into which the wind blows, starting with 0 for North and increasing clockwise."	""
 "Direction of Maximum Cost"	""
+"Direction of Measurement"	""
 "Direction of Minimum Standard Deviation"	"Richtung der minimalen Standardabweichung"
 "Direction of Plane [Degree]"	"Richtung der Fl�che [Grad]"
 "Direction of the light source, measured in degree clockwise from the north direction."	"Richtung der Lichtquelle, gemessen in Grad im Uhrzeigersinn von Norden."
@@ -1396,10 +1422,13 @@ TEXT	TRANSLATION
 "Disconnect All"	""
 "Disconnect from ODBC Source"	""
 "Disconnect from PostgreSQL"	""
+"Discrete AdaBoost"	""
 "Discrete Colors"	""
 "Discretization"	""
 "Discretization Threshold"	""
 "Disparity Image"	""
+"Disparity Smoothness Parameter 1"	""
+"Disparity Smoothness Parameter 2"	""
 "Displacement Vector"	""
 "Displacement vectors between correlated points"	""
 "Display"	"Anzeige"
@@ -1439,6 +1468,7 @@ TEXT	TRANSLATION
 "Do you want to delete the selection?"	"Soll die Auswahl entfernt werden?"
 "Do you want to exit SAGA?"	"Wollen Sie SAGA beenden?"
 "Dominance"	"Dominanz"
+"Dominance of Majority"	""
 "Dot And Dash"	""
 "Dot and dash style"	"Punkt-Strich-Stil"
 "Dotted"	""
@@ -1562,6 +1592,7 @@ TEXT	TRANSLATION
 "Error"	"Fehler"
 "Error : Wrong table. Check table dimensions"	"Fehler : Falsche Tabelle. Pr�fe Tabellenabmessungen"
 "Error : Wrong weights table. Check table dimensions"	"Fehler : Falsche Wichtungstabelle. Pr�fe Tabellenabmessunge"
+"Error Change (Epsilon)"	""
 "Error change (epsilon)"	""
 "Error in Formula"	"Fehler in Formel"
 "Error in Trend Calculation"	"Fehler in Trendberechnung"
@@ -1638,6 +1669,7 @@ TEXT	TRANSLATION
 "Export to File"	""
 "Expression"	"Ausdruck"
 "Extended Neighourhood"	"erweiterte Nachbarschaft"
+"Extension"	""
 "Extensions"	""
 "Extent"	"Umfang"
 "Extent Definition"	""
@@ -1789,8 +1821,8 @@ TEXT	TRANSLATION
 "Fixed Time Span (minutes)"	""
 "Fixed Time Span Offset (minutes)"	""
 "Fixed angle"	"Fester Winkel"
+"Fixed buffer distance given in map units."	""
 "Fixed value to be replaced"	"Auszutauschender fester Wert"
-"Fixed|Cell value|"	"Fest|Zellwert|"
 "Flaechenverbrauch-Auswahl (FvA)"	""
 "Flame Length"	"Flammenl�nge"
 "Flame Length (m)"	"Flammenl�nge (m)"
@@ -1848,6 +1880,8 @@ TEXT	TRANSLATION
 "Focal Length [mm]"	""
 "Folder"	"Ordner"
 "Folder for PDF Files"	"Ordner f�r PDF-Dateien"
+"Following raster formats are currently supported:"	""
+"Following vector formats are currently supported:"	""
 "Font"	""
 "Font size given as percentage of map size."	""
 "Foot Hollow"	""
@@ -1891,6 +1925,8 @@ TEXT	TRANSLATION
 "Function Parameters"	"Funktionsparameter"
 "Function Plotter"	""
 "Function failed because no attributes are available"	"Funktion schlug fehl, weil keine Attribute verf�gbar sind."
+"Function's Alpha"	""
+"Function's Beta"	""
 "Fuzzified"	"unscharf"
 "Fuzzified Grid"	"unscharfes Raster"
 "Fuzzify"	"Unsch�rfe"
@@ -1957,6 +1993,7 @@ TEXT	TRANSLATION
 "Generalized Surface"	""
 "Generate Shapes"	"Erzeuge Vektoren"
 "Generated Shapefile."	"Erzeuge Vektordatei."
+"Gentle AdaBoost"	""
 "Geo-Reference"	"Georeferenz"
 "GeoTIFF (*.tif)"	""
 "GeoTIFF Files"	""
@@ -2034,7 +2071,6 @@ TEXT	TRANSLATION
 "Grid Manager"	"Rasterverwaltung"
 "Grid Masking"	"Raster Abdeckung"
 "Grid Normalisation"	"Raster Normierung"
-"Grid Project"	"Raster Projekt"
 "Grid Proximity Buffer"	"Raster Nachbarschaftspuffer"
 "Grid Skeletonization"	"Raster Ger�st"
 "Grid Spacing (Map Units)"	""
@@ -2074,7 +2110,6 @@ TEXT	TRANSLATION
 "Grid with category of nearest source cell [Category]"	"Raster mit Gruppen n�chster Ausgangszellen [Kategorie]"
 "Grid with euclidian distance to nearest source cell [grid units]"	"Raster mit euklidischer Entfernung zu n�chsten Ausgangszellen [Rastereinheiten]"
 "Grid with features to be buffered [Category/NoData]"	"Raster mit Merkmalen die zu puffern sind [Kategorie/NoData]"
-"Grid with features to be buffered."	""
 "Grid with the input values to accumulate."	""
 "Grid(s)"	"Raster"
 "Gridding"	""
@@ -2103,6 +2138,7 @@ TEXT	TRANSLATION
 "Grow Factor"	""
 "Gs"	""
 "Gz"	""
+"HH"	""
 "HTML"	""
 "Hafer"	"Hafer"
 "Half the size of the moving window [vertex count], controls smoothing sensitivity."	""
@@ -2161,6 +2197,7 @@ TEXT	TRANSLATION
 "Horizontal Overland Flow Distance"	"Horizontale �ber Land Str�mungsdistanz"
 "Horizontal Range"	"Horizontaler Bereich"
 "Horizontal hatch"	"horizontale Schraffur"
+"Horizontally"	""
 "Host"	""
 "Hourly Data"	"St�ndliche Daten"
 "How many trees to create?"	""
@@ -2209,6 +2246,7 @@ TEXT	TRANSLATION
 "Ice"	"Eis"
 "Identifier"	"Bezeichner"
 "Identity"	""
+"If CVFolds > 1 then algorithms prunes the built decision tree using K-fold cross-validation procedure where K is equal to CVFolds. Default value is 10."	""
 "If checked the snow module is active"	"Wenn abgehakt ist das Schneemodul aktiv"
 "If checked, it means there is no external inflow to the subbasin"	"Wenn abgehakt, gibt es keinen externen Zustrom zu dem Teilbecken"
 "If checked, snow-melt module is used."	"Wenn abgehakt wird das Schneeschmelzmodul benutzt."
@@ -2221,8 +2259,13 @@ TEXT	TRANSLATION
 "If not specified the cache will be created in the current user's temporary directory."	""
 "If set, output is given about the number of fields a flow path visits downhill. For D8 only."	""
 "If table exists..."	"Wenn Tabelle existiert..."
+"If the number of samples in a node is less than this parameter then the node will not be split."	""
+"If true then a pruning will be harsher. This will make a tree more compact and more resistant to the training data noise but a bit less accurate."	""
+"If true then pruned branches are physically removed from the tree. Otherwise they are retained and it is possible to get results from the original unpruned (or pruned less aggressively) tree."	""
+"If true then surrogate splits will be built. These splits allow to work with missing data and compute variable importance correctly."	""
 "Ignition Points"	"Z�ndungspunkte"
 "Ignore Defaults"	"�bergehe Vorgaben"
+"Ignore Input Lists"	""
 "Ignore Lakes"	""
 "Ignore No Data"	""
 "Illumination calculation"	""
@@ -2316,6 +2359,7 @@ TEXT	TRANSLATION
 "Increase Diagram Size"	""
 "Increase Exaggeration [F2]"	""
 "Increase Eye Distance"	""
+"Increase Factor"	""
 "Increase Legend Size"	""
 "Increase Perspectivic Distance [F6]"	""
 "Increase Size Scaling Factor [F8]"	""
@@ -2341,6 +2385,7 @@ TEXT	TRANSLATION
 "Initial Number of Sharks [%]"	"Anfangsanzahl von Haien [%]"
 "Initial State"	"Anfangszustand"
 "Initial Threshold for Slope"	"Anfangsschwellenwert f�r das Gef�lle"
+"Initial Update Value"	""
 "Initial root zone storage deficit [m]"	"Anfangswurzelzonen Speicher Defizit [m]"
 "Initial subsurface flow per unit area [m/h]"	"Anf�ngliche unterirdische Str�mung pro Fl�cheneinheit [m/h]"
 "Initial update value"	""
@@ -2445,6 +2490,7 @@ TEXT	TRANSLATION
 "Is the subbasin upstream (no external inflow)"	"Ist der Teilbecken gegenstrom (kein externer Zustrom)"
 "Isochrones Constant Speed"	"Isochrone konstante Geschwindigkeit"
 "Isochrones Variable Speed"	"Isochrone variable Geschwindigkeit"
+"Isothermality"	""
 "Iteration"	"Iteration"
 "Iterationen"	"Iterationen"
 "Iterations"	"Iterationen"
@@ -2474,7 +2520,10 @@ TEXT	TRANSLATION
 "June"	"Juni"
 "K Factor"	""
 "K-Means Clustering for Grids"	""
+"K-Nearest Neighbours Classification (OpenCV)"	""
+"KD Tree"	""
 "KE"	""
+"KML file creation failed"	""
 "KML files (*.kml)"	""
 "KML/KMZ File"	""
 "KML/KMZ Files"	""
@@ -2659,6 +2708,7 @@ TEXT	TRANSLATION
 "Linke Turbidity Coefficient"	""
 "List"	"Liste"
 "List ODBC Servers"	""
+"List Order"	""
 "List PostgreSQL Connections"	""
 "List Table Fields"	""
 "List Tables"	""
@@ -2724,6 +2774,7 @@ TEXT	TRANSLATION
 "Logarithmic Transformation"	"Logarithmische Transformation"
 "Logarithmic: a + b * ln(x)"	"Logarithmisch: a + b * ln(x)"
 "Login"	""
+"LogitBoost"	""
 "Logo"	"Logo"
 "Lon. Down"	"L�ngengrad abw�rts"
 "Long Dashed"	""
@@ -2763,6 +2814,7 @@ TEXT	TRANSLATION
 "Lower"	""
 "Lower Border (Y)"	"Untere Grenze (Y)"
 "Lower Tolerance"	"Untere Toleranz"
+"Lower Value Update Limit"	""
 "Lower left corner"	"Untere linke Ecke"
 "Loxodrome"	""
 "Loxodromes"	""
@@ -2829,6 +2881,7 @@ TEXT	TRANSLATION
 "MapQuest"	""
 "Maps"	"Karten"
 "March"	"M�rz"
+"Margin in percentage by which the best (minimum) computed cost function value should \"	""
 "Mark Highest Neighbour"	"markiere h�chsten Nachbarn"
 "Mask"	"Abdeckung"
 "Mask Grid"	"Abdeckung Raster"
@@ -2855,12 +2908,13 @@ TEXT	TRANSLATION
 "Maximimum Number of Samples"	"Maximale Anzahl Proben"
 "Maximum"	"Maximum"
 "Maximum Angle"	""
+"Maximum Categories"	""
 "Maximum Cells (C Correction Analysis)"	"Maximum Zellen (C Korrekturanalyse)"
 "Maximum Contour Value"	"Maximaler Isolinienwert"
 "Maximum Curvature"	""
 "Maximum Deviation between estimated excess rainfall and observed streamflow volumes"	"Maximale Abwewichung zwischen abgesch�tzten Niederschlagsereignissen und beobachteten Abflussvolumina"
 "Maximum Deviation: ExcessRain-Streamflow [%]"	"Maximale Abweichung: �berschussregen-Abfluss [%]"
-"Maximum Disparity"	""
+"Maximum Disparity Difference"	""
 "Maximum Distance"	"Maximale Entfernung"
 "Maximum Distance [Cells]"	"Maximale Entfernung (Zellen)"
 "Maximum Entropy"	""
@@ -2868,6 +2922,7 @@ TEXT	TRANSLATION
 "Maximum Entropy Presence Prediction"	""
 "Maximum Expansion Distance"	""
 "Maximum Flow Distance"	"Maximale Flie�entfernung"
+"Maximum Flow Path Length"	""
 "Maximum Height"	""
 "Maximum Iterations"	"Maximale Iterationen"
 "Maximum Level"	"Maximalpegel"
@@ -2886,13 +2941,18 @@ TEXT	TRANSLATION
 "Maximum Standard Deviation within a Cluster"	""
 "Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"	"Maximale Summe von �bereingesch�tztem �berschussregen zu totalem �berschussregen in [%]"
 "Maximum Temperature"	""
+"Maximum Temperature of Warmest Month"	""
 "Maximum Time Span (Seconds)"	""
 "Maximum Total Order"	"Maximale Gesamtanordnung"
+"Maximum Tree Depth"	""
 "Maximum Value"	"Maximaler Wert"
 "Maximum X Order"	"Maximum X Reihenfolge"
 "Maximum Y Order"	"Maximum Y Reihenfolge"
+"Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check."	""
 "Maximum angular difference as degree between adjacent segment points."	""
 "Maximum deviation allowed between original and simplified curve [map units]."	""
+"Maximum disparity minus minimum disparity. The value is always greater than zero."	""
+"Maximum disparity variation within each connected component. If you do speckle filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. Normally, 1 or 2 is good enough."	""
 "Maximum distance parameter is ignored if set to zero (default)."	"Maximaler Entfernungsparameter wird ignoriert wenn auf null gesetzt (Voreinstellung)."
 "Maximum entropy based classification and prediction."	""
 "Maximum number of classes in entire grid."	"maximale Anzahl der Klassen in vollst�ndigem Raster"
@@ -2903,6 +2963,7 @@ TEXT	TRANSLATION
 "Maximum resolution as percentage of the diameter of the DEM."	"Maximale Aufl�sung als Prozentsatz des Durchmesser des DGM."
 "Maximum root zone storage deficit [m]"	"Maximales Wurzelzonenspeicherdefizit [m]"
 "Maximum size"	"Maximalgr��e"
+"Maximum size of smooth disparity regions to consider their noise speckles and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the 50-200 range."	""
 "Maximum temperature:"	""
 "Maximum value of the range to be reclassified."	"Maximaler Wert des neueinzuteilendes Bereiches"
 "Maximun"	"Maximum"
@@ -2911,12 +2972,17 @@ TEXT	TRANSLATION
 "Mean Average"	"Mittelwert Durchschnitt"
 "Mean Centre"	"Mittelwert Zentrum"
 "Mean Distance"	"Mittlere Entfernung"
+"Mean Diurnal Range"	""
 "Mean Elevation"	"Mittlere Anhebung"
 "Mean Elevation [m.a.s.l]"	"Mittlere Anhebung [m.a.s.l] "
 "Mean Flow Distance"	"Mittlere Flie�entfernung"
 "Mean Solar Irradiance"	""
 "Mean Squared Error"	""
 "Mean Temperature"	""
+"Mean Temperature of Coldest Quarter"	""
+"Mean Temperature of Driest Quarter"	""
+"Mean Temperature of Warmest Quarter"	""
+"Mean Temperature of Wettest Quarter"	""
 "Mean Value"	"Mittlerer Wert"
 "Mean Value (cell area weighted)"	"Mittlerer Wert (Zellbereich gewichtet)"
 "Mean less Standard Deviation"	"Mittelwert abz�glich Standardabweichung"
@@ -2984,6 +3050,7 @@ TEXT	TRANSLATION
 "Minimum Curvature"	""
 "Minimum Density [Percent]"	"Minimale Dichte [Prozent]"
 "Minimum Density for Interior Forest [Percent]"	"Minimale Dichte f�r inneren Wald [Prozent]"
+"Minimum Disparity"	""
 "Minimum Distance"	"Minimaldistanz"
 "Minimum Distance Analysis"	"Minimale Entfernung Analyse"
 "Minimum Exaggeration [%]"	"Minimale �berh�hung [%]"
@@ -2997,15 +3064,18 @@ TEXT	TRANSLATION
 "Minimum Number of Dark Object Cells"	""
 "Minimum Number of Points"	"Minimale Anzahl von Punkten"
 "Minimum Number of Samples in a Cluster"	""
+"Minimum Overlap"	""
 "Minimum Probability"	""
 "Minimum Redundancy Feature Selection"	""
 "Minimum Resolution (Degree)"	""
+"Minimum Sample Count"	""
 "Minimum Segment Length (Cells)"	"Minimale Segmentl�nge (Zellen)"
 "Minimum Size [%]"	"Minimale Gr��e [%]"
 "Minimum Slope"	""
 "Minimum Slope [Degree]"	"Minimale Neigung [Grad]"
 "Minimum Standard Deviation"	"Minimale Standardabweichung"
 "Minimum Temperature"	""
+"Minimum Temperature of Coldest Month"	""
 "Minimum Threshold"	""
 "Minimum Value"	"minimaler Wert"
 "Minimum Weight"	""
@@ -3017,6 +3087,7 @@ TEXT	TRANSLATION
 "Minimum number of neighbouring potential edge cells with similar direction."	""
 "Minimum of Darkness DN Cells"	""
 "Minimum pixels to consider digital number as dark object"	""
+"Minimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly."	""
 "Minimum probability to accept a classification result for a cell."	""
 "Minimum shade brightness must be lower than maximum shade brightness!"	""
 "Minimum size"	"Minimalgr��e"
@@ -3058,11 +3129,13 @@ TEXT	TRANSLATION
 "Modifed Quadratic Shepard"	"Modifizierte quadratische Shepard-Methode"
 "Modified"	""
 "Modified Catchment Area"	""
+"Modified Hirschmuller"	""
 "Modify: post-processing..."	"�ndern: Nachbearbeitung..."
 "Modify: pre-processing..."	"�ndern: Vorbearbeitung..."
 "Module Library Template"	"Modulbibliothek Vorlage"
 "Module My_Module"	""
 "Mollweide"	""
+"Moment Term"	""
 "Moment [h]"	""
 "Moment term"	""
 "Month"	"Monat"
@@ -3168,7 +3241,6 @@ TEXT	TRANSLATION
 "Neumann"	""
 "Neumann (4)"	""
 "Neumann: the four horizontally and vertically neighboured cells; Moore: all eight adjacent cells"	""
-"Neural Networks (OpenCV)"	""
 "New"	"Neu"
 "New Shapes Layer"	"Neue Vektorebene"
 "New Table"	"Neue Tabelle"
@@ -3216,6 +3288,7 @@ TEXT	TRANSLATION
 "No sinks have been detected."	"Keine Senken gefunden."
 "No translation set by user"	"Keine �bersetzung durch den Nutzer ausgew�hlt"
 "No-Data Value"	""
+"No-Data Value Range"	""
 "NoData Output Grid"	""
 "NoData Value"	"NoDATA Wert"
 "NoData Value: %.6f"	""
@@ -3228,6 +3301,7 @@ TEXT	TRANSLATION
 "Non-Sibsonian"	""
 "None"	"Nichts"
 "Normal"	""
+"Normal Bayes Classification (OpenCV)"	""
 "Normal Updating"	""
 "Normal escarpment"	""
 "Normalisation"	"Normalisation"
@@ -3252,6 +3326,7 @@ TEXT	TRANSLATION
 "Nothing to do: there is no intersection with additional grid."	""
 "November"	"November"
 "No|Yes|"	"Nein|Ja|"
+"Nu"	""
 "Number in Latitudinal Direction"	""
 "Number in Meridional Direction"	""
 "Number of Attributes"	"Anzahl der Attribute"
@@ -3269,6 +3344,7 @@ TEXT	TRANSLATION
 "Number of Data Sets"	""
 "Number of Different Classes"	"Anzahl verschiedener Klassen"
 "Number of Directions"	"Anzahl der Richtungen"
+"Number of Disparities"	""
 "Number of Distance Classes"	"Anzahl der Entfernungsklassen"
 "Number of Elements"	"Anzahl der Elemente"
 "Number of Events"	"Anzahl der Ereignisse"
@@ -3281,7 +3357,9 @@ TEXT	TRANSLATION
 "Number of Iterations"	""
 "Number of Iterations for Normal Updating"	""
 "Number of Iterations for Vertex Updating"	""
+"Number of Layers"	""
 "Number of Maps"	""
+"Number of Neurons"	""
 "Number of No-Data Cells"	""
 "Number of Numeric Value Classes"	""
 "Number of Pairs"	"Anzahl der Paare"
@@ -3484,6 +3562,7 @@ TEXT	TRANSLATION
 "Overview"	"�berblick"
 "Overview Content"	""
 "Overwrite"	""
+"P"	""
 "P/A"	""
 "P/sqrt(A)"	"P/Quadratwurzel(A)"
 "PATB"	""
@@ -3526,6 +3605,7 @@ TEXT	TRANSLATION
 "Parameter (p)"	"Parameter (p)"
 "Parameter (p) [lower bound]"	"Parameter (p) [untere Grenze]"
 "Parameter (p) [upper bound]"	"Parameter (p) [obere Grenze]"
+"Parameter for KD Tree implementation"	""
 "Parameter settings for No-Data and all other values."	"Parametereinstellungen f�r No-Data und alle anderen Werte."
 "Parameter settings for the NoData value of the output grid (header)."	""
 "Parameters"	"Parameterliste"
@@ -3729,8 +3809,15 @@ TEXT	TRANSLATION
 "Pre-defined Formulas"	"Vordefinierte Formel"
 "Precipitation"	"Niederschlag"
 "Precipitation Column"	"Niederschlag Spalte"
+"Precipitation Seasonality"	""
 "Precipitation [m / dt]"	""
 "Precipitation [mm]"	"Niederschlag [mm]"
+"Precipitation of Coldest Quarter"	""
+"Precipitation of Driest Month"	""
+"Precipitation of Driest Quarter"	""
+"Precipitation of Warmest Quarter"	""
+"Precipitation of Wettest Month"	""
+"Precipitation of Wettest Quarter"	""
 "Precise Datum Conversion"	""
 "Precise Tracing"	"genaue Spurverfolgung"
 "Precision"	""
@@ -3747,6 +3834,9 @@ TEXT	TRANSLATION
 "Predictors"	"Vorhersager"
 "Preferred Routing"	""
 "Preferred Target Grid Type"	"Bevorzugter Zielrastertyp"
+"Prefilter Size"	""
+"Prefilter Truncation Value"	""
+"Prefilter Type"	""
 "Preliminary scene analysis:"	""
 "Preprocessed DEM"	"vorverarbeitetes DGM"
 "Preprocessed DEM. If this is not set changes will be stored in the original DEM grid."	"Vorverarbeitetes DGM. Falls dieses nicht eingestellt ist werden die �nderungen im originalen DGM-Raster gespeichert."
@@ -3900,6 +3990,7 @@ TEXT	TRANSLATION
 "Random"	"Zufall"
 "Random Field"	"Zufallsfeld"
 "Random Forest Classification"	""
+"Random Forest Classification (OpenCV)"	""
 "Random Forest Classification (ViGrA)"	""
 "Random Forest Options"	""
 "Random Forest Presence Prediction (ViGrA)"	""
@@ -3933,6 +4024,7 @@ TEXT	TRANSLATION
 "Rayleigh atmosphere (diffuse sky irradiance)"	""
 "Rc"	""
 "Real"	""
+"Real AdaBoost"	""
 "Real Surface Area"	""
 "Real-valued Numerical Features"	""
 "Recalculate"	""
@@ -3963,6 +4055,7 @@ TEXT	TRANSLATION
 "Refresh"	"aktualisieren"
 "Region of Interest"	""
 "Regression"	"Regression"
+"Regression Accuracy"	""
 "Regression Analysis"	"Regressionsanalyse"
 "Regression Analysis (Points and Predictor Grid)"	""
 "Regression Details"	""
@@ -4047,6 +4140,7 @@ TEXT	TRANSLATION
 "Resulting Point Cloud."	"Resultierende Punktwolke"
 "Resulting Value"	"sich ergebender Wert"
 "Results"	"Ergebnisse"
+"Returns resulting grid's no-data value"	""
 "Returns the floating point remainder of x/y"	""
 "Returns the integer part of floating point value x"	""
 "Returns the value of Pi"	""
@@ -4127,6 +4221,7 @@ TEXT	TRANSLATION
 "SAGA: Print Map"	"SAGA: Karte drucken"
 "SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0"	""
 "SECTIONS"	"ABSCHNITTE"
+"SGBM 3 Way"	""
 "SHALSTAB"	""
 "SIZE"	""
 "SL, estimation of mean soil loss [kg]"	""
@@ -4325,6 +4420,8 @@ TEXT	TRANSLATION
 "Selection"	"Auswahl"
 "Selection Color"	"Farbauswahl"
 "Selection Method"	""
+"Semi-Global Block Matching"	""
+"Semicolon separated list of band indexes. Do not set to select all bands for import."	""
 "Semimajor Axis (a)"	"gro�e Halbachse (a)"
 "Semimajor Axis and Eccentricity"	"gro�e Halbachse und Exzentrizit�t"
 "Semimajor Axis and Eccentricity Squared"	"gro�e Halbachse und Exzentrizit�t quadriert"
@@ -4448,6 +4545,7 @@ TEXT	TRANSLATION
 "Show Vertical Legend"	""
 "Show Vertices"	""
 "Show a Composite"	""
+"Show a confirmation dialog before selection is performed"	""
 "Show at all scales"	"Zeige bei allen Massst�ben"
 "Show data sources tab for file system. Disabling might speed up start-up. Changes take effect after restart."	""
 "Shrink"	""
@@ -4563,6 +4661,7 @@ TEXT	TRANSLATION
 "Snap to..."	""
 "Snow Module Parameters"	"Schneemodul Parameter"
 "Snow Module on/off"	"Schneemodul ein/aus"
+"Sobel"	""
 "Soil"	""
 "Soil Adjusted Vegetation Index"	""
 "Soil Adjustment Factor"	""
@@ -4638,6 +4737,8 @@ TEXT	TRANSLATION
 "Specifies stratification strategy. Either none, equal amount of class samples, or proportional to fraction of class samples."	""
 "Specifies the fraction of the total number of samples used per tree for learning."	""
 "Specify a threshold value as minimum difference between neighboured segments."	"Benenne einen Schwellenwert als Minimaldifferenz zwischen benachbarten Segmenten."
+"Speckle Range"	""
+"Speckle Window Size"	""
 "Spectral"	""
 "Spectral Angle Mapping"	"Spektralwinkel-Kartierung"
 "Spectral Angle Threshold (Degree)"	"Spektralwinkel Schwellenwert (Grad)"
@@ -4765,6 +4866,7 @@ TEXT	TRANSLATION
 "Supervised Classification for Shapes"	""
 "Supervised Classification for Tables"	""
 "Support Vector Machine"	""
+"Support Vector Machine Classification (OpenCV)"	""
 "Surface"	"Oberfl�che"
 "Surface Approximation Threshold"	""
 "Surface Area"	""
@@ -4875,12 +4977,14 @@ TEXT	TRANSLATION
 "Tasseled Cap Transformation"	""
 "Temperature"	""
 "Temperature (2pm) [DegreeC]"	"Temperatur (14.00 Uhr) [GradCelsius]"
+"Temperature Annual Range"	""
 "Temperature Column"	"Temperatur Spalte"
 "Temperature Gradient [Deg.Celsius/km]"	"Temperatur Gradient [Grad.Celsius/km]"
 "Temperature K1"	""
 "Temperature K2"	""
 "Temperature Modulation Factor (f)"	"Temperatur Modulationsfaktor (f)"
 "Temperature Modulation Factor f"	"Temperatur Modulationsfaktor f"
+"Temperature Seasonality"	""
 "Temperature Threshold for Melting"	"Temperatur Schwellenwert f�r Schmelzen"
 "Temperature Threshold for Melting (lower bound)"	"Temperatur Schwellenwert f�r Schmelzen (untere Grenze)"
 "Temperature Threshold for Melting (upper bound)"	"Temperatur Schwellenwert f�r Schmelzen (obere Grenze)"
@@ -4894,6 +4998,7 @@ TEXT	TRANSLATION
 "Temporary files"	"tempor�re Dateien"
 "Tension Threshold"	"Spannungsschwellenwert"
 "Tension Threshold [Percentage of Cell Size]"	""
+"Termination criteria for regression trees. If all absolute differences between an estimated value in a node and values of train samples in this node are less than this parameter then the node will not be split further."	""
 "Termination criteria of the training algorithm. You can specify how much the error could change between the iterations to make the algorithm continue (epsilon)."	""
 "Termination criteria of the training algorithm. You can specify the maximum number of iterations."	""
 "Terrain"	""
@@ -4929,6 +5034,7 @@ TEXT	TRANSLATION
 "Textdatei (*.txt)|*.txt|All Files|*.*"	""
 "Textdatei|*.txt|All Files|*.*"	""
 "Texture"	"Textur"
+"Texture Threshold"	""
 "The (numeric) fields to calculate the statistics for."	""
 "The GDAL dataset to be created."	""
 "The GDAL datatype of the created dataset."	""
@@ -4990,7 +5096,11 @@ TEXT	TRANSLATION
 "The input table"	""
 "The input table."	""
 "The inverse selection is not implemented for input shapefiles with more than one polygon!"	"Die invertierte Auswahl ist nicht f�r die Eingabe von Vektordateien mit mehr als einem Polygon geeignet!"
+"The larger the value, the smoother the disparity. Parameter 1 is the penalty on the disparity change by plus or minus 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1."	""
+"The larger the value, the smoother the disparity. Parameter 2 is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1."	""
 "The length of the Gaussian window is too small, please provide a larger sigma."	""
+"The linear size of the blocks compared by the algorithm. Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher chance for algorithm to find a wrong correspondence."	""
+"The maximum possible depth of the tree. That is the training algorithms attempts to split a node while its depth is less than maxDepth. The root node has zero depth."	""
 "The merged point cloud."	""
 "The method used to identify surface specific points."	"Die Methode die zum Identifizieren spezifischer Oberfl�chenpunkte benutzt wird."
 "The name to use for each field, separated by semicolon, e.g. \"	""
@@ -4998,6 +5108,7 @@ TEXT	TRANSLATION
 "The number of smoothing iterations [-]."	""
 "The number of supplied grids exceeds the number of variables in formula."	""
 "The number of supplied grids is less than the number of variables in formula."	""
+"The number of weak classifiers."	""
 "The numbers (starting from 1) of the fields to export, separated by semicolon, e.g. \"	""
 "The numbers (starting from 1) of the fields to import, separated by semicolon, e.g. \"	""
 "The output grid(s)"	""
@@ -5016,6 +5127,7 @@ TEXT	TRANSLATION
 "The shaded DTM."	""
 "The shapefile to convert."	""
 "The shapefile to use for clipping."	""
+"The size of the randomly selected subset of features at each tree node and that are used to find the best split(s). If you set it to 0 then the size will be set to the square root of the total number of features."	""
 "The smoothed output line shapefile."	""
 "The smoothing preservation factor [-]."	""
 "The start value to use for the identifier."	""
@@ -5209,6 +5321,7 @@ TEXT	TRANSLATION
 "Train INPUT"	""
 "Training Areas"	"Trainingsgebiete"
 "Training Classes"	""
+"Training Method"	""
 "Training Options"	""
 "Training method"	""
 "Transactions"	"Transaktionen"
@@ -5260,6 +5373,9 @@ TEXT	TRANSLATION
 "True Latitude 1"	""
 "True Latitude 2"	""
 "True Scale Latitude"	"wahrer Massstab Breitengrad"
+"Truncate Pruned Trees"	""
+"Truncation value for the prefiltered image pixels."	""
+"Truncation value for the prefiltered image pixels. The algorithm first computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. The result values are passed to the Birchfield-Tomasi pixel cost function."	""
 "TwFAC("	""
 "Two Parallel Storages"	"Zwei parallele Speicherungen"
 "Two Storages in Series"	"Zwei Speicher in Serie"
@@ -5300,6 +5416,7 @@ TEXT	TRANSLATION
 "Uniform"	"einheitlich"
 "Union"	"Verbindung"
 "Unique"	"eindeutig"
+"Uniqueness Ratio"	""
 "Unit"	"Einheit"
 "Unit Name"	"Einheitenname"
 "Units"	"Einheiten"
@@ -5315,6 +5432,7 @@ TEXT	TRANSLATION
 "Unreferenced Grids"	""
 "Unsaturated zone time delay per unit storage deficit [h]"	"Unges�ttigte Zone Zeitverz�gerung pro Einheit Speicherdefizit [h]"
 "Unsorted tool chains"	""
+"Unsplit"	""
 "Unsupervised"	""
 "Up"	""
 "Up [-]"	""
@@ -5327,7 +5445,6 @@ TEXT	TRANSLATION
 "Update Shapes SRID"	""
 "Update View"	"Aktualisiere Ansicht"
 "Update Views"	"Aktualisiere Ansicht"
-"Update cluster view while clustering."	"Aktualisiere Gruppenansicht w�hrend der Gruppenbildung"
 "Update the network weights"	""
 "Update values lower limit"	""
 "Update values upper limit"	""
@@ -5338,6 +5455,7 @@ TEXT	TRANSLATION
 "Upper Slopes"	""
 "Upper Slopes, Mesas"	""
 "Upper Tolerance"	"Obere Toleranz"
+"Upper Value Update Limit"	""
 "Upscaling Method"	""
 "Upslope Area"	"Ansteigende Fl�che"
 "Upslope Basins"	"ansteigende Becken"
@@ -5350,6 +5468,7 @@ TEXT	TRANSLATION
 "Upslope Weighting"	""
 "Upslope and Downslope Curvature"	""
 "Urban"	""
+"Use 1SE Rule"	""
 "Use 5 percent confidence interval"	"Nutze 5 Prozent Vertrauensintervall"
 "Use Confidence Interval"	"Nutze Vertrauensintervall"
 "Use Flow Threshold"	""
@@ -5359,6 +5478,7 @@ TEXT	TRANSLATION
 "Use Offset"	"Nutze Versatz"
 "Use Pyramids"	"Benutze Pyramiden"
 "Use Surfer's No-Data Value"	"Benutze Surfers No-Data Werte"
+"Use Surrogates"	""
 "Use Target Area Polygon"	"Benutze Zielfl�chenpolygon"
 "Use Z-Range"	"Benutze Z-Bereich"
 "Use a user-specified elevation range instead of min/max of the input dataset"	""
@@ -5428,6 +5548,7 @@ TEXT	TRANSLATION
 "Value as RGB Code"	"Wert als RGB Code"
 "Value in Grid 1"	"Wert in Raster 1"
 "Value in Grid 2"	"Wert in Raster 2"
+"Value of Majority"	""
 "Value of Target Function"	"Wert der Zielfunktion"
 "Value of right cells in the Mask Grid"	"Werte der rechten Zellen im Maskenraster"
 "Value range"	""
@@ -5487,6 +5608,7 @@ TEXT	TRANSLATION
 "Vertical Scaling"	""
 "Vertical hatch"	"vertikale Schraffur"
 "Vertical scaling factor"	""
+"Vertically"	""
 "Vertices"	""
 "Vertikale Zufluesse"	""
 "ViGrA"	""
@@ -5550,9 +5672,12 @@ TEXT	TRANSLATION
 "Watershed Basins (Extended)"	"Wassereinzugsgebiete (erweitert)"
 "Watershed Segmentation"	"Wassereinzugsgebietteile"
 "Watershed Segmentation (ViGrA)"	""
+"Weak Count"	""
 "Weather Records"	"Wetterdaten"
 "Web Service Data Access"	""
 "Weight"	"Gewichtung"
+"Weight Gradient Term"	""
+"Weight Trim Rate"	""
 "Weight for grid "	"Gewichtung f�r Raster"
 "Weight gradient term"	""
 "Weighted"	"Gewichtet"
@@ -5668,6 +5793,7 @@ TEXT	TRANSLATION
 "Year [ka]"	"Jahr [ka]"
 "Yoshimasa Tsuruoka"	""
 "You can specify the number of layers in the network (including input and output layer)."	""
+"You can specify the number of layers in the network (not including input and output layer)."	""
 "You can specify the number of neurons in each layer of the network."	""
 "You canceled printing"	"Druck abgebrochen"
 "You must specify a reclass table with a minimium (field 1), a maximum (field 2) and a code value (field 3)!\n"	"Du musst eine Neueinteilungstabelle mit Minimum (Feld 1), Maximum (Feld 2) und Kodewert (Feld 3) ausw�hlen!\n"
@@ -5717,6 +5843,7 @@ TEXT	TRANSLATION
 "[FLD] Index Layer"	"Index Schicht"
 "[FLD] SVG File"	"SVG Datei"
 "[MSG] Save as Interactive SVG"	"Speichere als interaktive SVG"
+"[deprecated] Neural Networks (OpenCV)"	""
 "[deprecated] Point Cloud Viewer"	""
 "[deprecated] TIN Viewer"	""
 "[not set]|"	"[nichts ausgew�hlt]|"
@@ -5808,6 +5935,7 @@ TEXT	TRANSLATION
 "b(q)"	"b(q)"
 "b(q) [lower bound]"	"b(q) [untere Grenze]"
 "b(q) [upper bound]"	"b(q) [obere Grenze]"
+"back propagation"	""
 "backward"	"r�ckw�rts"
 "band transformation"	""
 "band width search"	""
@@ -5830,7 +5958,6 @@ TEXT	TRANSLATION
 "blend boundary"	""
 "blending distance given in map units"	""
 "blue channel color"	"Blauer Farbkanal"
-"bm"	""
 "both"	""
 "bottom"	"Unten"
 "bottom / left"	"unten / links"
@@ -5841,10 +5968,12 @@ TEXT	TRANSLATION
 "bottom-right"	""
 "bounding box for clipping"	""
 "bright - dark"	"hell - dunkel"
+"brute force"	""
 "built-in"	"eingebaut"
 "by area size"	""
 "by number of cells"	""
 "c, Percentage clays [%]"	"c, Prozentanteil Tage [%]"
+"c-support vector classification"	""
 "cache memory size in MB"	""
 "calculate averages"	"berechne Durchschnitt"
 "calculate from grid system"	""
@@ -5863,12 +5992,11 @@ TEXT	TRANSLATION
 "cell size of target grid"	""
 "cell size to bottom-top extent"	""
 "cell size to left-right extent"	""
+"cell's value"	""
 "cells"	"Zellen"
 "cells in process"	""
-"cellsize and lower left center coordinates"	""
-"cellsize and lower left corner coordinates"	""
-"cellsize and upper left center coordinates"	""
-"cellsize and upper left corner coordinates"	""
+"cellsize and lower left cell coordinates"	""
+"cellsize and upper left cell coordinates"	""
 "center"	"zentriert"
 "center cell's aspect direction"	"zentrale Zelle Bezugsrichtung"
 "centered"	""
@@ -5945,7 +6073,6 @@ TEXT	TRANSLATION
 "could not connect ODBC source"	"kann nicht mit ODBC-Quelle verbinden"
 "could not connect to PostgreSQL source"	""
 "could not connect to database."	""
-"could not create KML file"	"KML-Datei kann nicht erzeugt werden"
 "could not create distance grid"	"Entfernungsraster konnte nicht erstellt werden"
 "could not create geometry field"	"Kann kein Geometriefeld erzeugen"
 "could not create index on observations"	""
@@ -6002,6 +6129,7 @@ TEXT	TRANSLATION
 "cross"	"Kreuz"
 "cubic convolution"	""
 "cubic surface"	"kubische Oberfl�che"
+"custom"	""
 "cyan - white"	"cyan - wei�"
 "dX"	""
 "dX (Map Units)"	"dX (Karteneinheiten)"
@@ -6017,6 +6145,7 @@ TEXT	TRANSLATION
 "dark object subtraction 4"	""
 "data / no-data"	""
 "data file could not be openend"	"Datendatei konnte nicht ge�ffnet werden"
+"data set creation failed"	""
 "data set has no attributes"	""
 "database table does not exist"	"Datentabelle existiert nicht"
 "date"	"Datum"
@@ -6025,8 +6154,7 @@ TEXT	TRANSLATION
 "dbf read: could not read header"	""
 "dbf write: could open file"	""
 "dbf write: invalid table"	""
-"dd.mm.yy"	"tt.mm.jj"
-"dd:mm:yy"	"tt:mm:jj"
+"dd:mm:yyyy"	""
 "ddmmyy, fix size"	"ttmmjj, feste Gr��e"
 "ddmmyyyy, fix size"	"ttmmjjjj, feste Gr��e"
 "default"	"Standard"
@@ -6058,6 +6186,7 @@ TEXT	TRANSLATION
 "distance"	"Entfernung"
 "distance weighted average catchment slope"	""
 "distance weighted average of the number of different categories for distance classes"	""
+"distribution estimation (one class)"	""
 "do not confirm"	"nicht best�tigen"
 "do not join"	"nicht verbinden"
 "do not show"	"nicht anzeigen"
@@ -6065,6 +6194,7 @@ TEXT	TRANSLATION
 "do not update"	"nicht aktualisieren"
 "down"	"herunter"
 "downscaling"	""
+"downstream"	""
 "dragging a box"	"Zeichne einen Kasten"
 "driver not found."	"Treiber nicht gefunden."
 "dropping table"	"gebe Tabelle ab"
@@ -6091,6 +6221,7 @@ TEXT	TRANSLATION
 "empty or corrupted file"	"leere oder besch�digte Datei"
 "enumeration"	"Aufz�hlung"
 "epsilon in loss function of epsilon-SVR"	""
+"epsilon support vector regression"	""
 "epsilon-SVR"	""
 "equal"	""
 "equal intervals"	"gleiche Intervalle"
@@ -6110,6 +6241,7 @@ TEXT	TRANSLATION
 "explained cumulative variance"	"ausgef�hrte kumulative Streuung"
 "explained variance"	"Varianzaufkl�rung"
 "exponential"	"exponential"
+"exponential chi2"	""
 "export grid"	""
 "extent of lake, coded with local water depth"	"Ausdehnung des Sees, kodiert mit lokaler Wassertiefe"
 "extent of lake, coded with water depth"	"Ausdehnung des Sees, kodiert mit der Wassertiefe"
@@ -6121,6 +6253,7 @@ TEXT	TRANSLATION
 "failed to create polygon clipping mask"	""
 "failed to create searche engine"	""
 "failed to estimate target extent"	""
+"failed to import subset"	""
 "failed to initialise search engine"	"Initialisierung der Suchmaschine fehlgeschlagen"
 "failed to initialize target grid"	""
 "failed to launch default application"	""
@@ -6132,6 +6265,8 @@ TEXT	TRANSLATION
 "failed to project target grid"	""
 "failed to retrieve map image data"	""
 "failed to set radius"	""
+"failed to store data"	""
+"failed to write data"	""
 "failed: could not find a suitable import driver"	"fehlgeschlagen: konnte keinen passenden Importtreiber finden"
 "fat"	""
 "feathering"	""
@@ -6217,13 +6352,13 @@ TEXT	TRANSLATION
 "heads and mouths..."	"K�pfe und M�nder..."
 "height"	"H�he"
 "height of sun above horizon (degree)"	"H�he der Sonne �ber dem Horizont (Grad)"
-"hh"	""
 "hh.mm.ss"	""
 "hh:mm:ss"	""
 "hhmmss, fix size"	"hhmmss, feste Gr��e"
 "high"	""
 "highest"	""
 "highest z"	"h�chster z"
+"histogram intersection"	""
 "histogram match"	""
 "horizontal"	"horizontal"
 "horizontally"	""
@@ -6261,6 +6396,7 @@ TEXT	TRANSLATION
 "initialisation error"	"Initialisierungsfehler"
 "initialization"	"Initialisierung"
 "initialization failed"	""
+"initializing"	""
 "input"	"Eingabe"
 "input file"	"Eingabedatei"
 "instable (thawing)"	"instabil (auftauend)"
@@ -6362,7 +6498,6 @@ TEXT	TRANSLATION
 "loaded tool libraries"	"Geladene Werkzeugbibliotheken"
 "loading"	"laden"
 "loading OSM data"	""
-"loading band"	""
 "loading building parts"	""
 "loading failed"	""
 "loading spatial reference system database"	""
@@ -6378,9 +6513,9 @@ TEXT	TRANSLATION
 "lower and upper thresholds for semantic import model, planar vs. sloped areas"	""
 "lower and upper thresholds for semantic import model, straight vs. curved areas"	""
 "lower cell's value to neighbours minimum value minus epsilon"	""
-"lower left and upper right center coordinates"	""
 "lower left and upper right coordinates"	""
-"lower left and upper right corner coordinates"	""
+"lower left cell coordinates and left to right range"	""
+"lower left cell coordinates and lower to upper range"	""
 "lower left coordinate and number of rows and columns"	""
 "lowest"	""
 "lowest z"	"niedrigster z"
@@ -6437,6 +6572,7 @@ TEXT	TRANSLATION
 "minimum"	"Minimum"
 "minimum number of points to use"	"minimale Anzahl zu benutzender Punkte"
 "minimum number of upslope contributing cells to start a channel"	""
+"minimum overlapping area as percentage of the total size of the input shape. applies to polygon layers only."	""
 "minimum requirement"	""
 "minimum slope angle preserved from one cell to the next, zero results in flat areas [Degree]"	"minimaler Neigungswinkel der von einer Zelle zur n�chsten erhalten bleibt, null ergibt eine ebene Fl�che [Grad]."
 "minimum value"	"Minimalwert"
@@ -6550,6 +6686,7 @@ TEXT	TRANSLATION
 "nonlinear"	"nichtlinear"
 "normalize (0-1)"	""
 "normalized"	""
+"normalized response"	""
 "normal|down under|"	"noormal|umgedreht|"
 "not a PostGIS database"	""
 "not a valid PostGIS database!"	""
@@ -6567,6 +6704,8 @@ TEXT	TRANSLATION
 "nothing to do: input format is same as output format"	""
 "nothing to do: no data in selection"	"nichts zu tun: keine Daten ausgew�hlt"
 "nothing to do: original and desired field types are identical"	""
+"nu support vector classification"	""
+"nu support vector regression"	""
 "nu-SVC"	""
 "nu-SVR"	""
 "number of added polygons"	"Anzahl zugef�gter Polygone"
@@ -6685,6 +6824,7 @@ TEXT	TRANSLATION
 "post-processing..."	""
 "power of distance"	"power of distance"
 "prediction"	""
+"preparing"	""
 "preparing distance calculation..."	"bereite Entfernungsberechnung vor?"
 "press any key"	"Dr�cke eine beliebige Taste"
 "processed DEM"	"berechnetes DGM"
@@ -6727,6 +6867,7 @@ TEXT	TRANSLATION
 "redonda-ovaloredonda"	""
 "regression"	""
 "regression analysis could not detect a significant predictor"	""
+"regression model"	""
 "regression model applied to predictor grids"	""
 "regression model applied to predictor grids with interpolated residuals added"	""
 "relative"	"relativ"
@@ -6741,6 +6882,7 @@ TEXT	TRANSLATION
 "resampling"	"Neuberechnung"
 "resampling cell size is too large"	""
 "rescale to 0 - 255"	""
+"resilient propagation"	""
 "resolution"	"Aufl�sung"
 "resolution has to be greater than zero"	"Die Aufl�sung muss gr��er als null sein"
 "resolution measured in screen pixels"	""
@@ -6798,7 +6940,6 @@ TEXT	TRANSLATION
 "set"	""
 "set greater one for line smoothing"	""
 "set input"	""
-"sgbm"	""
 "shading"	"Schummerung"
 "shading (fixed light source)"	"Schummerung (feste Lichtquelle)"
 "shape file could not be opened."	"Vektordatei konnte nicht ge�ffnet werden."
@@ -6825,6 +6966,7 @@ TEXT	TRANSLATION
 "single"	""
 "single class"	""
 "single flow direction"	""
+"single value"	""
 "single|range|simple table|user supplied table|"	"einzeln|Bereich|einfache Tabelle|durch Nutzer bereitgestellte Tabelle|"
 "size range as percentage of step"	""
 "slim"	""
@@ -6887,6 +7029,7 @@ TEXT	TRANSLATION
 "target's spatial reference system is undefined"	""
 "text"	"Text"
 "the lower this value is the stronger is the suction effect"	""
+"there has to be one input grid for each month"	""
 "theta"	"theata"
 "thick"	"dick"
 "thin"	"d�nn"
@@ -6921,6 +7064,7 @@ TEXT	TRANSLATION
 "training"	""
 "training failed"	""
 "transaction started"	""
+"translation"	""
 "triangle (down)"	"Dreieck (Spitze abw�rts)"
 "triangle (up)"	"Dreieck (Spitze aufw�rts)"
 "trying to drop table"	"Versuche Tabelle zuzuweisen"
@@ -6942,7 +7086,6 @@ TEXT	TRANSLATION
 "unknown projection"	"unbekannte Projektion"
 "unkown"	"unbekannt"
 "unmatched parentheses"	"verzerrter Einschub"
-"unnamed"	"unbenannt"
 "unsigned 1 byte integer"	"vorzeichenlose 1 byte Ganzzahl"
 "unsigned 2 byte integer"	"vorzeichenlose 2 byte Ganzzahl"
 "unsigned 4 byte integer"	"vorzeichenlose 4 byte Ganzzahl"
@@ -6956,6 +7099,7 @@ TEXT	TRANSLATION
 "up"	"auf"
 "upscaling of predictors"	""
 "upsetting model domain"	""
+"upstream"	""
 "use a zero value for hillslopes, any other value for channel cells."	""
 "use more averaged elevations when looking at increasing distances"	""
 "use old version for constant wind direction (no acceleration and averaging option)"	""
@@ -6969,7 +7113,7 @@ TEXT	TRANSLATION
 "using cellsize"	""
 "valid data cells match original grid extent"	""
 "value at mouse position"	"Wert an Mausposition"
-"var"	""
+"value range"	""
 "variable and height levels have to be of same number"	"Variable und H�henlevel m�ssen den gleichen Wert haben"
 "variable type"	""
 "variable type + original name"	""
@@ -7011,9 +7155,8 @@ TEXT	TRANSLATION
 "yellow > green"	"gelb > gr�n"
 "yellow > red"	"gelb > rot"
 "yes"	"ja"
-"yy.mm.dd"	"jj.mm.tt"
-"yy:mm:dd"	"jj:mm:tt"
 "yymmdd, fix size"	"jjmmtt, feste Gr��e"
+"yyyy:mm:dd"	""
 "yyyymmdd, fix size"	"jjjjmmtt, feste Gr��e"
 "z values"	"z Werte"
 "z, Percentage silt [%]"	"z, Prozentanteil Ton [%]"
diff --git a/src/saga_core/saga_gui/res/saga.lng.txt b/src/saga_core/saga_gui/res/saga.lng.txt
index cc83a5a..e125367 100644
--- a/src/saga_core/saga_gui/res/saga.lng.txt
+++ b/src/saga_core/saga_gui/res/saga.lng.txt
@@ -174,7 +174,6 @@ TEXT	TRANSLATION
 "3D Image"	""
 "3D Image Height"	""
 "3D Image Width"	""
-"3D Points"	""
 "3D Shapes Viewer"	""
 "3D View"	""
 "3D View Sequencer"	""
@@ -228,10 +227,12 @@ TEXT	TRANSLATION
 "A"	""
 "A SAGA module to create transects through polygon files."	""
 "A Simple Litter System"	""
+"A grid providing information about the channel network. It is assumed that no-data cells are not part of the channel network. Vice versa all others cells are recognised as channel network members."	""
 "A grid that contains elevation data."	""
 "A set of basic SAGA module programming examples."	""
 "A space separated list of key-value pairs (K=V)."	""
 "A text file with the full path to an input point cloud on each line"	""
+"A threshold between 0 and 1 used to save computational time. Set this parameter to 0 to turn off this functionality."	""
 "A3 Landscape"	""
 "A3 Portrait"	""
 "A4 Landscape"	""
@@ -245,6 +246,7 @@ TEXT	TRANSLATION
 "A:Grid|Tools"	""
 "A:Grid|Values"	""
 "A:Imagery|Classification"	""
+"A:Imagery|Classification|Machine Learning (OpenCV)"	""
 "A:Imagery|Fourier Analysis"	""
 "A:Imagery|Segmentation"	""
 "A:Imagery|Tools"	""
@@ -274,6 +276,7 @@ TEXT	TRANSLATION
 "AOI does not intersect bounding box of SPCVF, nothing to do!"	""
 "AOI does not intersect with any bounding box of the SPCVF datasets, nothing to do!"	""
 "AOI does not intersect with any point of the SPCVF datasets, nothing to do!"	""
+"AOI_Cutter"	""
 "AQ("	""
 "AREA"	""
 "AS("	""
@@ -319,7 +322,9 @@ TEXT	TRANSLATION
 "Action"	""
 "Activate Grid File Cache?"	""
 "Activate file caching automatically, if memory size exceeds the threshold value."	""
+"Activation Function"	""
 "Activation function"	""
+"Active Variable Count"	""
 "Add"	""
 "Add All"	""
 "Add All Fields"	""
@@ -385,6 +390,7 @@ TEXT	TRANSLATION
 "Albers Equal Area Conic"	""
 "Alessandro Perego"	""
 "Algorithm"	""
+"Algorithm Type"	""
 "Algorithm for the detection of Surface Specific Points"	""
 "Alignment"	""
 "All"	""
@@ -407,6 +413,7 @@ TEXT	TRANSLATION
 "Allows writing cell values from additional grids to the output"	""
 "Alpha"	""
 "Alpha Max (Degree)"	""
+"Alphanumeric Sorting"	""
 "Alternatives"	""
 "Altura de llama"	""
 "Altura de llama (m)"	""
@@ -433,6 +440,8 @@ TEXT	TRANSLATION
 "Angular Step Size (Degree)"	""
 "Annual"	""
 "Annual Course of Daily Insolation"	""
+"Annual Mean Temperature"	""
+"Annual Precipitation"	""
 "Appearance"	""
 "Append Fields from another Table"	""
 "Append Rows from ..."	""
@@ -469,6 +478,7 @@ TEXT	TRANSLATION
 "Arithmetic mean (version 1)"	""
 "Arithmetic mean (version 2)"	""
 "Arrange Icons"	""
+"Artificial Neural Network Classification (OpenCV)"	""
 "Aspect"	""
 "Aspect Units"	""
 "Aspect grid, in radians and 360 degree from north."	""
@@ -615,10 +625,12 @@ TEXT	TRANSLATION
 "Binary Encoding"	""
 "Binary Erosion-Reconstruction"	""
 "Binary object mask"	""
+"Bioclimatic Variables"	""
 "Birth Rate of Fishes"	""
 "Birth Rate of Sharks"	""
 "Blending Distance"	""
 "Block Kriging"	""
+"Block Matching"	""
 "Block Size"	""
 "Blocks"	""
 "Blue"	""
@@ -629,6 +641,8 @@ TEXT	TRANSLATION
 "Boehner's Simple Language (BSL) is a macro script language for grid based calculations."	""
 "Bonne"	""
 "Boolean"	""
+"Boost Type"	""
+"Boosting Classification (OpenCV)"	""
 "Border"	""
 "Border Color"	""
 "Borders"	""
@@ -653,7 +667,6 @@ TEXT	TRANSLATION
 "Buffer Size [MB]"	""
 "Buffer distance"	""
 "Buffer distance (grid units)."	""
-"Buffer distance [map units]."	""
 "Build Histogram..."	""
 "Buildings"	""
 "Bulk density top layer"	""
@@ -686,6 +699,7 @@ TEXT	TRANSLATION
 "CRS Dictionary"	""
 "CSV Files (*.csv)"	""
 "CUMUL"	""
+"CV Folds"	""
 "Cache"	""
 "Cache Directory"	""
 "Cache Size"	""
@@ -720,6 +734,7 @@ TEXT	TRANSLATION
 "Catchment Area Calculation"	""
 "Catchment area"	""
 "Catchment slope"	""
+"Categorical Coincidence"	""
 "Categorical Features"	""
 "Categorical Grids"	""
 "Categories"	""
@@ -729,6 +744,7 @@ TEXT	TRANSLATION
 "Cell Count (X)"	""
 "Cell Count (Y)"	""
 "Cell Height"	""
+"Cell Reference"	""
 "Cell Size"	""
 "Cell Sizes"	""
 "Cell size"	""
@@ -762,6 +778,7 @@ TEXT	TRANSLATION
 "Change Time Format"	""
 "Change Vector"	""
 "Change Vector Analysis"	""
+"Change a Grid's No-Data Value"	""
 "Change all values within radius."	""
 "Changed"	""
 "Changed Grid"	""
@@ -884,6 +901,7 @@ TEXT	TRANSLATION
 "Clipping Options"	""
 "Close"	""
 "Close All"	""
+"Close All But This"	""
 "Close Gaps"	""
 "Close Gaps with Spline"	""
 "Close Gaps with Stepwise Resampling"	""
@@ -901,11 +919,15 @@ TEXT	TRANSLATION
 "Cluster Analysis (Shapes)"	""
 "Cluster Analysis PC"	""
 "Cluster Analysis for Point Clouds"	""
+"Cluster possible values of a categorical variable into K<=maxCategories clusters to find a suboptimal split."	""
 "ClusterID"	""
 "Clusters"	""
 "Clusters, which are closer than this distance to each other, are merged."	""
 "Coarse Resolution"	""
+"Coefficient 0"	""
 "Coefficient of Determination"	""
+"Coefficient of Variation"	""
+"Coincidence"	""
 "Cold Cloud"	""
 "Collect values"	""
 "Collpase Options"	""
@@ -967,6 +989,7 @@ TEXT	TRANSLATION
 "Cone (Up)"	""
 "Cone (down)"	""
 "Cone (up)"	""
+"Confirm"	""
 "Confirm file caching"	""
 "Confusion"	""
 "Confusion Index"	""
@@ -1058,6 +1081,7 @@ TEXT	TRANSLATION
 "Copy Map to Clipboard [Ctrl+C]"	""
 "Copy Project to Database"	""
 "Copy Project to..."	""
+"Copy Selected Shapes"	""
 "Copy Selection"	""
 "Copy Selection to New Shapes Layer"	""
 "Copy Settings from other Layer"	""
@@ -1092,7 +1116,6 @@ TEXT	TRANSLATION
 "Cosine Correction (Teillet et al. 1982)"	""
 "Cost Analysis"	""
 "Could not connect to data source."	""
-"Could not create data source."	""
 "Could not create dataset."	""
 "Could not initialize grid projection."	""
 "Could not load project."	""
@@ -1170,7 +1193,6 @@ TEXT	TRANSLATION
 "Curvature tolerance that defines 'planar' surface"	""
 "Curve Number"	""
 "Cut"	""
-"Cut Shapes Layer"	""
 "Cuts"	""
 "Cutting %s resulted in an empty point cloud, skipping output!"	""
 "Cycles"	""
@@ -1260,9 +1282,11 @@ TEXT	TRANSLATION
 "Decimals"	""
 "Decision"	""
 "Decision Tree"	""
+"Decision Tree Classification (OpenCV)"	""
 "Decrease Diagram Size"	""
 "Decrease Exaggeration [F1]"	""
 "Decrease Eye Distance"	""
+"Decrease Factor"	""
 "Decrease Legend Size"	""
 "Decrease Perspectivic Distance [F5]"	""
 "Decrease Size Scaling Factor [F7]"	""
@@ -1272,6 +1296,7 @@ TEXT	TRANSLATION
 "Deepen Drainage Routes"	""
 "Default"	""
 "Default Filter Matrix (3x3)"	""
+"Default Number of Neighbours"	""
 "Default Reference Height"	""
 "Default Rotation"	""
 "Default Size"	""
@@ -1384,6 +1409,7 @@ TEXT	TRANSLATION
 "Direction [Degree]"	""
 "Direction into which the wind blows, starting with 0 for North and increasing clockwise."	""
 "Direction of Maximum Cost"	""
+"Direction of Measurement"	""
 "Direction of Minimum Standard Deviation"	""
 "Direction of Plane [Degree]"	""
 "Direction of the light source, measured in degree clockwise from the north direction."	""
@@ -1396,10 +1422,13 @@ TEXT	TRANSLATION
 "Disconnect All"	""
 "Disconnect from ODBC Source"	""
 "Disconnect from PostgreSQL"	""
+"Discrete AdaBoost"	""
 "Discrete Colors"	""
 "Discretization"	""
 "Discretization Threshold"	""
 "Disparity Image"	""
+"Disparity Smoothness Parameter 1"	""
+"Disparity Smoothness Parameter 2"	""
 "Displacement Vector"	""
 "Displacement vectors between correlated points"	""
 "Display"	""
@@ -1439,6 +1468,7 @@ TEXT	TRANSLATION
 "Do you want to delete the selection?"	""
 "Do you want to exit SAGA?"	""
 "Dominance"	""
+"Dominance of Majority"	""
 "Dot And Dash"	""
 "Dot and dash style"	""
 "Dotted"	""
@@ -1562,6 +1592,7 @@ TEXT	TRANSLATION
 "Error"	""
 "Error : Wrong table. Check table dimensions"	""
 "Error : Wrong weights table. Check table dimensions"	""
+"Error Change (Epsilon)"	""
 "Error change (epsilon)"	""
 "Error in Formula"	""
 "Error in Trend Calculation"	""
@@ -1638,6 +1669,7 @@ TEXT	TRANSLATION
 "Export to File"	""
 "Expression"	""
 "Extended Neighourhood"	""
+"Extension"	""
 "Extensions"	""
 "Extent"	""
 "Extent Definition"	""
@@ -1789,8 +1821,8 @@ TEXT	TRANSLATION
 "Fixed Time Span (minutes)"	""
 "Fixed Time Span Offset (minutes)"	""
 "Fixed angle"	""
+"Fixed buffer distance given in map units."	""
 "Fixed value to be replaced"	""
-"Fixed|Cell value|"	""
 "Flaechenverbrauch-Auswahl (FvA)"	""
 "Flame Length"	""
 "Flame Length (m)"	""
@@ -1848,6 +1880,8 @@ TEXT	TRANSLATION
 "Focal Length [mm]"	""
 "Folder"	""
 "Folder for PDF Files"	""
+"Following raster formats are currently supported:"	""
+"Following vector formats are currently supported:"	""
 "Font"	""
 "Font size given as percentage of map size."	""
 "Foot Hollow"	""
@@ -1891,6 +1925,8 @@ TEXT	TRANSLATION
 "Function Parameters"	""
 "Function Plotter"	""
 "Function failed because no attributes are available"	""
+"Function's Alpha"	""
+"Function's Beta"	""
 "Fuzzified"	""
 "Fuzzified Grid"	""
 "Fuzzify"	""
@@ -1957,6 +1993,7 @@ TEXT	TRANSLATION
 "Generalized Surface"	""
 "Generate Shapes"	""
 "Generated Shapefile."	""
+"Gentle AdaBoost"	""
 "Geo-Reference"	""
 "GeoTIFF (*.tif)"	""
 "GeoTIFF Files"	""
@@ -2034,7 +2071,6 @@ TEXT	TRANSLATION
 "Grid Manager"	""
 "Grid Masking"	""
 "Grid Normalisation"	""
-"Grid Project"	""
 "Grid Proximity Buffer"	""
 "Grid Skeletonization"	""
 "Grid Spacing (Map Units)"	""
@@ -2074,7 +2110,6 @@ TEXT	TRANSLATION
 "Grid with category of nearest source cell [Category]"	""
 "Grid with euclidian distance to nearest source cell [grid units]"	""
 "Grid with features to be buffered [Category/NoData]"	""
-"Grid with features to be buffered."	""
 "Grid with the input values to accumulate."	""
 "Grid(s)"	""
 "Gridding"	""
@@ -2103,6 +2138,7 @@ TEXT	TRANSLATION
 "Grow Factor"	""
 "Gs"	""
 "Gz"	""
+"HH"	""
 "HTML"	""
 "Hafer"	""
 "Half the size of the moving window [vertex count], controls smoothing sensitivity."	""
@@ -2161,6 +2197,7 @@ TEXT	TRANSLATION
 "Horizontal Overland Flow Distance"	""
 "Horizontal Range"	""
 "Horizontal hatch"	""
+"Horizontally"	""
 "Host"	""
 "Hourly Data"	""
 "How many trees to create?"	""
@@ -2209,6 +2246,7 @@ TEXT	TRANSLATION
 "Ice"	""
 "Identifier"	""
 "Identity"	""
+"If CVFolds > 1 then algorithms prunes the built decision tree using K-fold cross-validation procedure where K is equal to CVFolds. Default value is 10."	""
 "If checked the snow module is active"	""
 "If checked, it means there is no external inflow to the subbasin"	""
 "If checked, snow-melt module is used."	""
@@ -2221,8 +2259,13 @@ TEXT	TRANSLATION
 "If not specified the cache will be created in the current user's temporary directory."	""
 "If set, output is given about the number of fields a flow path visits downhill. For D8 only."	""
 "If table exists..."	""
+"If the number of samples in a node is less than this parameter then the node will not be split."	""
+"If true then a pruning will be harsher. This will make a tree more compact and more resistant to the training data noise but a bit less accurate."	""
+"If true then pruned branches are physically removed from the tree. Otherwise they are retained and it is possible to get results from the original unpruned (or pruned less aggressively) tree."	""
+"If true then surrogate splits will be built. These splits allow to work with missing data and compute variable importance correctly."	""
 "Ignition Points"	""
 "Ignore Defaults"	""
+"Ignore Input Lists"	""
 "Ignore Lakes"	""
 "Ignore No Data"	""
 "Illumination calculation"	""
@@ -2316,6 +2359,7 @@ TEXT	TRANSLATION
 "Increase Diagram Size"	""
 "Increase Exaggeration [F2]"	""
 "Increase Eye Distance"	""
+"Increase Factor"	""
 "Increase Legend Size"	""
 "Increase Perspectivic Distance [F6]"	""
 "Increase Size Scaling Factor [F8]"	""
@@ -2341,6 +2385,7 @@ TEXT	TRANSLATION
 "Initial Number of Sharks [%]"	""
 "Initial State"	""
 "Initial Threshold for Slope"	""
+"Initial Update Value"	""
 "Initial root zone storage deficit [m]"	""
 "Initial subsurface flow per unit area [m/h]"	""
 "Initial update value"	""
@@ -2445,6 +2490,7 @@ TEXT	TRANSLATION
 "Is the subbasin upstream (no external inflow)"	""
 "Isochrones Constant Speed"	""
 "Isochrones Variable Speed"	""
+"Isothermality"	""
 "Iteration"	""
 "Iterationen"	""
 "Iterations"	""
@@ -2474,7 +2520,10 @@ TEXT	TRANSLATION
 "June"	""
 "K Factor"	""
 "K-Means Clustering for Grids"	""
+"K-Nearest Neighbours Classification (OpenCV)"	""
+"KD Tree"	""
 "KE"	""
+"KML file creation failed"	""
 "KML files (*.kml)"	""
 "KML/KMZ File"	""
 "KML/KMZ Files"	""
@@ -2659,6 +2708,7 @@ TEXT	TRANSLATION
 "Linke Turbidity Coefficient"	""
 "List"	""
 "List ODBC Servers"	""
+"List Order"	""
 "List PostgreSQL Connections"	""
 "List Table Fields"	""
 "List Tables"	""
@@ -2724,6 +2774,7 @@ TEXT	TRANSLATION
 "Logarithmic Transformation"	""
 "Logarithmic: a + b * ln(x)"	""
 "Login"	""
+"LogitBoost"	""
 "Logo"	""
 "Lon. Down"	""
 "Long Dashed"	""
@@ -2763,6 +2814,7 @@ TEXT	TRANSLATION
 "Lower"	""
 "Lower Border (Y)"	""
 "Lower Tolerance"	""
+"Lower Value Update Limit"	""
 "Lower left corner"	""
 "Loxodrome"	""
 "Loxodromes"	""
@@ -2829,6 +2881,7 @@ TEXT	TRANSLATION
 "MapQuest"	""
 "Maps"	""
 "March"	""
+"Margin in percentage by which the best (minimum) computed cost function value should \"win\" the second best value to consider the found match correct. Normally, a value within the 5-15 range is good enough."	""
 "Mark Highest Neighbour"	""
 "Mask"	""
 "Mask Grid"	""
@@ -2855,12 +2908,13 @@ TEXT	TRANSLATION
 "Maximimum Number of Samples"	""
 "Maximum"	""
 "Maximum Angle"	""
+"Maximum Categories"	""
 "Maximum Cells (C Correction Analysis)"	""
 "Maximum Contour Value"	""
 "Maximum Curvature"	""
 "Maximum Deviation between estimated excess rainfall and observed streamflow volumes"	""
 "Maximum Deviation: ExcessRain-Streamflow [%]"	""
-"Maximum Disparity"	""
+"Maximum Disparity Difference"	""
 "Maximum Distance"	""
 "Maximum Distance [Cells]"	""
 "Maximum Entropy"	""
@@ -2868,6 +2922,7 @@ TEXT	TRANSLATION
 "Maximum Entropy Presence Prediction"	""
 "Maximum Expansion Distance"	""
 "Maximum Flow Distance"	""
+"Maximum Flow Path Length"	""
 "Maximum Height"	""
 "Maximum Iterations"	""
 "Maximum Level"	""
@@ -2886,13 +2941,18 @@ TEXT	TRANSLATION
 "Maximum Standard Deviation within a Cluster"	""
 "Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"	""
 "Maximum Temperature"	""
+"Maximum Temperature of Warmest Month"	""
 "Maximum Time Span (Seconds)"	""
 "Maximum Total Order"	""
+"Maximum Tree Depth"	""
 "Maximum Value"	""
 "Maximum X Order"	""
 "Maximum Y Order"	""
+"Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check."	""
 "Maximum angular difference as degree between adjacent segment points."	""
 "Maximum deviation allowed between original and simplified curve [map units]."	""
+"Maximum disparity minus minimum disparity. The value is always greater than zero."	""
+"Maximum disparity variation within each connected component. If you do speckle filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. Normally, 1 or 2 is good enough."	""
 "Maximum distance parameter is ignored if set to zero (default)."	""
 "Maximum entropy based classification and prediction."	""
 "Maximum number of classes in entire grid."	""
@@ -2903,6 +2963,7 @@ TEXT	TRANSLATION
 "Maximum resolution as percentage of the diameter of the DEM."	""
 "Maximum root zone storage deficit [m]"	""
 "Maximum size"	""
+"Maximum size of smooth disparity regions to consider their noise speckles and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the 50-200 range."	""
 "Maximum temperature:"	""
 "Maximum value of the range to be reclassified."	""
 "Maximun"	""
@@ -2911,12 +2972,17 @@ TEXT	TRANSLATION
 "Mean Average"	""
 "Mean Centre"	""
 "Mean Distance"	""
+"Mean Diurnal Range"	""
 "Mean Elevation"	""
 "Mean Elevation [m.a.s.l]"	""
 "Mean Flow Distance"	""
 "Mean Solar Irradiance"	""
 "Mean Squared Error"	""
 "Mean Temperature"	""
+"Mean Temperature of Coldest Quarter"	""
+"Mean Temperature of Driest Quarter"	""
+"Mean Temperature of Warmest Quarter"	""
+"Mean Temperature of Wettest Quarter"	""
 "Mean Value"	""
 "Mean Value (cell area weighted)"	""
 "Mean less Standard Deviation"	""
@@ -2984,6 +3050,7 @@ TEXT	TRANSLATION
 "Minimum Curvature"	""
 "Minimum Density [Percent]"	""
 "Minimum Density for Interior Forest [Percent]"	""
+"Minimum Disparity"	""
 "Minimum Distance"	""
 "Minimum Distance Analysis"	""
 "Minimum Exaggeration [%]"	""
@@ -2997,15 +3064,18 @@ TEXT	TRANSLATION
 "Minimum Number of Dark Object Cells"	""
 "Minimum Number of Points"	""
 "Minimum Number of Samples in a Cluster"	""
+"Minimum Overlap"	""
 "Minimum Probability"	""
 "Minimum Redundancy Feature Selection"	""
 "Minimum Resolution (Degree)"	""
+"Minimum Sample Count"	""
 "Minimum Segment Length (Cells)"	""
 "Minimum Size [%]"	""
 "Minimum Slope"	""
 "Minimum Slope [Degree]"	""
 "Minimum Standard Deviation"	""
 "Minimum Temperature"	""
+"Minimum Temperature of Coldest Month"	""
 "Minimum Threshold"	""
 "Minimum Value"	""
 "Minimum Weight"	""
@@ -3017,6 +3087,7 @@ TEXT	TRANSLATION
 "Minimum number of neighbouring potential edge cells with similar direction."	""
 "Minimum of Darkness DN Cells"	""
 "Minimum pixels to consider digital number as dark object"	""
+"Minimum possible disparity value. Normally, it is zero but sometimes rectification algorithms can shift images, so this parameter needs to be adjusted accordingly."	""
 "Minimum probability to accept a classification result for a cell."	""
 "Minimum shade brightness must be lower than maximum shade brightness!"	""
 "Minimum size"	""
@@ -3058,11 +3129,13 @@ TEXT	TRANSLATION
 "Modifed Quadratic Shepard"	""
 "Modified"	""
 "Modified Catchment Area"	""
+"Modified Hirschmuller"	""
 "Modify: post-processing..."	""
 "Modify: pre-processing..."	""
 "Module Library Template"	""
 "Module My_Module"	""
 "Mollweide"	""
+"Moment Term"	""
 "Moment [h]"	""
 "Moment term"	""
 "Month"	""
@@ -3168,7 +3241,6 @@ TEXT	TRANSLATION
 "Neumann"	""
 "Neumann (4)"	""
 "Neumann: the four horizontally and vertically neighboured cells; Moore: all eight adjacent cells"	""
-"Neural Networks (OpenCV)"	""
 "New"	""
 "New Shapes Layer"	""
 "New Table"	""
@@ -3216,6 +3288,7 @@ TEXT	TRANSLATION
 "No sinks have been detected."	""
 "No translation set by user"	""
 "No-Data Value"	""
+"No-Data Value Range"	""
 "NoData Output Grid"	""
 "NoData Value"	""
 "NoData Value: %.6f"	""
@@ -3228,6 +3301,7 @@ TEXT	TRANSLATION
 "Non-Sibsonian"	""
 "None"	""
 "Normal"	""
+"Normal Bayes Classification (OpenCV)"	""
 "Normal Updating"	""
 "Normal escarpment"	""
 "Normalisation"	""
@@ -3252,6 +3326,7 @@ TEXT	TRANSLATION
 "Nothing to do: there is no intersection with additional grid."	""
 "November"	""
 "No|Yes|"	""
+"Nu"	""
 "Number in Latitudinal Direction"	""
 "Number in Meridional Direction"	""
 "Number of Attributes"	""
@@ -3269,6 +3344,7 @@ TEXT	TRANSLATION
 "Number of Data Sets"	""
 "Number of Different Classes"	""
 "Number of Directions"	""
+"Number of Disparities"	""
 "Number of Distance Classes"	""
 "Number of Elements"	""
 "Number of Events"	""
@@ -3281,7 +3357,9 @@ TEXT	TRANSLATION
 "Number of Iterations"	""
 "Number of Iterations for Normal Updating"	""
 "Number of Iterations for Vertex Updating"	""
+"Number of Layers"	""
 "Number of Maps"	""
+"Number of Neurons"	""
 "Number of No-Data Cells"	""
 "Number of Numeric Value Classes"	""
 "Number of Pairs"	""
@@ -3484,6 +3562,7 @@ TEXT	TRANSLATION
 "Overview"	""
 "Overview Content"	""
 "Overwrite"	""
+"P"	""
 "P/A"	""
 "P/sqrt(A)"	""
 "PATB"	""
@@ -3526,6 +3605,7 @@ TEXT	TRANSLATION
 "Parameter (p)"	""
 "Parameter (p) [lower bound]"	""
 "Parameter (p) [upper bound]"	""
+"Parameter for KD Tree implementation"	""
 "Parameter settings for No-Data and all other values."	""
 "Parameter settings for the NoData value of the output grid (header)."	""
 "Parameters"	""
@@ -3729,8 +3809,15 @@ TEXT	TRANSLATION
 "Pre-defined Formulas"	""
 "Precipitation"	""
 "Precipitation Column"	""
+"Precipitation Seasonality"	""
 "Precipitation [m / dt]"	""
 "Precipitation [mm]"	""
+"Precipitation of Coldest Quarter"	""
+"Precipitation of Driest Month"	""
+"Precipitation of Driest Quarter"	""
+"Precipitation of Warmest Quarter"	""
+"Precipitation of Wettest Month"	""
+"Precipitation of Wettest Quarter"	""
 "Precise Datum Conversion"	""
 "Precise Tracing"	""
 "Precision"	""
@@ -3747,6 +3834,9 @@ TEXT	TRANSLATION
 "Predictors"	""
 "Preferred Routing"	""
 "Preferred Target Grid Type"	""
+"Prefilter Size"	""
+"Prefilter Truncation Value"	""
+"Prefilter Type"	""
 "Preliminary scene analysis:"	""
 "Preprocessed DEM"	""
 "Preprocessed DEM. If this is not set changes will be stored in the original DEM grid."	""
@@ -3900,6 +3990,7 @@ TEXT	TRANSLATION
 "Random"	""
 "Random Field"	""
 "Random Forest Classification"	""
+"Random Forest Classification (OpenCV)"	""
 "Random Forest Classification (ViGrA)"	""
 "Random Forest Options"	""
 "Random Forest Presence Prediction (ViGrA)"	""
@@ -3933,6 +4024,7 @@ TEXT	TRANSLATION
 "Rayleigh atmosphere (diffuse sky irradiance)"	""
 "Rc"	""
 "Real"	""
+"Real AdaBoost"	""
 "Real Surface Area"	""
 "Real-valued Numerical Features"	""
 "Recalculate"	""
@@ -3963,6 +4055,7 @@ TEXT	TRANSLATION
 "Refresh"	""
 "Region of Interest"	""
 "Regression"	""
+"Regression Accuracy"	""
 "Regression Analysis"	""
 "Regression Analysis (Points and Predictor Grid)"	""
 "Regression Details"	""
@@ -4047,6 +4140,7 @@ TEXT	TRANSLATION
 "Resulting Point Cloud."	""
 "Resulting Value"	""
 "Results"	""
+"Returns resulting grid's no-data value"	""
 "Returns the floating point remainder of x/y"	""
 "Returns the integer part of floating point value x"	""
 "Returns the value of Pi"	""
@@ -4127,6 +4221,7 @@ TEXT	TRANSLATION
 "SAGA: Print Map"	""
 "SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0"	""
 "SECTIONS"	""
+"SGBM 3 Way"	""
 "SHALSTAB"	""
 "SIZE"	""
 "SL, estimation of mean soil loss [kg]"	""
@@ -4325,6 +4420,8 @@ TEXT	TRANSLATION
 "Selection"	""
 "Selection Color"	""
 "Selection Method"	""
+"Semi-Global Block Matching"	""
+"Semicolon separated list of band indexes. Do not set to select all bands for import."	""
 "Semimajor Axis (a)"	""
 "Semimajor Axis and Eccentricity"	""
 "Semimajor Axis and Eccentricity Squared"	""
@@ -4448,6 +4545,7 @@ TEXT	TRANSLATION
 "Show Vertical Legend"	""
 "Show Vertices"	""
 "Show a Composite"	""
+"Show a confirmation dialog before selection is performed"	""
 "Show at all scales"	""
 "Show data sources tab for file system. Disabling might speed up start-up. Changes take effect after restart."	""
 "Shrink"	""
@@ -4563,6 +4661,7 @@ TEXT	TRANSLATION
 "Snap to..."	""
 "Snow Module Parameters"	""
 "Snow Module on/off"	""
+"Sobel"	""
 "Soil"	""
 "Soil Adjusted Vegetation Index"	""
 "Soil Adjustment Factor"	""
@@ -4638,6 +4737,8 @@ TEXT	TRANSLATION
 "Specifies stratification strategy. Either none, equal amount of class samples, or proportional to fraction of class samples."	""
 "Specifies the fraction of the total number of samples used per tree for learning."	""
 "Specify a threshold value as minimum difference between neighboured segments."	""
+"Speckle Range"	""
+"Speckle Window Size"	""
 "Spectral"	""
 "Spectral Angle Mapping"	""
 "Spectral Angle Threshold (Degree)"	""
@@ -4765,6 +4866,7 @@ TEXT	TRANSLATION
 "Supervised Classification for Shapes"	""
 "Supervised Classification for Tables"	""
 "Support Vector Machine"	""
+"Support Vector Machine Classification (OpenCV)"	""
 "Surface"	""
 "Surface Approximation Threshold"	""
 "Surface Area"	""
@@ -4875,12 +4977,14 @@ TEXT	TRANSLATION
 "Tasseled Cap Transformation"	""
 "Temperature"	""
 "Temperature (2pm) [DegreeC]"	""
+"Temperature Annual Range"	""
 "Temperature Column"	""
 "Temperature Gradient [Deg.Celsius/km]"	""
 "Temperature K1"	""
 "Temperature K2"	""
 "Temperature Modulation Factor (f)"	""
 "Temperature Modulation Factor f"	""
+"Temperature Seasonality"	""
 "Temperature Threshold for Melting"	""
 "Temperature Threshold for Melting (lower bound)"	""
 "Temperature Threshold for Melting (upper bound)"	""
@@ -4894,6 +4998,7 @@ TEXT	TRANSLATION
 "Temporary files"	""
 "Tension Threshold"	""
 "Tension Threshold [Percentage of Cell Size]"	""
+"Termination criteria for regression trees. If all absolute differences between an estimated value in a node and values of train samples in this node are less than this parameter then the node will not be split further."	""
 "Termination criteria of the training algorithm. You can specify how much the error could change between the iterations to make the algorithm continue (epsilon)."	""
 "Termination criteria of the training algorithm. You can specify the maximum number of iterations."	""
 "Terrain"	""
@@ -4929,6 +5034,7 @@ TEXT	TRANSLATION
 "Textdatei (*.txt)|*.txt|All Files|*.*"	""
 "Textdatei|*.txt|All Files|*.*"	""
 "Texture"	""
+"Texture Threshold"	""
 "The (numeric) fields to calculate the statistics for."	""
 "The GDAL dataset to be created."	""
 "The GDAL datatype of the created dataset."	""
@@ -4990,7 +5096,11 @@ TEXT	TRANSLATION
 "The input table"	""
 "The input table."	""
 "The inverse selection is not implemented for input shapefiles with more than one polygon!"	""
+"The larger the value, the smoother the disparity. Parameter 1 is the penalty on the disparity change by plus or minus 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1."	""
+"The larger the value, the smoother the disparity. Parameter 2 is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires Parameter 2 > Parameter 1."	""
 "The length of the Gaussian window is too small, please provide a larger sigma."	""
+"The linear size of the blocks compared by the algorithm. Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher chance for algorithm to find a wrong correspondence."	""
+"The maximum possible depth of the tree. That is the training algorithms attempts to split a node while its depth is less than maxDepth. The root node has zero depth."	""
 "The merged point cloud."	""
 "The method used to identify surface specific points."	""
 "The name to use for each field, separated by semicolon, e.g. \"intensity;class;range\""	""
@@ -4998,6 +5108,7 @@ TEXT	TRANSLATION
 "The number of smoothing iterations [-]."	""
 "The number of supplied grids exceeds the number of variables in formula."	""
 "The number of supplied grids is less than the number of variables in formula."	""
+"The number of weak classifiers."	""
 "The numbers (starting from 1) of the fields to export, separated by semicolon, e.g. \"1;2;3;5\""	""
 "The numbers (starting from 1) of the fields to import, separated by semicolon, e.g. \"5;6;8\""	""
 "The output grid(s)"	""
@@ -5016,6 +5127,7 @@ TEXT	TRANSLATION
 "The shaded DTM."	""
 "The shapefile to convert."	""
 "The shapefile to use for clipping."	""
+"The size of the randomly selected subset of features at each tree node and that are used to find the best split(s). If you set it to 0 then the size will be set to the square root of the total number of features."	""
 "The smoothed output line shapefile."	""
 "The smoothing preservation factor [-]."	""
 "The start value to use for the identifier."	""
@@ -5209,6 +5321,7 @@ TEXT	TRANSLATION
 "Train INPUT"	""
 "Training Areas"	""
 "Training Classes"	""
+"Training Method"	""
 "Training Options"	""
 "Training method"	""
 "Transactions"	""
@@ -5260,6 +5373,9 @@ TEXT	TRANSLATION
 "True Latitude 1"	""
 "True Latitude 2"	""
 "True Scale Latitude"	""
+"Truncate Pruned Trees"	""
+"Truncation value for the prefiltered image pixels."	""
+"Truncation value for the prefiltered image pixels. The algorithm first computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. The result values are passed to the Birchfield-Tomasi pixel cost function."	""
 "TwFAC("	""
 "Two Parallel Storages"	""
 "Two Storages in Series"	""
@@ -5300,6 +5416,7 @@ TEXT	TRANSLATION
 "Uniform"	""
 "Union"	""
 "Unique"	""
+"Uniqueness Ratio"	""
 "Unit"	""
 "Unit Name"	""
 "Units"	""
@@ -5315,6 +5432,7 @@ TEXT	TRANSLATION
 "Unreferenced Grids"	""
 "Unsaturated zone time delay per unit storage deficit [h]"	""
 "Unsorted tool chains"	""
+"Unsplit"	""
 "Unsupervised"	""
 "Up"	""
 "Up [-]"	""
@@ -5327,7 +5445,6 @@ TEXT	TRANSLATION
 "Update Shapes SRID"	""
 "Update View"	""
 "Update Views"	""
-"Update cluster view while clustering."	""
 "Update the network weights"	""
 "Update values lower limit"	""
 "Update values upper limit"	""
@@ -5338,6 +5455,7 @@ TEXT	TRANSLATION
 "Upper Slopes"	""
 "Upper Slopes, Mesas"	""
 "Upper Tolerance"	""
+"Upper Value Update Limit"	""
 "Upscaling Method"	""
 "Upslope Area"	""
 "Upslope Basins"	""
@@ -5350,6 +5468,7 @@ TEXT	TRANSLATION
 "Upslope Weighting"	""
 "Upslope and Downslope Curvature"	""
 "Urban"	""
+"Use 1SE Rule"	""
 "Use 5 percent confidence interval"	""
 "Use Confidence Interval"	""
 "Use Flow Threshold"	""
@@ -5359,6 +5478,7 @@ TEXT	TRANSLATION
 "Use Offset"	""
 "Use Pyramids"	""
 "Use Surfer's No-Data Value"	""
+"Use Surrogates"	""
 "Use Target Area Polygon"	""
 "Use Z-Range"	""
 "Use a user-specified elevation range instead of min/max of the input dataset"	""
@@ -5428,6 +5548,7 @@ TEXT	TRANSLATION
 "Value as RGB Code"	""
 "Value in Grid 1"	""
 "Value in Grid 2"	""
+"Value of Majority"	""
 "Value of Target Function"	""
 "Value of right cells in the Mask Grid"	""
 "Value range"	""
@@ -5487,6 +5608,7 @@ TEXT	TRANSLATION
 "Vertical Scaling"	""
 "Vertical hatch"	""
 "Vertical scaling factor"	""
+"Vertically"	""
 "Vertices"	""
 "Vertikale Zufluesse"	""
 "ViGrA"	""
@@ -5550,9 +5672,12 @@ TEXT	TRANSLATION
 "Watershed Basins (Extended)"	""
 "Watershed Segmentation"	""
 "Watershed Segmentation (ViGrA)"	""
+"Weak Count"	""
 "Weather Records"	""
 "Web Service Data Access"	""
 "Weight"	""
+"Weight Gradient Term"	""
+"Weight Trim Rate"	""
 "Weight for grid "	""
 "Weight gradient term"	""
 "Weighted"	""
@@ -5668,6 +5793,7 @@ TEXT	TRANSLATION
 "Year [ka]"	""
 "Yoshimasa Tsuruoka"	""
 "You can specify the number of layers in the network (including input and output layer)."	""
+"You can specify the number of layers in the network (not including input and output layer)."	""
 "You can specify the number of neurons in each layer of the network."	""
 "You canceled printing"	""
 "You must specify a reclass table with a minimium (field 1), a maximum (field 2) and a code value (field 3)!\n"	""
@@ -5717,6 +5843,7 @@ TEXT	TRANSLATION
 "[FLD] Index Layer"	""
 "[FLD] SVG File"	""
 "[MSG] Save as Interactive SVG"	""
+"[deprecated] Neural Networks (OpenCV)"	""
 "[deprecated] Point Cloud Viewer"	""
 "[deprecated] TIN Viewer"	""
 "[not set]|"	""
@@ -5808,6 +5935,7 @@ TEXT	TRANSLATION
 "b(q)"	""
 "b(q) [lower bound]"	""
 "b(q) [upper bound]"	""
+"back propagation"	""
 "backward"	""
 "band transformation"	""
 "band width search"	""
@@ -5830,7 +5958,6 @@ TEXT	TRANSLATION
 "blend boundary"	""
 "blending distance given in map units"	""
 "blue channel color"	""
-"bm"	""
 "both"	""
 "bottom"	""
 "bottom / left"	""
@@ -5841,10 +5968,12 @@ TEXT	TRANSLATION
 "bottom-right"	""
 "bounding box for clipping"	""
 "bright - dark"	""
+"brute force"	""
 "built-in"	""
 "by area size"	""
 "by number of cells"	""
 "c, Percentage clays [%]"	""
+"c-support vector classification"	""
 "cache memory size in MB"	""
 "calculate averages"	""
 "calculate from grid system"	""
@@ -5863,12 +5992,11 @@ TEXT	TRANSLATION
 "cell size of target grid"	""
 "cell size to bottom-top extent"	""
 "cell size to left-right extent"	""
+"cell's value"	""
 "cells"	""
 "cells in process"	""
-"cellsize and lower left center coordinates"	""
-"cellsize and lower left corner coordinates"	""
-"cellsize and upper left center coordinates"	""
-"cellsize and upper left corner coordinates"	""
+"cellsize and lower left cell coordinates"	""
+"cellsize and upper left cell coordinates"	""
 "center"	""
 "center cell's aspect direction"	""
 "centered"	""
@@ -5945,7 +6073,6 @@ TEXT	TRANSLATION
 "could not connect ODBC source"	""
 "could not connect to PostgreSQL source"	""
 "could not connect to database."	""
-"could not create KML file"	""
 "could not create distance grid"	""
 "could not create geometry field"	""
 "could not create index on observations"	""
@@ -6002,6 +6129,7 @@ TEXT	TRANSLATION
 "cross"	""
 "cubic convolution"	""
 "cubic surface"	""
+"custom"	""
 "cyan - white"	""
 "dX"	""
 "dX (Map Units)"	""
@@ -6017,6 +6145,7 @@ TEXT	TRANSLATION
 "dark object subtraction 4"	""
 "data / no-data"	""
 "data file could not be openend"	""
+"data set creation failed"	""
 "data set has no attributes"	""
 "database table does not exist"	""
 "date"	""
@@ -6025,8 +6154,7 @@ TEXT	TRANSLATION
 "dbf read: could not read header"	""
 "dbf write: could open file"	""
 "dbf write: invalid table"	""
-"dd.mm.yy"	""
-"dd:mm:yy"	""
+"dd:mm:yyyy"	""
 "ddmmyy, fix size"	""
 "ddmmyyyy, fix size"	""
 "default"	""
@@ -6058,6 +6186,7 @@ TEXT	TRANSLATION
 "distance"	""
 "distance weighted average catchment slope"	""
 "distance weighted average of the number of different categories for distance classes"	""
+"distribution estimation (one class)"	""
 "do not confirm"	""
 "do not join"	""
 "do not show"	""
@@ -6065,6 +6194,7 @@ TEXT	TRANSLATION
 "do not update"	""
 "down"	""
 "downscaling"	""
+"downstream"	""
 "dragging a box"	""
 "driver not found."	""
 "dropping table"	""
@@ -6091,6 +6221,7 @@ TEXT	TRANSLATION
 "empty or corrupted file"	""
 "enumeration"	""
 "epsilon in loss function of epsilon-SVR"	""
+"epsilon support vector regression"	""
 "epsilon-SVR"	""
 "equal"	""
 "equal intervals"	""
@@ -6110,6 +6241,7 @@ TEXT	TRANSLATION
 "explained cumulative variance"	""
 "explained variance"	""
 "exponential"	""
+"exponential chi2"	""
 "export grid"	""
 "extent of lake, coded with local water depth"	""
 "extent of lake, coded with water depth"	""
@@ -6121,6 +6253,7 @@ TEXT	TRANSLATION
 "failed to create polygon clipping mask"	""
 "failed to create searche engine"	""
 "failed to estimate target extent"	""
+"failed to import subset"	""
 "failed to initialise search engine"	""
 "failed to initialize target grid"	""
 "failed to launch default application"	""
@@ -6132,6 +6265,8 @@ TEXT	TRANSLATION
 "failed to project target grid"	""
 "failed to retrieve map image data"	""
 "failed to set radius"	""
+"failed to store data"	""
+"failed to write data"	""
 "failed: could not find a suitable import driver"	""
 "fat"	""
 "feathering"	""
@@ -6217,13 +6352,13 @@ TEXT	TRANSLATION
 "heads and mouths..."	""
 "height"	""
 "height of sun above horizon (degree)"	""
-"hh"	""
 "hh.mm.ss"	""
 "hh:mm:ss"	""
 "hhmmss, fix size"	""
 "high"	""
 "highest"	""
 "highest z"	""
+"histogram intersection"	""
 "histogram match"	""
 "horizontal"	""
 "horizontally"	""
@@ -6261,6 +6396,7 @@ TEXT	TRANSLATION
 "initialisation error"	""
 "initialization"	""
 "initialization failed"	""
+"initializing"	""
 "input"	""
 "input file"	""
 "instable (thawing)"	""
@@ -6362,7 +6498,6 @@ TEXT	TRANSLATION
 "loaded tool libraries"	""
 "loading"	""
 "loading OSM data"	""
-"loading band"	""
 "loading building parts"	""
 "loading failed"	""
 "loading spatial reference system database"	""
@@ -6378,9 +6513,9 @@ TEXT	TRANSLATION
 "lower and upper thresholds for semantic import model, planar vs. sloped areas"	""
 "lower and upper thresholds for semantic import model, straight vs. curved areas"	""
 "lower cell's value to neighbours minimum value minus epsilon"	""
-"lower left and upper right center coordinates"	""
 "lower left and upper right coordinates"	""
-"lower left and upper right corner coordinates"	""
+"lower left cell coordinates and left to right range"	""
+"lower left cell coordinates and lower to upper range"	""
 "lower left coordinate and number of rows and columns"	""
 "lowest"	""
 "lowest z"	""
@@ -6437,6 +6572,7 @@ TEXT	TRANSLATION
 "minimum"	""
 "minimum number of points to use"	""
 "minimum number of upslope contributing cells to start a channel"	""
+"minimum overlapping area as percentage of the total size of the input shape. applies to polygon layers only."	""
 "minimum requirement"	""
 "minimum slope angle preserved from one cell to the next, zero results in flat areas [Degree]"	""
 "minimum value"	""
@@ -6550,6 +6686,7 @@ TEXT	TRANSLATION
 "nonlinear"	""
 "normalize (0-1)"	""
 "normalized"	""
+"normalized response"	""
 "normal|down under|"	""
 "not a PostGIS database"	""
 "not a valid PostGIS database!"	""
@@ -6567,6 +6704,8 @@ TEXT	TRANSLATION
 "nothing to do: input format is same as output format"	""
 "nothing to do: no data in selection"	""
 "nothing to do: original and desired field types are identical"	""
+"nu support vector classification"	""
+"nu support vector regression"	""
 "nu-SVC"	""
 "nu-SVR"	""
 "number of added polygons"	""
@@ -6685,6 +6824,7 @@ TEXT	TRANSLATION
 "post-processing..."	""
 "power of distance"	""
 "prediction"	""
+"preparing"	""
 "preparing distance calculation..."	""
 "press any key"	""
 "processed DEM"	""
@@ -6727,6 +6867,7 @@ TEXT	TRANSLATION
 "redonda-ovaloredonda"	""
 "regression"	""
 "regression analysis could not detect a significant predictor"	""
+"regression model"	""
 "regression model applied to predictor grids"	""
 "regression model applied to predictor grids with interpolated residuals added"	""
 "relative"	""
@@ -6741,6 +6882,7 @@ TEXT	TRANSLATION
 "resampling"	""
 "resampling cell size is too large"	""
 "rescale to 0 - 255"	""
+"resilient propagation"	""
 "resolution"	""
 "resolution has to be greater than zero"	""
 "resolution measured in screen pixels"	""
@@ -6798,7 +6940,6 @@ TEXT	TRANSLATION
 "set"	""
 "set greater one for line smoothing"	""
 "set input"	""
-"sgbm"	""
 "shading"	""
 "shading (fixed light source)"	""
 "shape file could not be opened."	""
@@ -6825,6 +6966,7 @@ TEXT	TRANSLATION
 "single"	""
 "single class"	""
 "single flow direction"	""
+"single value"	""
 "single|range|simple table|user supplied table|"	""
 "size range as percentage of step"	""
 "slim"	""
@@ -6887,6 +7029,7 @@ TEXT	TRANSLATION
 "target's spatial reference system is undefined"	""
 "text"	""
 "the lower this value is the stronger is the suction effect"	""
+"there has to be one input grid for each month"	""
 "theta"	""
 "thick"	""
 "thin"	""
@@ -6921,6 +7064,7 @@ TEXT	TRANSLATION
 "training"	""
 "training failed"	""
 "transaction started"	""
+"translation"	""
 "triangle (down)"	""
 "triangle (up)"	""
 "trying to drop table"	""
@@ -6942,7 +7086,6 @@ TEXT	TRANSLATION
 "unknown projection"	""
 "unkown"	""
 "unmatched parentheses"	""
-"unnamed"	""
 "unsigned 1 byte integer"	""
 "unsigned 2 byte integer"	""
 "unsigned 4 byte integer"	""
@@ -6956,6 +7099,7 @@ TEXT	TRANSLATION
 "up"	""
 "upscaling of predictors"	""
 "upsetting model domain"	""
+"upstream"	""
 "use a zero value for hillslopes, any other value for channel cells."	""
 "use more averaged elevations when looking at increasing distances"	""
 "use old version for constant wind direction (no acceleration and averaging option)"	""
@@ -6969,7 +7113,7 @@ TEXT	TRANSLATION
 "using cellsize"	""
 "valid data cells match original grid extent"	""
 "value at mouse position"	""
-"var"	""
+"value range"	""
 "variable and height levels have to be of same number"	""
 "variable type"	""
 "variable type + original name"	""
@@ -7011,9 +7155,8 @@ TEXT	TRANSLATION
 "yellow > green"	""
 "yellow > red"	""
 "yes"	""
-"yy.mm.dd"	""
-"yy:mm:dd"	""
 "yymmdd, fix size"	""
+"yyyy:mm:dd"	""
 "yyyymmdd, fix size"	""
 "z values"	""
 "z, Percentage silt [%]"	""
diff --git a/src/saga_core/saga_gui/res/saga_icon_22.png b/src/saga_core/saga_gui/res/saga_icon_22.png
new file mode 100644
index 0000000..84462a5
Binary files /dev/null and b/src/saga_core/saga_gui/res/saga_icon_22.png differ
diff --git a/src/saga_core/saga_gui/res_commands.cpp b/src/saga_core/saga_gui/res_commands.cpp
index b01cfe1..bb1f58c 100755
--- a/src/saga_core/saga_gui/res_commands.cpp
+++ b/src/saga_core/saga_gui/res_commands.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_commands.cpp 2882 2016-04-04 15:48:12Z reklov_w $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -93,10 +93,18 @@ wxString CMD_Get_Name(int Cmd_ID)
 	case ID_CMD_FRAME_TILE_HORZ:		return( _TL("Tile Horizontally") );
 	case ID_CMD_FRAME_TILE_VERT:		return( _TL("Tile Vertically") );
 	case ID_CMD_FRAME_ARRANGEICONS:		return( _TL("Arrange Icons") );
+	case ID_CMD_FRAME_UNSPLIT:			return( _TL("Unsplit") );
+	case ID_CMD_FRAME_SPLIT_LEFT:		return( _TL("Left") );
+	case ID_CMD_FRAME_SPLIT_RIGHT:		return( _TL("Right") );
+	case ID_CMD_FRAME_SPLIT_TOP:		return( _TL("Top") );
+	case ID_CMD_FRAME_SPLIT_BOTTOM:		return( _TL("Bottom") );
+	case ID_CMD_FRAME_SPLIT_ALL_HORZ:	return( _TL("Horizontally") );
+	case ID_CMD_FRAME_SPLIT_ALL_VERT:	return( _TL("Vertically") );
 	case ID_CMD_FRAME_NEXT:				return( _TL("Next") );
 	case ID_CMD_FRAME_PREVIOUS:			return( _TL("Previous") );
 	case ID_CMD_FRAME_CLOSE:			return( _TL("Close") );
 	case ID_CMD_FRAME_CLOSE_ALL:		return( _TL("Close All") );
+	case ID_CMD_FRAME_CLOSE_ALL_OTHERS:	return( _TL("Close All But This") );
 
 	case ID_CMD_FRAME_INFO_SHOW:		return( _TL("Show Message Window") );
 	case ID_CMD_FRAME_DATA_SOURCE_SHOW:	return( _TL("Show Data Source Window") );
diff --git a/src/saga_core/saga_gui/res_commands.h b/src/saga_core/saga_gui/res_commands.h
index 8d52b4d..3b4ea48 100755
--- a/src/saga_core/saga_gui/res_commands.h
+++ b/src/saga_core/saga_gui/res_commands.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_commands.h 2793 2016-02-16 16:51:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -96,10 +96,18 @@ enum ID_COMMANDS
 	ID_CMD_FRAME_TILE_HORZ,
 	ID_CMD_FRAME_TILE_VERT,
 	ID_CMD_FRAME_ARRANGEICONS,
+	ID_CMD_FRAME_UNSPLIT,
+	ID_CMD_FRAME_SPLIT_LEFT,
+	ID_CMD_FRAME_SPLIT_RIGHT,
+	ID_CMD_FRAME_SPLIT_TOP,
+	ID_CMD_FRAME_SPLIT_BOTTOM,
+	ID_CMD_FRAME_SPLIT_ALL_HORZ,
+	ID_CMD_FRAME_SPLIT_ALL_VERT,
 	ID_CMD_FRAME_NEXT,
 	ID_CMD_FRAME_PREVIOUS,
 	ID_CMD_FRAME_CLOSE,
 	ID_CMD_FRAME_CLOSE_ALL,
+	ID_CMD_FRAME_CLOSE_ALL_OTHERS,
 
 	ID_CMD_FRAME_QUIT,
 	ID_CMD_FRAME_HELP,
diff --git a/src/saga_core/saga_gui/res_controls.cpp b/src/saga_core/saga_gui/res_controls.cpp
index e0b4943..1be02b1 100755
--- a/src/saga_core/saga_gui/res_controls.cpp
+++ b/src/saga_core/saga_gui/res_controls.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_controls.cpp 2682 2015-11-06 12:44:37Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/res_controls.h b/src/saga_core/saga_gui/res_controls.h
index 02da1fd..d726b08 100755
--- a/src/saga_core/saga_gui/res_controls.h
+++ b/src/saga_core/saga_gui/res_controls.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_controls.h 2682 2015-11-06 12:44:37Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/res_dialogs.cpp b/src/saga_core/saga_gui/res_dialogs.cpp
index 0455d45..e638835 100755
--- a/src/saga_core/saga_gui/res_dialogs.cpp
+++ b/src/saga_core/saga_gui/res_dialogs.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_dialogs.cpp 2397 2015-02-03 15:07:22Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/res_dialogs.h b/src/saga_core/saga_gui/res_dialogs.h
index 8a3e8c4..2ccde95 100755
--- a/src/saga_core/saga_gui/res_dialogs.h
+++ b/src/saga_core/saga_gui/res_dialogs.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_dialogs.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/res_images.cpp b/src/saga_core/saga_gui/res_images.cpp
index d6c6238..c8ed1cc 100755
--- a/src/saga_core/saga_gui/res_images.cpp
+++ b/src/saga_core/saga_gui/res_images.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_images.cpp 2859 2016-03-23 17:56:31Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/res_images.h b/src/saga_core/saga_gui/res_images.h
index baa8d44..8ca06ae 100755
--- a/src/saga_core/saga_gui/res_images.h
+++ b/src/saga_core/saga_gui/res_images.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: res_images.h 2859 2016-03-23 17:56:31Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/saga.cpp b/src/saga_core/saga_gui/saga.cpp
index 23234d0..5b82803 100755
--- a/src/saga_core/saga_gui/saga.cpp
+++ b/src/saga_core/saga_gui/saga.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga.cpp 2694 2015-11-20 16:43:15Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/saga.h b/src/saga_core/saga_gui/saga.h
index 9b150ae..3c93828 100755
--- a/src/saga_core/saga_gui/saga.h
+++ b/src/saga_core/saga_gui/saga.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga.h 1993 2014-02-13 16:38:16Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/saga_frame.cpp b/src/saga_core/saga_gui/saga_frame.cpp
index 081937b..5a0b23a 100755
--- a/src/saga_core/saga_gui/saga_frame.cpp
+++ b/src/saga_core/saga_gui/saga_frame.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_frame.cpp 2891 2016-04-13 12:33:23Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -207,6 +207,20 @@ BEGIN_EVENT_TABLE(CSAGA_Frame, MDI_ParentFrame)
 	EVT_UPDATE_UI		(ID_CMD_FRAME_TILE_VERT			, CSAGA_Frame::On_Frame_vTile_UI)
 	EVT_MENU			(ID_CMD_FRAME_ARRANGEICONS		, CSAGA_Frame::On_Frame_ArrangeIcons)
 	EVT_UPDATE_UI		(ID_CMD_FRAME_ARRANGEICONS		, CSAGA_Frame::On_Frame_ArrangeIcons_UI)
+	EVT_MENU			(ID_CMD_FRAME_UNSPLIT			, CSAGA_Frame::On_Frame_Unsplit)
+	EVT_UPDATE_UI		(ID_CMD_FRAME_UNSPLIT			, CSAGA_Frame::On_Frame_Unsplit_UI)
+	EVT_MENU			(ID_CMD_FRAME_SPLIT_LEFT		, CSAGA_Frame::On_Frame_Split)
+	EVT_UPDATE_UI		(ID_CMD_FRAME_SPLIT_LEFT		, CSAGA_Frame::On_Frame_Split_UI)
+	EVT_MENU			(ID_CMD_FRAME_SPLIT_RIGHT		, CSAGA_Frame::On_Frame_Split)
+	EVT_UPDATE_UI		(ID_CMD_FRAME_SPLIT_RIGHT		, CSAGA_Frame::On_Frame_Split_UI)
+	EVT_MENU			(ID_CMD_FRAME_SPLIT_TOP			, CSAGA_Frame::On_Frame_Split)
+	EVT_UPDATE_UI		(ID_CMD_FRAME_SPLIT_TOP			, CSAGA_Frame::On_Frame_Split_UI)
+	EVT_MENU			(ID_CMD_FRAME_SPLIT_BOTTOM		, CSAGA_Frame::On_Frame_Split)
+	EVT_UPDATE_UI		(ID_CMD_FRAME_SPLIT_BOTTOM		, CSAGA_Frame::On_Frame_Split_UI)
+	EVT_MENU			(ID_CMD_FRAME_SPLIT_ALL_HORZ	, CSAGA_Frame::On_Frame_Split)
+	EVT_UPDATE_UI		(ID_CMD_FRAME_SPLIT_ALL_HORZ	, CSAGA_Frame::On_Frame_Split_UI)
+	EVT_MENU			(ID_CMD_FRAME_SPLIT_ALL_VERT	, CSAGA_Frame::On_Frame_Split)
+	EVT_UPDATE_UI		(ID_CMD_FRAME_SPLIT_ALL_VERT	, CSAGA_Frame::On_Frame_Split_UI)
 	EVT_MENU			(ID_CMD_FRAME_NEXT				, CSAGA_Frame::On_Frame_Next)
 	EVT_UPDATE_UI		(ID_CMD_FRAME_NEXT				, CSAGA_Frame::On_Frame_Next_UI)
 	EVT_MENU			(ID_CMD_FRAME_PREVIOUS			, CSAGA_Frame::On_Frame_Previous)
@@ -396,6 +410,8 @@ CSAGA_Frame::~CSAGA_Frame(void)
 	delete(m_pLayout);
 
 	//-----------------------------------------------------
+	On_Child_Activates(-1);
+
 	delete(m_pMN_Table);
 	delete(m_pMN_Diagram);
 	delete(m_pMN_Map);
@@ -510,9 +526,121 @@ void CSAGA_Frame::On_Tips(wxCommandEvent &WXUNUSED(event))
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+void CSAGA_Frame::On_Frame_Unsplit(wxCommandEvent &WXUNUSED(event))
+{
+#ifdef MDI_TABBED
+	int		i, n	= GetNotebook()->GetPageCount();
+
+	if( n > 1 )
+	{
+		GetNotebook()->Freeze();
+
+		class CPage { public: wxWindow *pPage; wxString Text; wxBitmap Bmp; };
+
+		CPage	*pPages	= new CPage[n];
+
+		for(i=n-1; i>=0; i--)
+		{
+			pPages[i].pPage	= GetNotebook()->GetPage      (i);
+			pPages[i].Text	= GetNotebook()->GetPageText  (i);
+			pPages[i].Bmp	= GetNotebook()->GetPageBitmap(i);
+
+			GetNotebook()->RemovePage(i);
+		}
+
+		for(i=0; i<n; i++)
+		{
+			GetNotebook()->AddPage(pPages[i].pPage, pPages[i].Text, false, pPages[i].Bmp);
+		}
+
+		delete[](pPages);
+
+		GetNotebook()->Thaw();
+	}
+#endif
+}
+
+void CSAGA_Frame::On_Frame_Unsplit_UI(wxUpdateUIEvent &event)
+{
+#ifdef MDI_TABBED
+	event.Enable(GetNotebook()->GetPageCount() > 1);
+#endif
+}
+
+//---------------------------------------------------------
+void CSAGA_Frame::On_Frame_Split(wxCommandEvent &event)
+{
+#ifdef MDI_TABBED
+	int		n	= GetNotebook()->GetPageCount();
+
+	if( n > 1 )
+	{
+		GetNotebook()->Freeze();
+
+		int	iActive	= GetNotebook()->GetSelection(); if( iActive < 0 ) iActive = 0;
+		int	nSqrt	= (int)sqrt((double)n);
+
+		switch( event.GetId() )
+		{
+		case ID_CMD_FRAME_SPLIT_LEFT  : GetNotebook()->Split(iActive, wxLEFT  ); break;
+		case ID_CMD_FRAME_SPLIT_RIGHT : GetNotebook()->Split(iActive, wxRIGHT ); break;
+		case ID_CMD_FRAME_SPLIT_TOP   : GetNotebook()->Split(iActive, wxTOP   ); break;
+		case ID_CMD_FRAME_SPLIT_BOTTOM: GetNotebook()->Split(iActive, wxBOTTOM); break;
+
+		case ID_CMD_FRAME_SPLIT_ALL_HORZ:
+			{
+				for(int i=n-1, iRow=0; i>0; i--, iRow++)
+				{
+					GetNotebook()->Split(i, wxLEFT);
+				}
+			}
+			break;
+
+		case ID_CMD_FRAME_SPLIT_ALL_VERT:
+			{
+				for(int i=n-1, iRow=0; i>0; i--, iRow++)
+				{
+					GetNotebook()->Split(i, wxBOTTOM);
+				}
+			}
+			break;
+		}
+
+		GetNotebook()->Thaw();
+	}
+#endif
+}
+
+void CSAGA_Frame::On_Frame_Split_UI(wxUpdateUIEvent &event)
+{
+#ifdef MDI_TABBED
+	event.Enable(GetNotebook()->GetPageCount() > 1);
+#endif
+}
+
+//---------------------------------------------------------
+void CSAGA_Frame::Tile(wxOrientation orient)
+{
+#ifndef MDI_TABBED
+	int		n	= Get_Children_Count();
+
+	if( n == 1 && GetActiveChild() )
+	{
+		GetActiveChild()->Maximize();
+	}
+	else
+	{
+		MDI_ParentFrame::Tile(orient);
+	}
+#endif
+}
+
+//---------------------------------------------------------
 void CSAGA_Frame::On_Frame_Cascade(wxCommandEvent &WXUNUSED(event))
 {
+#ifndef MDI_TABBED
 	Cascade();
+#endif
 }
 
 void CSAGA_Frame::On_Frame_Cascade_UI(wxUpdateUIEvent &event)
@@ -890,12 +1018,12 @@ void CSAGA_Frame::Close_Children(void)
 		delete(GetActiveChild());
 	}
 }
-
+
 //---------------------------------------------------------
-void CSAGA_Frame::Tile(wxOrientation orient)
-{
+int CSAGA_Frame::Get_Children_Count(void)
+{
 #ifdef MDI_TABBED
-	// nop yet
+	return( GetNotebook()->GetPageCount() );
 #else
 	int		n	= 0;
 
@@ -907,20 +1035,18 @@ void CSAGA_Frame::Tile(wxOrientation orient)
 		}
 	}
 
-	if( n == 1 && GetActiveChild() )
-	{
-		GetActiveChild()->Maximize();
-	}
-	else
-	{
-		MDI_ParentFrame::Tile(orient);
-	}
+	return( n );
 #endif
-}
-
+}
+
 //---------------------------------------------------------
 void CSAGA_Frame::On_Child_Activates(int View_ID)
 {
+	if( View_ID < 0 && Get_Children_Count() > 1 )	// another child will be activated next!
+	{
+		return;
+	}
+
 	wxString		Title;
 	wxMenu			*pMenu		= NULL;
 	wxToolBarBase	*pToolBar	= NULL;
@@ -993,7 +1119,20 @@ wxMenuBar * CSAGA_Frame::_Create_MenuBar(void)
 	CMD_Menu_Add_Item(pMenu_Window,  true, ID_CMD_FRAME_DATA_SOURCE_SHOW);
 	CMD_Menu_Add_Item(pMenu_Window,  true, ID_CMD_FRAME_INFO_SHOW);
 
-#ifdef __WXMSW__
+#if defined(MDI_TABBED)
+	wxMenu	*pMenu_Split	= new wxMenu;
+	CMD_Menu_Add_Item(pMenu_Split, false, ID_CMD_FRAME_SPLIT_LEFT);
+	CMD_Menu_Add_Item(pMenu_Split, false, ID_CMD_FRAME_SPLIT_RIGHT);
+	CMD_Menu_Add_Item(pMenu_Split, false, ID_CMD_FRAME_SPLIT_TOP);
+	CMD_Menu_Add_Item(pMenu_Split, false, ID_CMD_FRAME_SPLIT_BOTTOM);
+	pMenu_Split->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu_Split, false, ID_CMD_FRAME_SPLIT_ALL_HORZ);
+	CMD_Menu_Add_Item(pMenu_Split, false, ID_CMD_FRAME_SPLIT_ALL_VERT);
+
+	pMenu_Window->AppendSeparator();
+	pMenu_Window->AppendSubMenu(pMenu_Split, _TL("Split"));
+	CMD_Menu_Add_Item(pMenu_Window, false, ID_CMD_FRAME_UNSPLIT);
+#elif defined(__WXMSW__)
 	pMenu_Window->AppendSeparator();
 	CMD_Menu_Add_Item(pMenu_Window, false, ID_CMD_FRAME_CASCADE);
 	CMD_Menu_Add_Item(pMenu_Window, false, ID_CMD_FRAME_TILE_HORZ);
diff --git a/src/saga_core/saga_gui/saga_frame.h b/src/saga_core/saga_gui/saga_frame.h
index af51603..c95d971 100755
--- a/src/saga_core/saga_gui/saga_frame.h
+++ b/src/saga_core/saga_gui/saga_frame.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_frame.h 2865 2016-03-29 14:31:27Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,7 +72,11 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifdef MDI_TABBED
+#if !defined(_SAGA_MSW)
+#define MDI_TABBED
+#endif
+
+#if defined(MDI_TABBED)
 #include <wx/aui/tabmdi.h>
 #define MDI_ParentFrame	wxAuiMDIParentFrame
 #else
@@ -116,6 +120,10 @@ public:
 	void						On_Frame_vTile_UI			(wxUpdateUIEvent &event);
 	void						On_Frame_ArrangeIcons		(wxCommandEvent  &event);
 	void						On_Frame_ArrangeIcons_UI	(wxUpdateUIEvent &event);
+	void						On_Frame_Unsplit			(wxCommandEvent  &event);
+	void						On_Frame_Unsplit_UI			(wxUpdateUIEvent &event);
+	void						On_Frame_Split				(wxCommandEvent  &event);
+	void						On_Frame_Split_UI			(wxUpdateUIEvent &event);
 	void						On_Frame_Next				(wxCommandEvent  &event);
 	void						On_Frame_Next_UI			(wxUpdateUIEvent &event);
 	void						On_Frame_Previous			(wxCommandEvent  &event);
@@ -167,7 +175,7 @@ public:
     virtual void				Tile						(wxOrientation orient = wxHORIZONTAL);
 
 	void						Close_Children				(void);
-
+	int							Get_Children_Count			(void);
 	void						On_Child_Activates			(int View_ID);
 
 	void						Set_Pane_Caption			(wxWindow *pWindow, const wxString &Caption);
diff --git a/src/saga_core/saga_gui/saga_frame_droptarget.cpp b/src/saga_core/saga_gui/saga_frame_droptarget.cpp
index 7ef2c81..2cc7174 100755
--- a/src/saga_core/saga_gui/saga_frame_droptarget.cpp
+++ b/src/saga_core/saga_gui/saga_frame_droptarget.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_frame_droptarget.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/saga_frame_droptarget.h b/src/saga_core/saga_gui/saga_frame_droptarget.h
index e42f3f6..9b8e4b1 100755
--- a/src/saga_core/saga_gui/saga_frame_droptarget.h
+++ b/src/saga_core/saga_gui/saga_frame_droptarget.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_frame_droptarget.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_base.cpp b/src/saga_core/saga_gui/view_base.cpp
index 4968c2a..e15a3e8 100755
--- a/src/saga_core/saga_gui/view_base.cpp
+++ b/src/saga_core/saga_gui/view_base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_base.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -143,7 +143,7 @@ CVIEW_Base::~CVIEW_Base(void)
 
 	if( g_pSAGA_Frame )
 	{
-		g_pSAGA_Frame->On_Child_Activates(-1);
+//		g_pSAGA_Frame->On_Child_Activates(-1);
 	}
 }
 
@@ -172,7 +172,8 @@ void CVIEW_Base::Do_Show(void)
 	Show();
 #endif
 
-	Activate();
+//	Activate();
+	g_pSAGA_Frame->On_Child_Activates(m_View_ID);
 }
 
 //---------------------------------------------------------
@@ -229,12 +230,9 @@ void CVIEW_Base::On_Size(wxSizeEvent &event)
 //---------------------------------------------------------
 void CVIEW_Base::On_Activate(wxActivateEvent &event)
 {
-	if( event.GetActive() )
+	if( g_pSAGA_Frame )
 	{
-		if( g_pSAGA_Frame )
-		{
-			g_pSAGA_Frame->On_Child_Activates(m_View_ID);
-		}
+		g_pSAGA_Frame->On_Child_Activates(event.GetActive() ? m_View_ID : -1);
 	}
 }
 
diff --git a/src/saga_core/saga_gui/view_base.h b/src/saga_core/saga_gui/view_base.h
index 933efe0..086eee5 100755
--- a/src/saga_core/saga_gui/view_base.h
+++ b/src/saga_core/saga_gui/view_base.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_base.h 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -72,6 +72,10 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#if !defined(_SAGA_MSW)
+#define MDI_TABBED
+#endif
+
 #ifdef MDI_TABBED
 #include <wx/aui/tabmdi.h>
 #define MDI_ChildFrame	wxAuiMDIChildFrame
diff --git a/src/saga_core/saga_gui/view_histogram.cpp b/src/saga_core/saga_gui/view_histogram.cpp
index dcf8cc4..37ce74d 100755
--- a/src/saga_core/saga_gui/view_histogram.cpp
+++ b/src/saga_core/saga_gui/view_histogram.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_histogram.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -63,7 +63,7 @@
 //---------------------------------------------------------
 #include <wx/window.h>
 #include <wx/toolbar.h>
-#include <wx/scrolwin.h>
+#include <wx/clipbrd.h>
 
 #include "res_commands.h"
 #include "res_controls.h"
@@ -88,66 +88,21 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CVIEW_Histogram_Control : public wxScrolledWindow
-{
-public:
-	CVIEW_Histogram_Control(wxWindow *pParent, class CWKSP_Layer *pLayer);
-
-	bool							Update_Histogram	(void);
-
-	bool							Get_Cumulative		(void)	{	return( m_bCumulative );	}
-	void							Set_Cumulative		(bool bOn);
-
-	void							Draw				(wxDC &dc, wxRect rDraw);
-
-	void							ToClipboard			(void);
-
-
-private:
-
-	bool							m_bCumulative, m_bMouse_Down;
-
-	wxPoint							m_Mouse_Down, m_Mouse_Move;
-
-	class CWKSP_Layer				*m_pLayer;
-
-
-	void							On_Mouse_Motion		(wxMouseEvent &event);
-	void							On_Mouse_LDown		(wxMouseEvent &event);
-	void							On_Mouse_LUp		(wxMouseEvent &event);
-	void							On_Mouse_RDown		(wxMouseEvent &event);
-
-	void							On_Size				(wxSizeEvent  &event);
-	void							On_Paint			(wxPaintEvent &event);
-
-	void							_Draw_Histogram		(wxDC &dc, wxRect r);
-	void							_Draw_Frame			(wxDC &dc, wxRect r);
-	wxRect							_Draw_Get_rDiagram	(wxRect r);
-
-
-private:
-
-	DECLARE_EVENT_TABLE()
-	DECLARE_CLASS(CVIEW_Histogram_Control)
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
+IMPLEMENT_CLASS(CVIEW_Histogram, CVIEW_Base);
 
 //---------------------------------------------------------
-IMPLEMENT_CLASS(CVIEW_Histogram_Control, wxScrolledWindow);
+BEGIN_EVENT_TABLE(CVIEW_Histogram, CVIEW_Base)
+	EVT_PAINT		(CVIEW_Histogram::On_Paint)
+	EVT_SIZE		(CVIEW_Histogram::On_Size)
 
-//---------------------------------------------------------
-BEGIN_EVENT_TABLE(CVIEW_Histogram_Control, wxScrolledWindow)
-	EVT_PAINT			(CVIEW_Histogram_Control::On_Paint)
-	EVT_SIZE			(CVIEW_Histogram_Control::On_Size)
-	EVT_MOTION			(CVIEW_Histogram_Control::On_Mouse_Motion)
-	EVT_LEFT_DOWN		(CVIEW_Histogram_Control::On_Mouse_LDown)
-	EVT_LEFT_UP			(CVIEW_Histogram_Control::On_Mouse_LUp)
-	EVT_RIGHT_DOWN		(CVIEW_Histogram_Control::On_Mouse_RDown)
+	EVT_MOTION		(CVIEW_Histogram::On_Mouse_Motion)
+	EVT_LEFT_DOWN	(CVIEW_Histogram::On_Mouse_LDown)
+	EVT_LEFT_UP		(CVIEW_Histogram::On_Mouse_LUp)
+	EVT_RIGHT_DOWN	(CVIEW_Histogram::On_Mouse_RDown)
+
+	EVT_MENU		(ID_CMD_HISTOGRAM_CUMULATIVE  , CVIEW_Histogram::On_Cumulative)
+	EVT_MENU		(ID_CMD_HISTOGRAM_AS_TABLE    , CVIEW_Histogram::On_AsTable)
+	EVT_MENU		(ID_CMD_HISTOGRAM_TO_CLIPBOARD, CVIEW_Histogram::On_ToClipboard)
 END_EVENT_TABLE()
 
 
@@ -156,8 +111,8 @@ END_EVENT_TABLE()
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CVIEW_Histogram_Control::CVIEW_Histogram_Control(wxWindow *pParent, CWKSP_Layer *pLayer)
-	: wxScrolledWindow(pParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxFULL_REPAINT_ON_RESIZE)
+CVIEW_Histogram::CVIEW_Histogram(CWKSP_Layer *pLayer)
+	: CVIEW_Base(pLayer, ID_VIEW_HISTOGRAM, pLayer->Get_Name(), ID_IMG_WND_HISTOGRAM)
 {
 	SYS_Set_Color_BG_Window(this);
 
@@ -166,7 +121,7 @@ CVIEW_Histogram_Control::CVIEW_Histogram_Control(wxWindow *pParent, CWKSP_Layer
 	m_bCumulative	= false;
 	m_bMouse_Down	= false;
 
-	Update_Histogram();
+	Do_Update();
 }
 
 
@@ -175,128 +130,30 @@ CVIEW_Histogram_Control::CVIEW_Histogram_Control(wxWindow *pParent, CWKSP_Layer
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CVIEW_Histogram_Control::Update_Histogram(void)
-{
-	if( m_pLayer->Get_Classifier()->Histogram_Update() )
-	{
-		Refresh();
-
-		return( true );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-void CVIEW_Histogram_Control::Set_Cumulative(bool bOn)
-{
-	if( m_bCumulative != bOn )
-	{
-		m_bCumulative	= bOn;
-
-		Refresh();
-	}
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-void CVIEW_Histogram_Control::On_Mouse_Motion(wxMouseEvent &event)
-{
-	if( m_bMouse_Down )
-	{
-		wxClientDC	dc(this);
-		wxRect		r(_Draw_Get_rDiagram(wxRect(wxPoint(0, 0), GetClientSize())));
-		dc.SetLogicalFunction(wxINVERT);
-
-		dc.DrawRectangle(m_Mouse_Down.x, r.GetTop(), m_Mouse_Move.x - m_Mouse_Down.x, r.GetHeight());
-		m_Mouse_Move	= event.GetPosition();
-		dc.DrawRectangle(m_Mouse_Down.x, r.GetTop(), m_Mouse_Move.x - m_Mouse_Down.x, r.GetHeight());
-	}
-}
-
-//---------------------------------------------------------
-void CVIEW_Histogram_Control::On_Mouse_LDown(wxMouseEvent &event)
-{
-	switch( m_pLayer->Get_Classifier()->Get_Mode() )
-	{
-	default:
-		break;
-
-	case CLASSIFY_GRADUATED:
-	case CLASSIFY_METRIC:
-	case CLASSIFY_SHADE:
-	case CLASSIFY_OVERLAY:
-		m_bMouse_Down	= true;
-		m_Mouse_Move	= m_Mouse_Down	= event.GetPosition();
-
-		CaptureMouse();
-	}
-}
-
-//---------------------------------------------------------
-void CVIEW_Histogram_Control::On_Mouse_LUp(wxMouseEvent &event)
+wxMenu * CVIEW_Histogram::_Create_Menu(void)
 {
-	if( m_bMouse_Down )
-	{
-		ReleaseMouse();
-
-		m_bMouse_Down	= false;
-		m_Mouse_Move	= event.GetPosition();
+	wxMenu	*pMenu	= new wxMenu;
 
-		wxRect	r(_Draw_Get_rDiagram(wxRect(wxPoint(0, 0), GetClientSize())));
+	CMD_Menu_Add_Item(pMenu, true , ID_CMD_HISTOGRAM_CUMULATIVE);
+	pMenu->AppendSeparator();
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_HISTOGRAM_AS_TABLE);
+	CMD_Menu_Add_Item(pMenu, false, ID_CMD_HISTOGRAM_TO_CLIPBOARD);
 
-		m_pLayer->Set_Color_Range(
-			m_pLayer->Get_Classifier()->Get_RelativeToMetric(
-				(double)(m_Mouse_Down.x - r.GetLeft()) / (double)r.GetWidth()),
-			m_pLayer->Get_Classifier()->Get_RelativeToMetric(
-				(double)(m_Mouse_Move.x - r.GetLeft()) / (double)r.GetWidth())
-		);
-	}
+	return( pMenu );
 }
 
 //---------------------------------------------------------
-void CVIEW_Histogram_Control::On_Mouse_RDown(wxMouseEvent &event)
+wxToolBarBase * CVIEW_Histogram::_Create_ToolBar(void)
 {
-	switch( m_pLayer->Get_Classifier()->Get_Mode() )
-	{
-	default:
-		break;
-
-	case CLASSIFY_GRADUATED:
-	case CLASSIFY_METRIC:
-	case CLASSIFY_SHADE:
-	case CLASSIFY_OVERLAY:
-		switch( m_pLayer->Get_Type() )
-		{
-		default:
-			return;
+	wxToolBarBase	*pToolBar	= CMD_ToolBar_Create(ID_TB_VIEW_HISTOGRAM);
 
-		case WKSP_ITEM_Grid:
-			m_pLayer->Set_Color_Range(
-				((CWKSP_Grid *)m_pLayer)->Get_Grid()->Get_ZMin(),
-				((CWKSP_Grid *)m_pLayer)->Get_Grid()->Get_ZMax()
-			);
-			break;
+	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_HISTOGRAM_CUMULATIVE);
+	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_HISTOGRAM_AS_TABLE);
+//	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_HISTOGRAM_TO_CLIPBOARD);
 
-		case WKSP_ITEM_Shapes:
-			m_pLayer->Set_Color_Range(
-				((CWKSP_Shapes *)m_pLayer)->Get_Shapes()->Get_Minimum(m_pLayer->Get_Parameter("METRIC_ATTRIB")->asInt()),
-				((CWKSP_Shapes *)m_pLayer)->Get_Shapes()->Get_Maximum(m_pLayer->Get_Parameter("METRIC_ATTRIB")->asInt())
-			);
-			break;
+	CMD_ToolBar_Add(pToolBar, _TL("Histogram"));
 
-		case WKSP_ITEM_PointCloud:
-			m_pLayer->Set_Color_Range(
-				((CWKSP_PointCloud *)m_pLayer)->Get_PointCloud()->Get_Minimum(m_pLayer->Get_Parameter("METRIC_ATTRIB")->asInt()),
-				((CWKSP_PointCloud *)m_pLayer)->Get_PointCloud()->Get_Maximum(m_pLayer->Get_Parameter("METRIC_ATTRIB")->asInt())
-			);
-			break;
-		}
-	}
+	return( pToolBar );
 }
 
 
@@ -305,20 +162,12 @@ void CVIEW_Histogram_Control::On_Mouse_RDown(wxMouseEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CVIEW_Histogram_Control::On_Size(wxSizeEvent &WXUNUSED(event))
-{
-	Refresh();
-}
-
-//---------------------------------------------------------
-void CVIEW_Histogram_Control::On_Paint(wxPaintEvent &event)
+void CVIEW_Histogram::Do_Update(void)
 {
-	wxPaintDC	dc(this);
-	wxRect		r(wxPoint(0, 0), GetClientSize());
-
-	Draw_Edge(dc, EDGE_STYLE_SUNKEN, r);
-
-	Draw(dc, r);
+	if( m_pLayer->Get_Classifier()->Histogram_Update() )
+	{
+		Refresh();
+	}
 }
 
 
@@ -327,20 +176,20 @@ void CVIEW_Histogram_Control::On_Paint(wxPaintEvent &event)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CVIEW_Histogram_Control::Draw(wxDC &dc, wxRect rDraw)
+void CVIEW_Histogram::Draw(wxDC &dc, wxRect r)
 {
-	wxRect		r(_Draw_Get_rDiagram(rDraw));
-	wxFont		Font;
-
-	Font.SetFamily(wxSWISS);
+	wxFont	Font;
+	Font.SetFamily(wxFONTFAMILY_SWISS);
 	dc.SetFont(Font);
 
-	_Draw_Histogram	(dc, r);
-	_Draw_Frame		(dc, r);
+	r	= Draw_Get_rDiagram(r);
+
+	Draw_Histogram(dc, r);
+	Draw_Frame    (dc, r);
 }
 
 //---------------------------------------------------------
-void CVIEW_Histogram_Control::_Draw_Histogram(wxDC &dc, wxRect r)
+void CVIEW_Histogram::Draw_Histogram(wxDC &dc, wxRect r)
 {
 	int		nClasses	= m_pLayer->Get_Classifier()->Get_Class_Count();
 
@@ -373,7 +222,7 @@ void CVIEW_Histogram_Control::_Draw_Histogram(wxDC &dc, wxRect r)
 }
 
 //---------------------------------------------------------
-void CVIEW_Histogram_Control::_Draw_Frame(wxDC &dc, wxRect r)
+void CVIEW_Histogram::Draw_Frame(wxDC &dc, wxRect r)
 {
 	const int	dyFont		= 12,
 				Precision	= 3;
@@ -436,7 +285,7 @@ void CVIEW_Histogram_Control::_Draw_Frame(wxDC &dc, wxRect r)
 }
 
 //---------------------------------------------------------
-wxRect CVIEW_Histogram_Control::_Draw_Get_rDiagram(wxRect r)
+wxRect CVIEW_Histogram::Draw_Get_rDiagram(wxRect r)
 {
 	if( m_pLayer->Get_Classifier()->Get_Mode() == CLASSIFY_LUT )
 	{
@@ -452,62 +301,26 @@ wxRect CVIEW_Histogram_Control::_Draw_Get_rDiagram(wxRect r)
 	));
 }
 
-//---------------------------------------------------------
-#include <wx/clipbrd.h>
-
-void CVIEW_Histogram_Control::ToClipboard(void)
-{
-	wxBitmap	BMP(GetSize());
-	wxMemoryDC	dc;
-	
-	dc.SelectObject(BMP);
-	dc.SetBackground(*wxWHITE_BRUSH);
-	dc.Clear();
-
-	Draw(dc, wxRect(BMP.GetSize()));
-
-	dc.SelectObject(wxNullBitmap);
-
-	if( wxTheClipboard->Open() )
-	{
-		wxBitmapDataObject	*pBMP	= new wxBitmapDataObject;
-		pBMP->SetBitmap(BMP);
-		wxTheClipboard->SetData(pBMP);
-		wxTheClipboard->Close();
-	}
-}
-
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
-//														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-IMPLEMENT_CLASS(CVIEW_Histogram, CVIEW_Base);
-
-//---------------------------------------------------------
-BEGIN_EVENT_TABLE(CVIEW_Histogram, CVIEW_Base)
-	EVT_SIZE			(CVIEW_Histogram::On_Size)
-
-	EVT_MENU			(ID_CMD_HISTOGRAM_CUMULATIVE	, CVIEW_Histogram::On_Cumulative)
-	EVT_UPDATE_UI		(ID_CMD_HISTOGRAM_CUMULATIVE	, CVIEW_Histogram::On_Cumulative_UI)
-	EVT_MENU			(ID_CMD_HISTOGRAM_AS_TABLE		, CVIEW_Histogram::On_AsTable)
-	EVT_MENU			(ID_CMD_HISTOGRAM_TO_CLIPBOARD  , CVIEW_Histogram::On_ToClipboard)
-END_EVENT_TABLE()
+void CVIEW_Histogram::On_Paint(wxPaintEvent &event)
+{
+	wxPaintDC	dc(this);
+	wxRect		r(wxPoint(0, 0), GetClientSize());
 
+	Draw_Edge(dc, EDGE_STYLE_SUNKEN, r);
 
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
+	Draw(dc, r);
+}
 
 //---------------------------------------------------------
-CVIEW_Histogram::CVIEW_Histogram(CWKSP_Layer *pLayer)
-	: CVIEW_Base(pLayer, ID_VIEW_HISTOGRAM, pLayer->Get_Name(), ID_IMG_WND_HISTOGRAM)
+void CVIEW_Histogram::On_Size(wxSizeEvent &WXUNUSED(event))
 {
-	m_pControl	= new CVIEW_Histogram_Control(this, pLayer);
-	m_pControl->SetSize(GetClientSize());
+	Refresh();
 }
 
 
@@ -516,52 +329,99 @@ CVIEW_Histogram::CVIEW_Histogram(CWKSP_Layer *pLayer)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-wxMenu * CVIEW_Histogram::_Create_Menu(void)
+void CVIEW_Histogram::On_Mouse_Motion(wxMouseEvent &event)
 {
-	wxMenu	*pMenu	= new wxMenu;
-
-	CMD_Menu_Add_Item(pMenu, true , ID_CMD_HISTOGRAM_CUMULATIVE);
-	pMenu->AppendSeparator();
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_HISTOGRAM_AS_TABLE);
-	CMD_Menu_Add_Item(pMenu, false, ID_CMD_HISTOGRAM_TO_CLIPBOARD);
+	if( m_bMouse_Down )
+	{
+		wxClientDC	dc(this);
+		wxRect		r(Draw_Get_rDiagram(wxRect(wxPoint(0, 0), GetClientSize())));
+		dc.SetLogicalFunction(wxINVERT);
 
-	return( pMenu );
+		dc.DrawRectangle(m_Mouse_Down.x, r.GetTop(), m_Mouse_Move.x - m_Mouse_Down.x, r.GetHeight());
+		m_Mouse_Move	= event.GetPosition();
+		dc.DrawRectangle(m_Mouse_Down.x, r.GetTop(), m_Mouse_Move.x - m_Mouse_Down.x, r.GetHeight());
+	}
 }
 
 //---------------------------------------------------------
-wxToolBarBase * CVIEW_Histogram::_Create_ToolBar(void)
+void CVIEW_Histogram::On_Mouse_LDown(wxMouseEvent &event)
 {
-	wxToolBarBase	*pToolBar	= CMD_ToolBar_Create(ID_TB_VIEW_HISTOGRAM);
-
-	CMD_ToolBar_Add_Item(pToolBar, true , ID_CMD_HISTOGRAM_CUMULATIVE);
-	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_HISTOGRAM_AS_TABLE);
-//	CMD_ToolBar_Add_Item(pToolBar, false, ID_CMD_HISTOGRAM_TO_CLIPBOARD);
+	switch( m_pLayer->Get_Classifier()->Get_Mode() )
+	{
+	default:
+		break;
 
-	CMD_ToolBar_Add(pToolBar, _TL("Histogram"));
+	case CLASSIFY_GRADUATED:
+	case CLASSIFY_METRIC:
+	case CLASSIFY_SHADE:
+	case CLASSIFY_OVERLAY:
+		m_bMouse_Down	= true;
+		m_Mouse_Move	= m_Mouse_Down	= event.GetPosition();
 
-	return( pToolBar );
+		CaptureMouse();
+	}
 }
 
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
 //---------------------------------------------------------
-void CVIEW_Histogram::Do_Update(void)
+void CVIEW_Histogram::On_Mouse_LUp(wxMouseEvent &event)
 {
-	m_pControl->Update_Histogram();
-}
+	if( m_bMouse_Down )
+	{
+		ReleaseMouse();
 
+		m_bMouse_Down	= false;
+		m_Mouse_Move	= event.GetPosition();
 
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
+		wxRect	r(Draw_Get_rDiagram(wxRect(wxPoint(0, 0), GetClientSize())));
+
+		m_pLayer->Set_Color_Range(
+			m_pLayer->Get_Classifier()->Get_RelativeToMetric(
+				(double)(m_Mouse_Down.x - r.GetLeft()) / (double)r.GetWidth()),
+			m_pLayer->Get_Classifier()->Get_RelativeToMetric(
+				(double)(m_Mouse_Move.x - r.GetLeft()) / (double)r.GetWidth())
+		);
+	}
+}
 
 //---------------------------------------------------------
-void CVIEW_Histogram::On_Size(wxSizeEvent &event)
+void CVIEW_Histogram::On_Mouse_RDown(wxMouseEvent &event)
 {
-	m_pControl->SetSize(GetClientSize());
+	switch( m_pLayer->Get_Classifier()->Get_Mode() )
+	{
+	default:
+		break;
+
+	case CLASSIFY_GRADUATED:
+	case CLASSIFY_METRIC:
+	case CLASSIFY_SHADE:
+	case CLASSIFY_OVERLAY:
+		switch( m_pLayer->Get_Type() )
+		{
+		default:
+			return;
+
+		case WKSP_ITEM_Grid:
+			m_pLayer->Set_Color_Range(
+				((CWKSP_Grid *)m_pLayer)->Get_Grid()->Get_ZMin(),
+				((CWKSP_Grid *)m_pLayer)->Get_Grid()->Get_ZMax()
+			);
+			break;
+
+		case WKSP_ITEM_Shapes:
+			m_pLayer->Set_Color_Range(
+				((CWKSP_Shapes *)m_pLayer)->Get_Shapes()->Get_Minimum(m_pLayer->Get_Parameter("METRIC_ATTRIB")->asInt()),
+				((CWKSP_Shapes *)m_pLayer)->Get_Shapes()->Get_Maximum(m_pLayer->Get_Parameter("METRIC_ATTRIB")->asInt())
+			);
+			break;
+
+		case WKSP_ITEM_PointCloud:
+			m_pLayer->Set_Color_Range(
+				((CWKSP_PointCloud *)m_pLayer)->Get_PointCloud()->Get_Minimum(m_pLayer->Get_Parameter("METRIC_ATTRIB")->asInt()),
+				((CWKSP_PointCloud *)m_pLayer)->Get_PointCloud()->Get_Maximum(m_pLayer->Get_Parameter("METRIC_ATTRIB")->asInt())
+			);
+			break;
+		}
+	}
 }
 
 
@@ -578,7 +438,7 @@ void CVIEW_Histogram::On_Command_UI(wxUpdateUIEvent &event)
 		break;
 
 	case ID_CMD_HISTOGRAM_CUMULATIVE:
-		On_Cumulative_UI(event);
+		event.Check(m_bCumulative);
 		break;
 	}
 }
@@ -586,12 +446,9 @@ void CVIEW_Histogram::On_Command_UI(wxUpdateUIEvent &event)
 //---------------------------------------------------------
 void CVIEW_Histogram::On_Cumulative(wxCommandEvent &event)
 {
-	m_pControl->Set_Cumulative(!m_pControl->Get_Cumulative());
-}
+	m_bCumulative	= !m_bCumulative;
 
-void CVIEW_Histogram::On_Cumulative_UI(wxUpdateUIEvent &event)
-{
-	event.Check(m_pControl->Get_Cumulative());
+	Refresh();
 }
 
 //---------------------------------------------------------
@@ -639,7 +496,24 @@ void CVIEW_Histogram::On_AsTable(wxCommandEvent &event)
 //---------------------------------------------------------
 void CVIEW_Histogram::On_ToClipboard(wxCommandEvent &event)
 {
-	m_pControl->ToClipboard();
+	wxBitmap	BMP(GetSize());
+	wxMemoryDC	dc;
+	
+	dc.SelectObject(BMP);
+	dc.SetBackground(*wxWHITE_BRUSH);
+	dc.Clear();
+
+	Draw(dc, wxRect(BMP.GetSize()));
+
+	dc.SelectObject(wxNullBitmap);
+
+	if( wxTheClipboard->Open() )
+	{
+		wxBitmapDataObject	*pBMP	= new wxBitmapDataObject;
+		pBMP->SetBitmap(BMP);
+		wxTheClipboard->SetData(pBMP);
+		wxTheClipboard->Close();
+	}
 }
 
 
diff --git a/src/saga_core/saga_gui/view_histogram.h b/src/saga_core/saga_gui/view_histogram.h
index 7c346d6..3e1783c 100755
--- a/src/saga_core/saga_gui/view_histogram.h
+++ b/src/saga_core/saga_gui/view_histogram.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_histogram.h 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -97,12 +97,28 @@ public:
 
 private:
 
-	class CVIEW_Histogram_Control	*m_pControl;
+	bool							m_bCumulative, m_bMouse_Down;
 
+	wxPoint							m_Mouse_Down, m_Mouse_Move;
+
+	class CWKSP_Layer				*m_pLayer;
+
+
+	void							Draw				(wxDC &dc, wxRect r);
+	void							Draw_Histogram		(wxDC &dc, wxRect r);
+	void							Draw_Frame			(wxDC &dc, wxRect r);
+	wxRect							Draw_Get_rDiagram	(wxRect r);
+
+	void							On_Paint			(wxPaintEvent    &event);
 	void							On_Size				(wxSizeEvent     &event);
 
-	void							On_Cumulative		(wxCommandEvent  &event);
+	void							On_Mouse_Motion		(wxMouseEvent    &event);
+	void							On_Mouse_LDown		(wxMouseEvent    &event);
+	void							On_Mouse_LUp		(wxMouseEvent    &event);
+	void							On_Mouse_RDown		(wxMouseEvent    &event);
+
 	void							On_Cumulative_UI	(wxUpdateUIEvent &event);
+	void							On_Cumulative		(wxCommandEvent  &event);
 	void							On_AsTable			(wxCommandEvent  &event);
 	void							On_ToClipboard		(wxCommandEvent  &event);
 
diff --git a/src/saga_core/saga_gui/view_layout.cpp b/src/saga_core/saga_gui/view_layout.cpp
index 43289b9..a20fb92 100755
--- a/src/saga_core/saga_gui/view_layout.cpp
+++ b/src/saga_core/saga_gui/view_layout.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_layout.h b/src/saga_core/saga_gui/view_layout.h
index 518d06b..145dd5a 100755
--- a/src/saga_core/saga_gui/view_layout.h
+++ b/src/saga_core/saga_gui/view_layout.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout.h 2061 2014-03-20 11:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_layout_control.cpp b/src/saga_core/saga_gui/view_layout_control.cpp
index 3169150..66b487f 100755
--- a/src/saga_core/saga_gui/view_layout_control.cpp
+++ b/src/saga_core/saga_gui/view_layout_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout_control.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_layout_control.h b/src/saga_core/saga_gui/view_layout_control.h
index 1b2fd4a..c0a108d 100755
--- a/src/saga_core/saga_gui/view_layout_control.h
+++ b/src/saga_core/saga_gui/view_layout_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout_control.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_layout_info.cpp b/src/saga_core/saga_gui/view_layout_info.cpp
index 3fd87fe..7506f16 100755
--- a/src/saga_core/saga_gui/view_layout_info.cpp
+++ b/src/saga_core/saga_gui/view_layout_info.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout_info.cpp 2548 2015-08-13 13:07:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_layout_info.h b/src/saga_core/saga_gui/view_layout_info.h
index f06c792..455c25a 100755
--- a/src/saga_core/saga_gui/view_layout_info.h
+++ b/src/saga_core/saga_gui/view_layout_info.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout_info.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_layout_printout.cpp b/src/saga_core/saga_gui/view_layout_printout.cpp
index 2d29726..341d266 100755
--- a/src/saga_core/saga_gui/view_layout_printout.cpp
+++ b/src/saga_core/saga_gui/view_layout_printout.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout_printout.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_layout_printout.h b/src/saga_core/saga_gui/view_layout_printout.h
index 974c560..dfeb749 100755
--- a/src/saga_core/saga_gui/view_layout_printout.h
+++ b/src/saga_core/saga_gui/view_layout_printout.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout_printout.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_map.cpp b/src/saga_core/saga_gui/view_map.cpp
index 74bc644..3ac948a 100755
--- a/src/saga_core/saga_gui/view_map.cpp
+++ b/src/saga_core/saga_gui/view_map.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map.cpp 2823 2016-02-24 17:57:07Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_map.h b/src/saga_core/saga_gui/view_map.h
index be02206..01c80ae 100755
--- a/src/saga_core/saga_gui/view_map.h
+++ b/src/saga_core/saga_gui/view_map.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map.h 2793 2016-02-16 16:51:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_map_3d.cpp b/src/saga_core/saga_gui/view_map_3d.cpp
index 2676945..ceddcbe 100755
--- a/src/saga_core/saga_gui/view_map_3d.cpp
+++ b/src/saga_core/saga_gui/view_map_3d.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_3d.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_map_3d.h b/src/saga_core/saga_gui/view_map_3d.h
index c70e606..11670af 100755
--- a/src/saga_core/saga_gui/view_map_3d.h
+++ b/src/saga_core/saga_gui/view_map_3d.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_3d.h 2127 2014-05-16 12:56:30Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_map_control.cpp b/src/saga_core/saga_gui/view_map_control.cpp
index 3b5df2c..60e4823 100755
--- a/src/saga_core/saga_gui/view_map_control.cpp
+++ b/src/saga_core/saga_gui/view_map_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_control.cpp 2749 2016-01-13 17:37:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_map_control.h b/src/saga_core/saga_gui/view_map_control.h
index ef38b3e..76b8c82 100755
--- a/src/saga_core/saga_gui/view_map_control.h
+++ b/src/saga_core/saga_gui/view_map_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_control.h 2027 2014-02-27 15:14:20Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_ruler.cpp b/src/saga_core/saga_gui/view_ruler.cpp
index e09b654..7d3d783 100755
--- a/src/saga_core/saga_gui/view_ruler.cpp
+++ b/src/saga_core/saga_gui/view_ruler.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_ruler.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_ruler.h b/src/saga_core/saga_gui/view_ruler.h
index 218ae99..c461e4f 100755
--- a/src/saga_core/saga_gui/view_ruler.h
+++ b/src/saga_core/saga_gui/view_ruler.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_ruler.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_scatterplot.cpp b/src/saga_core/saga_gui/view_scatterplot.cpp
index 45e89a1..67738a9 100755
--- a/src/saga_core/saga_gui/view_scatterplot.cpp
+++ b/src/saga_core/saga_gui/view_scatterplot.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_scatterplot.cpp 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_scatterplot.h b/src/saga_core/saga_gui/view_scatterplot.h
index 80d687a..575336c 100755
--- a/src/saga_core/saga_gui/view_scatterplot.h
+++ b/src/saga_core/saga_gui/view_scatterplot.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_scatterplot.h 2061 2014-03-20 11:48:01Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_table.cpp b/src/saga_core/saga_gui/view_table.cpp
index 570606a..5901794 100755
--- a/src/saga_core/saga_gui/view_table.cpp
+++ b/src/saga_core/saga_gui/view_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_table.h b/src/saga_core/saga_gui/view_table.h
index 7ed518b..925665b 100755
--- a/src/saga_core/saga_gui/view_table.h
+++ b/src/saga_core/saga_gui/view_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table.h 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_table_control.cpp b/src/saga_core/saga_gui/view_table_control.cpp
index 0698fb7..0d4fbb8 100755
--- a/src/saga_core/saga_gui/view_table_control.cpp
+++ b/src/saga_core/saga_gui/view_table_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table_control.cpp 2730 2015-12-16 11:55:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -163,6 +163,8 @@ CVIEW_Table_Control::CVIEW_Table_Control(wxWindow *pParent, CSG_Table *pTable, i
 	CreateGrid(0, 0, wxGrid::wxGridSelectRows);
 
 	Update_Table();
+
+	wxGrid::AdjustScrollbars();
 }
 
 //---------------------------------------------------------
@@ -443,6 +445,8 @@ bool CVIEW_Table_Control::_Update_Sorting(int iField, int Direction)
 {
 	if( iField >= 0 && iField < m_pTable->Get_Field_Count() )
 	{
+		m_Cursor	= -1;
+
 		switch( Direction )
 		{
 		default:	m_pTable->Toggle_Index(iField);	break;
@@ -497,15 +501,17 @@ bool CVIEW_Table_Control::_Set_Scroll_Start(int Position, bool bEnforceUpdate)
 //---------------------------------------------------------
 void CVIEW_Table_Control::AdjustScrollbars(void)
 {
-	Freeze();
-	
-	wxGrid::AdjustScrollbars();
-
+	//-----------------------------------------------------
 	m_Scroll_Range	= (GetClientSize().y - GetColLabelSize()) / GetDefaultRowSize();
+//	m_Scroll_Range	= GetGridWindow()->GetClientSize().y / GetDefaultRowSize();
 
 	SetScrollbar(wxVERTICAL, m_Scroll_Start, m_Scroll_Range, _Get_Record_Count());
 
-	Thaw();
+	//-----------------------------------------------------
+	int	Range	= GetGridWindow()->GetVirtualSize().x / GetScrollLineX();
+	int	Thumb	= GetGridWindow()->GetClientSize ().x / GetScrollLineX();
+
+	SetScrollbar(wxHORIZONTAL, GetScrollPos(wxHORIZONTAL), Thumb, Range);
 }
 
 //---------------------------------------------------------
@@ -533,9 +539,9 @@ void CVIEW_Table_Control::On_Key(wxKeyEvent &event)
 {
 	if     ( event.GetKeyCode() == WXK_UP       )
 	{
-		if( GetCursorRow() > 0 )
+		if( GetGridCursorRow() > 0 )
 		{
-			SetGridCursor(GetCursorRow() - 1, GetCursorColumn());
+			SetGridCursor(GetGridCursorRow() - 1, GetGridCursorCol());
 		}
 		else
 		{
@@ -544,9 +550,9 @@ void CVIEW_Table_Control::On_Key(wxKeyEvent &event)
 	}
 	else if( event.GetKeyCode() == WXK_DOWN     )
 	{
-		if( GetCursorRow() < m_Scroll_Range - 1 )
+		if( GetGridCursorRow() < m_Scroll_Range - 1 )
 		{
-			SetGridCursor(GetCursorRow() + 1, GetCursorColumn());
+			SetGridCursor(GetGridCursorRow() + 1, GetGridCursorCol());
 		}
 		else
 		{
@@ -576,9 +582,7 @@ void CVIEW_Table_Control::On_Size(wxSizeEvent &event)//&WXUNUSED(event))
 
 		if( Scroll_Range != m_Scroll_Range )
 		{
-			Freeze();
 			_Update_Records();
-			Thaw();
 		}
 	}
 }
@@ -672,51 +676,46 @@ void CVIEW_Table_Control::On_LClick(wxGridEvent &event)
 //---------------------------------------------------------
 void CVIEW_Table_Control::On_LClick_Label(wxGridEvent &event)
 {
-	if( m_bSelOnly )
-	{
-		// nop
-	}
-	else if( event.GetRow() < 0 )
-	{
-		if( event.GetCol() < 0 && m_pTable->Get_Selection_Count() > 0 )	// deselect everything
-		{
-			m_pTable->Select();
-
-			Update_Selection();	_Update_Views();
-		}
-	}
-	else // if( event.GetRow() >= 0 )	// select records
+	if( !m_bSelOnly )
 	{
-		if( !event.ControlDown() )
+		if( event.GetRow() >= 0 )	// select records
 		{
-			m_pTable->Select();
-
-			if( !event.ShiftDown() || m_Cursor < 0 || m_Cursor >= m_pTable->Get_Count() )
+			if( event.ControlDown() )
 			{
+				m_pTable->Select(_Get_Record(event.GetRow()), true);
+			}
+			else if( !event.ShiftDown() )
+			{
+				m_pTable->Select();	// deselect everything
+
 				m_pTable->Select(_Get_Record(event.GetRow()), false);
 			}
-			else // if( event.ShiftDown() )
+			else if( m_Cursor >= 0 && m_Cursor < m_pTable->Get_Count() )
 			{
-				int	iFirst	= m_Scroll_Start + event.GetRow() <= m_Cursor ? m_Scroll_Start + event.GetRow() : m_Cursor;
-				int	iLast	= m_Scroll_Start + event.GetRow() >  m_Cursor ? m_Scroll_Start + event.GetRow() : m_Cursor;
+				int	iFirst	= m_Scroll_Start + event.GetRow() <= m_Cursor ? m_Scroll_Start + event.GetRow() : m_Cursor + 1;
+				int	iLast	= m_Scroll_Start + event.GetRow() >  m_Cursor ? m_Scroll_Start + event.GetRow() : m_Cursor - 1;
 
 				for(int iRecord=iFirst; iRecord<=iLast; iRecord++)
 				{
-					m_pTable->Select(iRecord, true);
+					m_pTable->Select(m_pTable->Get_Record_byIndex(iRecord)->Get_Index(), true);
 				}
 			}
+
+			Update_Selection();	_Update_Views();
 		}
-		else // if( event.ControlDown() )
+		else if( event.GetCol() < 0 )
 		{
-			m_pTable->Select(_Get_Record(event.GetRow()), true);
-		}
+			m_pTable->Select();	// deselect everything
 
-		Update_Selection();	_Update_Views();
+			Update_Selection();	_Update_Views();
+		}
 	}
 
 	m_Cursor	= m_Scroll_Start + event.GetRow();
 
 	SetGridCursor(event.GetRow(), GetGridCursorCol());
+
+	GetGridWindow()->SetFocus();
 }
 
 //---------------------------------------------------------
@@ -733,7 +732,11 @@ void CVIEW_Table_Control::On_LDClick_Label(wxGridEvent &event)
 //---------------------------------------------------------
 bool CVIEW_Table_Control::_Get_DataSource(wxString &Source)
 {
-	if( Source.Find("PGSQL:") == 0 || wxFileExists(Source) )
+	if( Source.Find("PGSQL:" ) == 0
+	||	Source.Find("ftp://" ) == 0
+	||	Source.Find("http://") == 0
+	||	Source.Find("file://") == 0
+	||  wxFileExists(Source) )
 	{
 		return( true );
 	}
diff --git a/src/saga_core/saga_gui/view_table_control.h b/src/saga_core/saga_gui/view_table_control.h
index 51565f0..4408245 100755
--- a/src/saga_core/saga_gui/view_table_control.h
+++ b/src/saga_core/saga_gui/view_table_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table_control.h 2730 2015-12-16 11:55:46Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/view_table_diagram.cpp b/src/saga_core/saga_gui/view_table_diagram.cpp
index 3429d4b..766ae4d 100755
--- a/src/saga_core/saga_gui/view_table_diagram.cpp
+++ b/src/saga_core/saga_gui/view_table_diagram.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table_diagram.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -925,8 +925,8 @@ void CVIEW_Table_Diagram_Control::_Draw_Lines(wxDC &dc, wxRect r, double dx, dou
 
 		iField	= m_Fields[iField];
 
-		dc.SetPen  (wxPen  (Get_Color_asWX(m_Colors.Get_Color(iField)), 0, wxSOLID));
-		dc.SetBrush(wxBrush(Get_Color_asWX(m_Colors.Get_Color(iField)), wxSOLID));
+		dc.SetPen  (wxPen  (Get_Color_asWX(m_Colors.Get_Color(iField)), 0, wxPENSTYLE_SOLID));
+		dc.SetBrush(wxBrush(Get_Color_asWX(m_Colors.Get_Color(iField)), wxBRUSHSTYLE_SOLID));
 
 		ix	= DRAW_GET_XPOS(0);
 		iy	= DRAW_GET_YPOS(0);
@@ -954,7 +954,7 @@ void CVIEW_Table_Diagram_Control::_Draw_Bars(wxDC &dc, wxRect r, double dx, doub
 
 	iField	= m_Fields[iField];
 
-	dc.SetPen(wxPen(Get_Color_asWX(m_Colors.Get_Color(iField)), 0, wxSOLID));
+	dc.SetPen(wxPen(Get_Color_asWX(m_Colors.Get_Color(iField)), 0, wxPENSTYLE_SOLID));
 
 	for(int iRecord=0; iRecord<m_pTable->Get_Count(); iRecord++)
 	{
diff --git a/src/saga_core/saga_gui/view_table_diagram.h b/src/saga_core/saga_gui/view_table_diagram.h
index ced5d6a..49b1cf8 100755
--- a/src/saga_core/saga_gui/view_table_diagram.h
+++ b/src/saga_core/saga_gui/view_table_diagram.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_table_diagram.h 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp.cpp b/src/saga_core/saga_gui/wksp.cpp
index d4a128a..8a6d497 100755
--- a/src/saga_core/saga_gui/wksp.cpp
+++ b/src/saga_core/saga_gui/wksp.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp.cpp 2674 2015-11-03 17:03:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp.h b/src/saga_core/saga_gui/wksp.h
index 863466d..ed7cf1d 100755
--- a/src/saga_core/saga_gui/wksp.h
+++ b/src/saga_core/saga_gui/wksp.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_base_control.cpp b/src/saga_core/saga_gui/wksp_base_control.cpp
index 7008d32..418b410 100755
--- a/src/saga_core/saga_gui/wksp_base_control.cpp
+++ b/src/saga_core/saga_gui/wksp_base_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_control.cpp 2833 2016-02-26 12:30:52Z oconrad $
+ * Version $Id$
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_base_control.h b/src/saga_core/saga_gui/wksp_base_control.h
index 2a1056f..4d5de01 100755
--- a/src/saga_core/saga_gui/wksp_base_control.h
+++ b/src/saga_core/saga_gui/wksp_base_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_control.h 2833 2016-02-26 12:30:52Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_base_item.cpp b/src/saga_core/saga_gui/wksp_base_item.cpp
index 628d70f..9e10bb9 100755
--- a/src/saga_core/saga_gui/wksp_base_item.cpp
+++ b/src/saga_core/saga_gui/wksp_base_item.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_item.cpp 2833 2016-02-26 12:30:52Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_base_item.h b/src/saga_core/saga_gui/wksp_base_item.h
index 6fc5898..37db455 100755
--- a/src/saga_core/saga_gui/wksp_base_item.h
+++ b/src/saga_core/saga_gui/wksp_base_item.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_item.h 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_base_manager.cpp b/src/saga_core/saga_gui/wksp_base_manager.cpp
index b4ee12e..c4072ad 100755
--- a/src/saga_core/saga_gui/wksp_base_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_base_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_manager.cpp 2275 2014-10-02 15:48:59Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_base_manager.h b/src/saga_core/saga_gui/wksp_base_manager.h
index 8099ccc..ade1e57 100755
--- a/src/saga_core/saga_gui/wksp_base_manager.h
+++ b/src/saga_core/saga_gui/wksp_base_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_control.cpp b/src/saga_core/saga_gui/wksp_data_control.cpp
index 4bf16c2..d69a008 100755
--- a/src/saga_core/saga_gui/wksp_data_control.cpp
+++ b/src/saga_core/saga_gui/wksp_data_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_control.cpp 2870 2016-03-30 11:30:54Z oconrad $
+ * Version $Id$
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_control.h b/src/saga_core/saga_gui/wksp_data_control.h
index 58b40ac..9087b12 100755
--- a/src/saga_core/saga_gui/wksp_data_control.h
+++ b/src/saga_core/saga_gui/wksp_data_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_control.h 2833 2016-02-26 12:30:52Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_layers.cpp b/src/saga_core/saga_gui/wksp_data_layers.cpp
index 86b8ba8..dbe6c36 100755
--- a/src/saga_core/saga_gui/wksp_data_layers.cpp
+++ b/src/saga_core/saga_gui/wksp_data_layers.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_layers.cpp 2792 2016-02-16 16:50:35Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_layers.h b/src/saga_core/saga_gui/wksp_data_layers.h
index 3d60c26..57d0888 100755
--- a/src/saga_core/saga_gui/wksp_data_layers.h
+++ b/src/saga_core/saga_gui/wksp_data_layers.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_layers.h 2020 2014-02-26 11:21:04Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_manager.cpp b/src/saga_core/saga_gui/wksp_data_manager.cpp
index df88605..f8bbf87 100755
--- a/src/saga_core/saga_gui/wksp_data_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_data_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_manager.cpp 2865 2016-03-29 14:31:27Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -169,43 +169,52 @@ CWKSP_Data_Manager::CWKSP_Data_Manager(void)
 		), 0
 	);
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Bool(
 		pNode	, "SHOW_FILE_SOURCES"		, _TL("Show Data File Sources"),
 		_TL("Show data sources tab for file system. Disabling might speed up start-up. Changes take effect after restart."),
-		PARAMETER_TYPE_Bool, true
+		true
 	);
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Int(
 		pNode	, "NUMBERING"				, _TL("Numbering of Data Sets"),
 		_TL("Leading zeros for data set numbering. Set to -1 for not using numbers at all."),
-		PARAMETER_TYPE_Int, m_Numbering = 2, -1, true
+		m_Numbering = 2, -1, true
 	);
 
-	m_Parameters.Add_Value(
+	//-----------------------------------------------------
+	pNode	= m_Parameters.Add_Node(NULL, "NODE_HISTORY", _TL("History"), _TL(""));
+
+	m_Parameters.Add_Int(
 		pNode	, "HISTORY_DEPTH"			, _TL("History Depth"),
 		_TL("Depth to which data history is stored. Set -1 keeps all history entries (default), 0 switches history option off."),
-		PARAMETER_TYPE_Int, SG_Get_History_Depth(), -1, true
+		SG_Get_History_Depth(), -1, true
+	);
+
+	m_Parameters.Add_Bool(
+		pNode	, "HISTORY_LISTS"			, _TL("Ignore Input Lists"),
+		_TL(""),
+		SG_Get_History_Ignore_Lists() != 0
 	);
 
 	//-----------------------------------------------------
 	pNode	= m_Parameters.Add_Node(NULL, "NODE_THUMBNAILS", _TL("Thumbnails"), _TL(""));
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Int(
 		pNode	, "THUMBNAIL_SIZE"		, _TL("Thumbnail Size"),
 		_TL(""),
-		PARAMETER_TYPE_Int, 75, 10, true
+		75, 10, true
 	);
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Bool(
 		pNode	, "THUMBNAIL_CATEGORY"	, _TL("Show Categories"),
 		_TL(""),
-		PARAMETER_TYPE_Bool, true
+		true
 	);
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Color(
 		pNode	, "THUMBNAIL_SELCOLOR"	, _TL("Selection Color"),
 		_TL(""),
-		PARAMETER_TYPE_Color, Get_Color_asInt(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW))
+		Get_Color_asInt(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW))
 	);
 
 	//-----------------------------------------------------
@@ -224,40 +233,40 @@ CWKSP_Data_Manager::CWKSP_Data_Manager(void)
 		), 1
 	);
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Double(
 		pNode_2	, "GRID_COLORS_FIT_STDDEV"	, _TL("Standard Deviation"),
 		_TL("Multiple of Standard Deviation used as default for histogram stretch."),
-		PARAMETER_TYPE_Double, 2.0, 0.01, true
+		2.0, 0.01, true
 	);
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Double(
 		pNode_2	, "GRID_COLORS_FIT_PCTL"	, _TL("Percentile"),
 		_TL("Percentile used as default for histogram stretch."),
-		PARAMETER_TYPE_Double, 2.0, 0.0, true, 50.0, true
+		2.0, 0.0, true, 50.0, true
 	);
 
 	//-----------------------------------------------------
 	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_GRID_SELECTION", _TL("Selection"), _TL(""));
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Int(
 		pNode_1	, "GRID_SELECT_MAX"			, _TL("Maximum Selection"),
 		_TL("Maximum number of rows/columns in selection of grid cells."),
-		PARAMETER_TYPE_Int, 100, 1, true
+		100, 1, true
 	);
 
 	//-----------------------------------------------------
 	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_GRID_CACHE", _TL("File Caching"), _TL(""));
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Bool(
 		pNode_1	, "GRID_CACHE_AUTO"		, _TL("Automatic"),
 		_TL("Activate file caching automatically, if memory size exceeds the threshold value."),
-		PARAMETER_TYPE_Bool, SG_Grid_Cache_Get_Automatic()
+		SG_Grid_Cache_Get_Automatic()
 	);
 
-	m_Parameters.Add_Value(
+	m_Parameters.Add_Double(
 		pNode_1	, "GRID_CACHE_THRSHLD"	, _TL("Threshold for automatic mode [MB]"),
 		_TL(""),
-		PARAMETER_TYPE_Double, SG_Grid_Cache_Get_Threshold_MB(), 0.0, true
+		SG_Grid_Cache_Get_Threshold_MB(), 0.0, true
 	);
 
 	m_Parameters.Add_Choice(
@@ -284,7 +293,8 @@ CWKSP_Data_Manager::CWKSP_Data_Manager(void)
 	SG_Grid_Cache_Set_Threshold_MB(m_Parameters("GRID_CACHE_THRSHLD")->asDouble());
 	SG_Grid_Cache_Set_Confirm     (m_Parameters("GRID_CACHE_CONFIRM")->asInt   ());
 
-	SG_Set_History_Depth(m_Parameters("HISTORY_DEPTH")->asInt());
+	SG_Set_History_Depth          (m_Parameters("HISTORY_DEPTH"     )->asInt   ());
+	SG_Set_History_Ignore_Lists   (m_Parameters("HISTORY_LISTS"     )->asInt   ());
 
 	m_Numbering	= m_Parameters("NUMBERING")->asInt();
 }
@@ -619,7 +629,8 @@ void CWKSP_Data_Manager::Parameters_Changed(void)
 	SG_Grid_Cache_Set_Threshold_MB(m_Parameters("GRID_CACHE_THRSHLD")->asDouble());
 	SG_Grid_Cache_Set_Confirm     (m_Parameters("GRID_CACHE_CONFIRM")->asInt   ());
 
-	SG_Set_History_Depth(m_Parameters("HISTORY_DEPTH")->asInt());
+	SG_Set_History_Depth          (m_Parameters("HISTORY_DEPTH"     )->asInt   ());
+	SG_Set_History_Ignore_Lists   (m_Parameters("HISTORY_LISTS"     )->asInt   ());
 
 	m_Numbering	= m_Parameters("NUMBERING")->asInt();
 
@@ -838,7 +849,7 @@ bool CWKSP_Data_Manager::Save_Modified(CWKSP_Base_Item *pItem, bool bSelections)
 {
 	CSG_Parameters	Parameters(this, _TL("Save Modified Data"), _TL(""));
 
-	Parameters.Add_Value(NULL, "SAVE_ALL", _TL("Save all"), _TL(""), PARAMETER_TYPE_Bool, false);
+	Parameters.Add_Bool(NULL, "SAVE_ALL", _TL("Save all"), _TL(""), false);
 
 	wxFileName	Directory(m_pProject->Get_File_Name());
 
@@ -1022,19 +1033,19 @@ bool CWKSP_Data_Manager::_Modified_Get(CSG_Parameters *pParameters, CWKSP_Base_I
 	//-----------------------------------------------------
 	CSG_Parameter	*pNode;
 
-	if( (pNode = pParameters->Get_Parameter(CSG_String::Format(SG_T("%d"), (long)pItem->Get_Manager()))) == NULL )
+	if( (pNode = pParameters->Get_Parameter(CSG_String::Format("%d", (long)pItem->Get_Manager()))) == NULL )
 	{
-		pNode	= pParameters->Add_Node(NULL, CSG_String::Format(SG_T("%d"), (long)pItem->Get_Manager()), pItem->Get_Manager()->Get_Name().wx_str(), SG_T(""));
+		pNode	= pParameters->Add_Node(NULL, CSG_String::Format("%d", (long)pItem->Get_Manager()), pItem->Get_Manager()->Get_Name().wx_str(), SG_T(""));
 	}			
 
-	pNode	= pParameters->Add_Value(
-		pNode, CSG_String::Format(SG_T("%d")     , (long)pObject),
-		pItem->Get_Name().wx_str(), SG_T(""), PARAMETER_TYPE_Bool, false
+	pNode	= pParameters->Add_Bool(
+		pNode, CSG_String::Format("%d"     , (long)pObject), pItem->Get_Name().wx_str(),
+		"", false
 	);
 
 	pParameters->Add_FilePath(
-		pNode, CSG_String::Format(SG_T("%d FILE"), (long)pObject),
-		_TL("File"), SG_T(""), Filter, Path.GetFullPath(), true
+		pNode, CSG_String::Format("%d FILE", (long)pObject), _TL("File"),
+		"", Filter, Path.GetFullPath(), true
 	);
 
 	return( true );
diff --git a/src/saga_core/saga_gui/wksp_data_manager.h b/src/saga_core/saga_gui/wksp_data_manager.h
index 9db3c18..aa25a94 100755
--- a/src/saga_core/saga_gui/wksp_data_manager.h
+++ b/src/saga_core/saga_gui/wksp_data_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_manager.h 2800 2016-02-18 17:06:22Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_menu_file.cpp b/src/saga_core/saga_gui/wksp_data_menu_file.cpp
index 339c6bb..7e35dc7 100755
--- a/src/saga_core/saga_gui/wksp_data_menu_file.cpp
+++ b/src/saga_core/saga_gui/wksp_data_menu_file.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_menu_file.cpp 2781 2016-02-11 11:18:49Z oconrad $
+ * Version $Id$
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_menu_file.h b/src/saga_core/saga_gui/wksp_data_menu_file.h
index 0bb398f..c1789ac 100755
--- a/src/saga_core/saga_gui/wksp_data_menu_file.h
+++ b/src/saga_core/saga_gui/wksp_data_menu_file.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_menu_file.h 2551 2015-08-14 15:24:25Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_menu_files.cpp b/src/saga_core/saga_gui/wksp_data_menu_files.cpp
index 2527da4..8b1ce55 100755
--- a/src/saga_core/saga_gui/wksp_data_menu_files.cpp
+++ b/src/saga_core/saga_gui/wksp_data_menu_files.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_menu_files.cpp 2674 2015-11-03 17:03:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_data_menu_files.h b/src/saga_core/saga_gui/wksp_data_menu_files.h
index 025970f..e8a96dc 100755
--- a/src/saga_core/saga_gui/wksp_data_menu_files.h
+++ b/src/saga_core/saga_gui/wksp_data_menu_files.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_menu_files.h 2551 2015-08-14 15:24:25Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_grid.cpp b/src/saga_core/saga_gui/wksp_grid.cpp
index 5bdd04b..3b8e5d3 100755
--- a/src/saga_core/saga_gui/wksp_grid.cpp
+++ b/src/saga_core/saga_gui/wksp_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_grid.cpp 2772 2016-02-05 15:25:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -1700,7 +1700,7 @@ void CWKSP_Grid::_Draw_Edit(CWKSP_Map_DC &dc_Map)
 		a.y	-= 1;
 		b.y	-= 1;
 
-		dc_Map.dc.SetPen(wxPen(wxColour(255, 0, 0), 2, wxSOLID));
+		dc_Map.dc.SetPen(wxPen(wxColour(255, 0, 0), 2, wxPENSTYLE_SOLID));
 		dc_Map.dc.DrawLine(a.x, a.y, a.x, b.y);
 		dc_Map.dc.DrawLine(a.x, b.y, b.x, b.y);
 		dc_Map.dc.DrawLine(b.x, b.y, b.x, a.y);
diff --git a/src/saga_core/saga_gui/wksp_grid.h b/src/saga_core/saga_gui/wksp_grid.h
index 962c7ed..8f04ed5 100755
--- a/src/saga_core/saga_gui/wksp_grid.h
+++ b/src/saga_core/saga_gui/wksp_grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_grid.h 2752 2016-01-15 15:26:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_grid_manager.cpp b/src/saga_core/saga_gui/wksp_grid_manager.cpp
index e4f4e77..3229102 100755
--- a/src/saga_core/saga_gui/wksp_grid_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_grid_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_grid_manager.cpp 2791 2016-02-16 16:48:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_grid_manager.h b/src/saga_core/saga_gui/wksp_grid_manager.h
index 3a59bd3..8a6227e 100755
--- a/src/saga_core/saga_gui/wksp_grid_manager.h
+++ b/src/saga_core/saga_gui/wksp_grid_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_grid_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_grid_system.cpp b/src/saga_core/saga_gui/wksp_grid_system.cpp
index d04a120..f5e4dcc 100755
--- a/src/saga_core/saga_gui/wksp_grid_system.cpp
+++ b/src/saga_core/saga_gui/wksp_grid_system.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_grid_system.cpp 2772 2016-02-05 15:25:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_grid_system.h b/src/saga_core/saga_gui/wksp_grid_system.h
index 9ad7d5b..23d0a2b 100755
--- a/src/saga_core/saga_gui/wksp_grid_system.h
+++ b/src/saga_core/saga_gui/wksp_grid_system.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_grid_system.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_layer.cpp b/src/saga_core/saga_gui/wksp_layer.cpp
index e47233f..2b4f58b 100755
--- a/src/saga_core/saga_gui/wksp_layer.cpp
+++ b/src/saga_core/saga_gui/wksp_layer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_layer.h b/src/saga_core/saga_gui/wksp_layer.h
index 49650bb..c94ebf4 100755
--- a/src/saga_core/saga_gui/wksp_layer.h
+++ b/src/saga_core/saga_gui/wksp_layer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer.h 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_layer_classify.cpp b/src/saga_core/saga_gui/wksp_layer_classify.cpp
index 32d4041..4d90c26 100755
--- a/src/saga_core/saga_gui/wksp_layer_classify.cpp
+++ b/src/saga_core/saga_gui/wksp_layer_classify.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer_classify.cpp 2431 2015-03-03 17:21:59Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_layer_classify.h b/src/saga_core/saga_gui/wksp_layer_classify.h
index e78b0a5..c07e80d 100755
--- a/src/saga_core/saga_gui/wksp_layer_classify.h
+++ b/src/saga_core/saga_gui/wksp_layer_classify.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer_classify.h 2431 2015-03-03 17:21:59Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_layer_legend.cpp b/src/saga_core/saga_gui/wksp_layer_legend.cpp
index 233e276..92ffdc6 100755
--- a/src/saga_core/saga_gui/wksp_layer_legend.cpp
+++ b/src/saga_core/saga_gui/wksp_layer_legend.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer_legend.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -248,15 +248,15 @@ inline void CWKSP_Layer_Legend::_Set_Font(wxDC &dc, int Style)
 	switch( Style )
 	{
 	case FONT_TITLE:
-		dc.SetFont(wxFont(FONT_SIZE_TITLE   , wxSWISS, wxNORMAL, wxBOLD, false));
+		dc.SetFont(wxFont(FONT_SIZE_TITLE   , wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false));
 		break;
 
 	case FONT_SUBTITLE:
-		dc.SetFont(wxFont(FONT_SIZE_SUBTITLE, wxSWISS, wxNORMAL, wxBOLD));
+		dc.SetFont(wxFont(FONT_SIZE_SUBTITLE, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
 		break;
 
 	case FONT_LABEL:	default:
-		dc.SetFont(wxFont(FONT_SIZE_LABEL   , wxSWISS, wxITALIC, wxNORMAL));
+		dc.SetFont(wxFont(FONT_SIZE_LABEL   , wxFONTFAMILY_SWISS, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL));
 		break;
 	}
 }
diff --git a/src/saga_core/saga_gui/wksp_layer_legend.h b/src/saga_core/saga_gui/wksp_layer_legend.h
index 12e82f3..cc34d29 100755
--- a/src/saga_core/saga_gui/wksp_layer_legend.h
+++ b/src/saga_core/saga_gui/wksp_layer_legend.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer_legend.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map.cpp b/src/saga_core/saga_gui/wksp_map.cpp
index cdecad8..68223f1 100755
--- a/src/saga_core/saga_gui/wksp_map.cpp
+++ b/src/saga_core/saga_gui/wksp_map.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -825,7 +825,16 @@ class CWKSP_Map_BaseMap * CWKSP_Map::Add_BaseMap(CSG_MetaData *pEntry)
 
 		Add_Item(pItem = new CWKSP_Map_BaseMap(pEntry));
 
-		Move_Top(pItem);
+		if( !pEntry )
+		{
+			pItem->Dlg_Parameters();
+		}
+
+		switch( pItem->Get_Parameter("POSITION")->asInt() )
+		{
+		default: Move_Bottom(pItem); break;
+		case  0: Move_Top   (pItem); break;
+		}
 
 		View_Refresh(true);
 
@@ -847,20 +856,24 @@ CWKSP_Base_Item * CWKSP_Map::Add_Copy(CWKSP_Base_Item *pItem)
 
 		if( pItem->Get_Type() == WKSP_ITEM_Map_Graticule )
 		{
-			CWKSP_Map_Graticule	*pItem	= Add_Graticule();
+			CWKSP_Map_Graticule	*pCopy	= Add_Graticule();
 
-			pItem->Get_Parameters()->Assign_Values(pItem->Get_Parameters());
+			pCopy->Get_Parameters()->Assign_Values(pItem->Get_Parameters());
 
-			return( pItem );
+			return( pCopy );
 		}
 
 		if( pItem->Get_Type() == WKSP_ITEM_Map_BaseMap )
 		{
-			CWKSP_Map_BaseMap	*pItem	= Add_BaseMap();
+			CSG_MetaData	Settings;
+
+			pItem->Get_Parameters()->Serialize(Settings, true);
+
+			CWKSP_Map_BaseMap	*pCopy	= Add_BaseMap(&Settings);
 
-			pItem->Get_Parameters()->Assign_Values(pItem->Get_Parameters());
+		//	pItem->Get_Parameters()->Assign_Values(pItem->Get_Parameters());
 
-			return( pItem );
+			return( pCopy );
 		}
 	}
 
diff --git a/src/saga_core/saga_gui/wksp_map.h b/src/saga_core/saga_gui/wksp_map.h
index 6cd3a0c..8a26c69 100755
--- a/src/saga_core/saga_gui/wksp_map.h
+++ b/src/saga_core/saga_gui/wksp_map.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map.h 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map_basemap.cpp b/src/saga_core/saga_gui/wksp_map_basemap.cpp
index 1420984..9968c9f 100755
--- a/src/saga_core/saga_gui/wksp_map_basemap.cpp
+++ b/src/saga_core/saga_gui/wksp_map_basemap.cpp
@@ -67,6 +67,7 @@
 #include "dc_helper.h"
 
 #include "res_commands.h"
+#include "res_dialogs.h"
 
 #include "wksp_map.h"
 #include "wksp_map_basemap.h"
@@ -156,6 +157,16 @@ CWKSP_Map_BaseMap::CWKSP_Map_BaseMap(CSG_MetaData *pEntry)
 	);
 
 	//-----------------------------------------------------
+	m_Parameters.Add_Choice(
+		pNode	, "POSITION"	, _TL("Position"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("top"),
+			_TL("bottom")
+		), 1
+	)->Set_Enabled(false);
+
+	//-----------------------------------------------------
 	if( pEntry )
 	{
 		Load(*pEntry);
@@ -326,6 +337,11 @@ int CWKSP_Map_BaseMap::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Par
 {
 	if( Flags & PARAMETER_CHECK_ENABLE )
 	{
+		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "SHOW_ALWAYS") )
+		{
+			pParameters->Set_Enabled("SHOW_RANGE", pParameter->asBool() == false);
+		}
+
 		if(	!SG_STR_CMP(pParameter->Get_Identifier(), "SERVER") )
 		{
 			pParameters->Set_Enabled("SERVER_USER", pParameter->asInt() >= 8);	// user defined
@@ -351,6 +367,23 @@ void CWKSP_Map_BaseMap::Parameters_Changed(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+bool CWKSP_Map_BaseMap::Dlg_Parameters(void)
+{
+	m_Parameters("POSITION")->Set_Enabled(true);
+
+	bool	bResult	= DLG_Parameters(&m_Parameters);
+	
+	m_Parameters("POSITION")->Set_Enabled(false);
+
+	return( bResult );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 bool CWKSP_Map_BaseMap::Set_BaseMap(const CSG_Grid_System &System)
 {
 	m_BaseMap.Destroy();
diff --git a/src/saga_core/saga_gui/wksp_map_basemap.h b/src/saga_core/saga_gui/wksp_map_basemap.h
index 76f5b2e..009084d 100755
--- a/src/saga_core/saga_gui/wksp_map_basemap.h
+++ b/src/saga_core/saga_gui/wksp_map_basemap.h
@@ -99,6 +99,8 @@ public:
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 	virtual void				Parameters_Changed		(void);
 
+	bool						Dlg_Parameters			(void);
+
 	bool						do_Show					(void)	{	return( m_bShow );	}
 
 	class CWKSP_Map *			Get_Map					(void)	{	return( (class CWKSP_Map *)Get_Manager() );	}
diff --git a/src/saga_core/saga_gui/wksp_map_buttons.cpp b/src/saga_core/saga_gui/wksp_map_buttons.cpp
index 25f3d79..2435655 100755
--- a/src/saga_core/saga_gui/wksp_map_buttons.cpp
+++ b/src/saga_core/saga_gui/wksp_map_buttons.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_buttons.cpp 2020 2014-02-26 11:21:04Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map_buttons.h b/src/saga_core/saga_gui/wksp_map_buttons.h
index 79e6218..d8b5d71 100755
--- a/src/saga_core/saga_gui/wksp_map_buttons.h
+++ b/src/saga_core/saga_gui/wksp_map_buttons.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_buttons.h 2020 2014-02-26 11:21:04Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map_control.cpp b/src/saga_core/saga_gui/wksp_map_control.cpp
index 1bfe123..9a68f79 100755
--- a/src/saga_core/saga_gui/wksp_map_control.cpp
+++ b/src/saga_core/saga_gui/wksp_map_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_control.cpp 2793 2016-02-16 16:51:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
@@ -263,9 +263,20 @@ bool CWKSP_Map_Control::Del_Item(CWKSP_Map *pMap, CWKSP_Base_Item *pItem)
 {
 	if( pMap && pItem )
 	{
-		pItem	= pItem->Get_Type() == WKSP_ITEM_Map_Layer
-				? pMap->Find_Layer(((CWKSP_Map_Layer *)pItem)->Get_Layer())
-				: pMap->Find_Layer( (CWKSP_Layer     *)pItem);
+		switch( pItem->Get_Type() )
+		{
+		case WKSP_ITEM_Map_Graticule:
+		case WKSP_ITEM_Map_BaseMap:
+			break;
+
+		case WKSP_ITEM_Map_Layer:
+			pItem	= pMap->Find_Layer(((CWKSP_Map_Layer *)pItem)->Get_Layer());
+			break;
+
+		default:
+			pItem	= pMap->Find_Layer(((CWKSP_Layer     *)pItem));
+			break;
+		}
 
 		bool	bRefresh	= pMap->Get_Count() > 1;
 
diff --git a/src/saga_core/saga_gui/wksp_map_control.h b/src/saga_core/saga_gui/wksp_map_control.h
index 6ad9764..6c0729a 100755
--- a/src/saga_core/saga_gui/wksp_map_control.h
+++ b/src/saga_core/saga_gui/wksp_map_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_control.h 2066 2014-03-24 08:55:13Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map_dc.cpp b/src/saga_core/saga_gui/wksp_map_dc.cpp
index 59fc4db..a09dc57 100755
--- a/src/saga_core/saga_gui/wksp_map_dc.cpp
+++ b/src/saga_core/saga_gui/wksp_map_dc.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_dc.cpp 2333 2014-11-10 15:30:41Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -115,7 +115,7 @@ CWKSP_Map_DC::CWKSP_Map_DC(const CSG_Rect &rWorld, const wxRect &rDC, double Sca
 	//-----------------------------------------------------
 	dc_BMP.Create(m_rDC.GetWidth(), m_rDC.GetHeight());
 	dc.SelectObject(dc_BMP);
-	dc.SetBackground(wxBrush(wxColour(m_Background[0], m_Background[1], m_Background[2]), wxSOLID));
+	dc.SetBackground(wxBrush(wxColour(m_Background[0], m_Background[1], m_Background[2]), wxBRUSHSTYLE_SOLID));
 	dc.Clear();
 }
 
diff --git a/src/saga_core/saga_gui/wksp_map_dc.h b/src/saga_core/saga_gui/wksp_map_dc.h
index 25203d8..b853398 100755
--- a/src/saga_core/saga_gui/wksp_map_dc.h
+++ b/src/saga_core/saga_gui/wksp_map_dc.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_dc.h 2331 2014-11-07 12:15:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map_graticule.cpp b/src/saga_core/saga_gui/wksp_map_graticule.cpp
index 7aef75e..1952798 100755
--- a/src/saga_core/saga_gui/wksp_map_graticule.cpp
+++ b/src/saga_core/saga_gui/wksp_map_graticule.cpp
@@ -507,20 +507,20 @@ bool CWKSP_Map_Graticule::Draw(CWKSP_Map_DC &dc_Map)
 	switch( m_Parameters("LINE_STYLE")->asInt() )
 	{
 	default:
-	case  0:	Pen.SetStyle(wxSOLID           );	break; // Solid style.
-	case  1:	Pen.SetStyle(wxDOT             );	break; // Dotted style.
-	case  2:	Pen.SetStyle(wxLONG_DASH       );	break; // Long dashed style.
-	case  3:	Pen.SetStyle(wxSHORT_DASH      );	break; // Short dashed style.
-	case  4:	Pen.SetStyle(wxDOT_DASH        );	break; // Dot and dash style.
-	case  5:	Pen.SetStyle(wxBDIAGONAL_HATCH );	break; // Backward diagonal hatch.
-	case  6:	Pen.SetStyle(wxCROSSDIAG_HATCH );	break; // Cross-diagonal hatch.
-	case  7:	Pen.SetStyle(wxFDIAGONAL_HATCH );	break; // Forward diagonal hatch.
-	case  8:	Pen.SetStyle(wxCROSS_HATCH     );	break; // Cross hatch.
-	case  9:	Pen.SetStyle(wxHORIZONTAL_HATCH);	break; // Horizontal hatch.
-	case 10:	Pen.SetStyle(wxVERTICAL_HATCH  );	break; // Vertical hatch.
-//	case 11:	Pen.SetStyle(wxSTIPPLE         );	break; // Use the stipple bitmap. 
-//	case 12:	Pen.SetStyle(wxUSER_DASH       );	break; // Use the user dashes: see wxPen::SetDashes.
-//	case 13:	Pen.SetStyle(wxTRANSPARENT     );	break; // No pen is used.
+	case  0:	Pen.SetStyle(wxPENSTYLE_SOLID           );	break; // Solid style.
+	case  1:	Pen.SetStyle(wxPENSTYLE_DOT             );	break; // Dotted style.
+	case  2:	Pen.SetStyle(wxPENSTYLE_LONG_DASH       );	break; // Long dashed style.
+	case  3:	Pen.SetStyle(wxPENSTYLE_SHORT_DASH      );	break; // Short dashed style.
+	case  4:	Pen.SetStyle(wxPENSTYLE_DOT_DASH        );	break; // Dot and dash style.
+	case  5:	Pen.SetStyle(wxPENSTYLE_BDIAGONAL_HATCH );	break; // Backward diagonal hatch.
+	case  6:	Pen.SetStyle(wxPENSTYLE_CROSSDIAG_HATCH );	break; // Cross-diagonal hatch.
+	case  7:	Pen.SetStyle(wxPENSTYLE_FDIAGONAL_HATCH );	break; // Forward diagonal hatch.
+	case  8:	Pen.SetStyle(wxPENSTYLE_CROSS_HATCH     );	break; // Cross hatch.
+	case  9:	Pen.SetStyle(wxPENSTYLE_HORIZONTAL_HATCH);	break; // Horizontal hatch.
+	case 10:	Pen.SetStyle(wxPENSTYLE_VERTICAL_HATCH  );	break; // Vertical hatch.
+//	case 11:	Pen.SetStyle(wxPENSTYLE_STIPPLE         );	break; // Use the stipple bitmap. 
+//	case 12:	Pen.SetStyle(wxPENSTYLE_USER_DASH       );	break; // Use the user dashes: see wxPen::SetDashes.
+//	case 13:	Pen.SetStyle(wxPENSTYLE_TRANSPARENT     );	break; // No pen is used.
 	}
 
 	dc.dc.SetPen(Pen);
diff --git a/src/saga_core/saga_gui/wksp_map_layer.cpp b/src/saga_core/saga_gui/wksp_map_layer.cpp
index 11fbf6f..0d0b0e7 100755
--- a/src/saga_core/saga_gui/wksp_map_layer.cpp
+++ b/src/saga_core/saga_gui/wksp_map_layer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_layer.cpp 2547 2015-08-10 13:53:29Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map_layer.h b/src/saga_core/saga_gui/wksp_map_layer.h
index 11a7508..ef06309 100755
--- a/src/saga_core/saga_gui/wksp_map_layer.h
+++ b/src/saga_core/saga_gui/wksp_map_layer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_layer.h 2547 2015-08-10 13:53:29Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map_manager.cpp b/src/saga_core/saga_gui/wksp_map_manager.cpp
index 67396ae..05edcc9 100755
--- a/src/saga_core/saga_gui/wksp_map_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_map_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_manager.cpp 2783 2016-02-11 17:14:34Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_map_manager.h b/src/saga_core/saga_gui/wksp_map_manager.h
index 1a0109e..84d980a 100755
--- a/src/saga_core/saga_gui/wksp_map_manager.h
+++ b/src/saga_core/saga_gui/wksp_map_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_manager.h 2006 2014-02-20 13:52:10Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module.cpp b/src/saga_core/saga_gui/wksp_module.cpp
index 566bb16..3980f1b 100755
--- a/src/saga_core/saga_gui/wksp_module.cpp
+++ b/src/saga_core/saga_gui/wksp_module.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module.cpp 2891 2016-04-13 12:33:23Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module.h b/src/saga_core/saga_gui/wksp_module.h
index 9eea957..945dc99 100755
--- a/src/saga_core/saga_gui/wksp_module.h
+++ b/src/saga_core/saga_gui/wksp_module.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module.h 2527 2015-06-30 15:38:35Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module_control.cpp b/src/saga_core/saga_gui/wksp_module_control.cpp
index 56ad743..a2d5f9f 100755
--- a/src/saga_core/saga_gui/wksp_module_control.cpp
+++ b/src/saga_core/saga_gui/wksp_module_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_control.cpp 2275 2014-10-02 15:48:59Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module_control.h b/src/saga_core/saga_gui/wksp_module_control.h
index a0784c0..e0506eb 100755
--- a/src/saga_core/saga_gui/wksp_module_control.h
+++ b/src/saga_core/saga_gui/wksp_module_control.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_control.h 2275 2014-10-02 15:48:59Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module_library.cpp b/src/saga_core/saga_gui/wksp_module_library.cpp
index cea95ce..fd7c620 100755
--- a/src/saga_core/saga_gui/wksp_module_library.cpp
+++ b/src/saga_core/saga_gui/wksp_module_library.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_library.cpp 2772 2016-02-05 15:25:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module_library.h b/src/saga_core/saga_gui/wksp_module_library.h
index b90f568..004602e 100755
--- a/src/saga_core/saga_gui/wksp_module_library.h
+++ b/src/saga_core/saga_gui/wksp_module_library.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_library.h 2254 2014-09-25 16:00:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module_manager.cpp b/src/saga_core/saga_gui/wksp_module_manager.cpp
index 3fa4d24..7d54569 100755
--- a/src/saga_core/saga_gui/wksp_module_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_module_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_manager.cpp 2860 2016-03-24 10:33:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module_manager.h b/src/saga_core/saga_gui/wksp_module_manager.h
index fea9068..ca4c7f5 100755
--- a/src/saga_core/saga_gui/wksp_module_manager.h
+++ b/src/saga_core/saga_gui/wksp_module_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_manager.h 2860 2016-03-24 10:33:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module_menu.cpp b/src/saga_core/saga_gui/wksp_module_menu.cpp
index 3ab1a38..0efd600 100755
--- a/src/saga_core/saga_gui/wksp_module_menu.cpp
+++ b/src/saga_core/saga_gui/wksp_module_menu.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_menu.cpp 2678 2015-11-05 18:29:16Z oconrad $
+ * Version $Id$
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_module_menu.h b/src/saga_core/saga_gui/wksp_module_menu.h
index 4d08aeb..c7f2389 100755
--- a/src/saga_core/saga_gui/wksp_module_menu.h
+++ b/src/saga_core/saga_gui/wksp_module_menu.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_module_menu.h 2349 2014-12-11 13:42:58Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_pointcloud.cpp b/src/saga_core/saga_gui/wksp_pointcloud.cpp
index 51f499b..d03c093 100755
--- a/src/saga_core/saga_gui/wksp_pointcloud.cpp
+++ b/src/saga_core/saga_gui/wksp_pointcloud.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_pointcloud.cpp 2772 2016-02-05 15:25:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_pointcloud.h b/src/saga_core/saga_gui/wksp_pointcloud.h
index 9654b48..e23e66f 100755
--- a/src/saga_core/saga_gui/wksp_pointcloud.h
+++ b/src/saga_core/saga_gui/wksp_pointcloud.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_pointcloud.h 2716 2015-12-04 11:55:42Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_pointcloud_manager.cpp b/src/saga_core/saga_gui/wksp_pointcloud_manager.cpp
index 2647abc..3d3c50b 100755
--- a/src/saga_core/saga_gui/wksp_pointcloud_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_pointcloud_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_pointcloud_manager.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_pointcloud_manager.h b/src/saga_core/saga_gui/wksp_pointcloud_manager.h
index 8de60e9..b7c391d 100755
--- a/src/saga_core/saga_gui/wksp_pointcloud_manager.h
+++ b/src/saga_core/saga_gui/wksp_pointcloud_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_pointcloud_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes.cpp b/src/saga_core/saga_gui/wksp_shapes.cpp
index 66345b5..768ddcc 100755
--- a/src/saga_core/saga_gui/wksp_shapes.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes.cpp 2772 2016-02-05 15:25:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -1183,18 +1183,18 @@ CSG_Parameter * CWKSP_Shapes::BrushList_Add(CSG_Parameter *pNode, const CSG_Stri
 }
 
 //---------------------------------------------------------
-int CWKSP_Shapes::BrushList_Get_Style(int Index)
+wxBrushStyle CWKSP_Shapes::BrushList_Get_Style(int Index)
 {
 	switch( Index )
 	{
-	default:	return( wxSOLID				);
-	case  1:	return( wxTRANSPARENT		);
-	case  2:	return( wxBDIAGONAL_HATCH	);
-	case  3:	return( wxCROSSDIAG_HATCH	);
-	case  4:	return( wxFDIAGONAL_HATCH	);
-	case  5:	return( wxCROSS_HATCH		);
-	case  6:	return( wxHORIZONTAL_HATCH	);
-	case  7:	return( wxVERTICAL_HATCH	);
+	default:	return( wxBRUSHSTYLE_SOLID           );
+	case  1:	return( wxBRUSHSTYLE_TRANSPARENT     );
+	case  2:	return( wxBRUSHSTYLE_BDIAGONAL_HATCH );
+	case  3:	return( wxBRUSHSTYLE_CROSSDIAG_HATCH );
+	case  4:	return( wxBRUSHSTYLE_FDIAGONAL_HATCH );
+	case  5:	return( wxBRUSHSTYLE_CROSS_HATCH     );
+	case  6:	return( wxBRUSHSTYLE_HORIZONTAL_HATCH);
+	case  7:	return( wxBRUSHSTYLE_VERTICAL_HATCH  );
 	}
 }
 
diff --git a/src/saga_core/saga_gui/wksp_shapes.h b/src/saga_core/saga_gui/wksp_shapes.h
index 26c5e07..962ff3a 100755
--- a/src/saga_core/saga_gui/wksp_shapes.h
+++ b/src/saga_core/saga_gui/wksp_shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes.h 2548 2015-08-13 13:07:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -164,7 +164,7 @@ protected:
 	void						AttributeList_Set		(CSG_Parameter *pFields, bool bAddNoField);
 
 	CSG_Parameter *				BrushList_Add			(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
-	int							BrushList_Get_Style		(int Index);
+	wxBrushStyle				BrushList_Get_Style		(int Index);
 
 	CSG_Parameter *				PenList_Add				(CSG_Parameter *pNode, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description);
 	int							PenList_Get_Style		(int Index);
diff --git a/src/saga_core/saga_gui/wksp_shapes_edit.cpp b/src/saga_core/saga_gui/wksp_shapes_edit.cpp
index 5c06791..ef6ecd4 100755
--- a/src/saga_core/saga_gui/wksp_shapes_edit.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_edit.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_edit.cpp 2809 2016-02-22 11:40:22Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_line.cpp b/src/saga_core/saga_gui/wksp_shapes_line.cpp
index 2bc54fe..3687654 100755
--- a/src/saga_core/saga_gui/wksp_shapes_line.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_line.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_line.cpp 2329 2014-11-05 19:32:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -218,7 +218,7 @@ void CWKSP_Shapes_Line::On_Parameters_Changed(void)
 	}
 
 	//-----------------------------------------------------
-	m_Pen			= wxPen(m_Def_Color, (int)m_Size, m_Line_Style);
+	m_Pen			= wxPen(m_Def_Color, (int)m_Size, (wxPenStyle)m_Line_Style);
 
 	m_bVertices		= m_Parameters("DISPLAY_POINTS")->asBool();
 
@@ -310,23 +310,23 @@ void CWKSP_Shapes_Line::Draw_Initialize(CWKSP_Map_DC &dc_Map)
 {
 	switch( m_Parameters("LINE_STYLE")->asInt() )
 	{
-	case  0:	m_Line_Style	= wxSOLID;				break; // Solid style.
-	case  1:	m_Line_Style	= wxDOT;				break; // Dotted style.
-	case  2:	m_Line_Style	= wxLONG_DASH;			break; // Long dashed style.
-	case  3:	m_Line_Style	= wxSHORT_DASH;			break; // Short dashed style.
-	case  4:	m_Line_Style	= wxDOT_DASH;			break; // Dot and dash style.
-	case  5:	m_Line_Style	= wxBDIAGONAL_HATCH;	break; // Backward diagonal hatch.
-	case  6:	m_Line_Style	= wxCROSSDIAG_HATCH;	break; // Cross-diagonal hatch.
-	case  7:	m_Line_Style	= wxFDIAGONAL_HATCH;	break; // Forward diagonal hatch.
-	case  8:	m_Line_Style	= wxCROSS_HATCH;		break; // Cross hatch.
-	case  9:	m_Line_Style	= wxHORIZONTAL_HATCH;	break; // Horizontal hatch.
-	case 10:	m_Line_Style	= wxVERTICAL_HATCH;		break; // Vertical hatch.
-//	case 11:	m_Line_Style	= wxSTIPPLE;			break; // Use the stipple bitmap. 
-//	case 12:	m_Line_Style	= wxUSER_DASH;			break; // Use the user dashes: see wxPen::SetDashes.
-//	case 13:	m_Line_Style	= wxTRANSPARENT;		break; // No pen is used.
+	case  0:	m_Line_Style	= wxPENSTYLE_SOLID;            break; // Solid style.
+	case  1:	m_Line_Style	= wxPENSTYLE_DOT;              break; // Dotted style.
+	case  2:	m_Line_Style	= wxPENSTYLE_LONG_DASH;        break; // Long dashed style.
+	case  3:	m_Line_Style	= wxPENSTYLE_SHORT_DASH;       break; // Short dashed style.
+	case  4:	m_Line_Style	= wxPENSTYLE_DOT_DASH;         break; // Dot and dash style.
+	case  5:	m_Line_Style	= wxPENSTYLE_BDIAGONAL_HATCH;  break; // Backward diagonal hatch.
+	case  6:	m_Line_Style	= wxPENSTYLE_CROSSDIAG_HATCH;  break; // Cross-diagonal hatch.
+	case  7:	m_Line_Style	= wxPENSTYLE_FDIAGONAL_HATCH;  break; // Forward diagonal hatch.
+	case  8:	m_Line_Style	= wxPENSTYLE_CROSS_HATCH;      break; // Cross hatch.
+	case  9:	m_Line_Style	= wxPENSTYLE_HORIZONTAL_HATCH; break; // Horizontal hatch.
+	case 10:	m_Line_Style	= wxPENSTYLE_VERTICAL_HATCH;   break; // Vertical hatch.
+//	case 11:	m_Line_Style	= wxPENSTYLE_STIPPLE;          break; // Use the stipple bitmap. 
+//	case 12:	m_Line_Style	= wxPENSTYLE_USER_DASH;        break; // Use the user dashes: see wxPen::SetDashes.
+//	case 13:	m_Line_Style	= wxPENSTYLE_TRANSPARENT;      break; // No pen is used.
 	}
 
-	m_Pen.SetStyle(m_Line_Style);
+	m_Pen.SetStyle((wxPenStyle)m_Line_Style);
 
 	dc_Map.dc.SetPen(m_Pen);
 }
@@ -344,7 +344,7 @@ void CWKSP_Shapes_Line::Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int
 
 	if( Selection )
 	{
-		Pen	= wxPen(m_Sel_Color, m_Size + (Selection == 1 ? 2 : 0), m_Line_Style);
+		Pen	= wxPen(m_Sel_Color, m_Size + (Selection == 1 ? 2 : 0), (wxPenStyle)m_Line_Style);
 	}
 	else
 	{
diff --git a/src/saga_core/saga_gui/wksp_shapes_line.h b/src/saga_core/saga_gui/wksp_shapes_line.h
index c522637..d337804 100755
--- a/src/saga_core/saga_gui/wksp_shapes_line.h
+++ b/src/saga_core/saga_gui/wksp_shapes_line.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_line.h 2329 2014-11-05 19:32:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_manager.cpp b/src/saga_core/saga_gui/wksp_shapes_manager.cpp
index 2db8fb3..8ecb6c7 100755
--- a/src/saga_core/saga_gui/wksp_shapes_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_manager.cpp 2791 2016-02-16 16:48:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_manager.h b/src/saga_core/saga_gui/wksp_shapes_manager.h
index e6c3960..8d73a8d 100755
--- a/src/saga_core/saga_gui/wksp_shapes_manager.h
+++ b/src/saga_core/saga_gui/wksp_shapes_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_point.cpp b/src/saga_core/saga_gui/wksp_shapes_point.cpp
index a544932..a46e3cc 100755
--- a/src/saga_core/saga_gui/wksp_shapes_point.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_point.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_point.cpp 2719 2015-12-07 16:27:37Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -320,7 +320,7 @@ void CWKSP_Shapes_Point::On_Parameters_Changed(void)
 
 	//-----------------------------------------------------
 	m_bOutline	= m_Parameters("OUTLINE")->asBool();
-	m_Pen		= wxPen(!m_bOutline ? m_Def_Color : Get_Color_asWX(m_Parameters("OUTLINE_COLOR")->asColor()), m_Parameters("OUTLINE_SIZE")->asInt(), wxSOLID);
+	m_Pen		= wxPen(!m_bOutline ? m_Def_Color : Get_Color_asWX(m_Parameters("OUTLINE_COLOR")->asColor()), m_Parameters("OUTLINE_SIZE")->asInt(), wxPENSTYLE_SOLID);
 	m_Brush		= wxBrush(m_Def_Color, BrushList_Get_Style(m_Parameters("DISPLAY_BRUSH")->asInt()));
 }
 
@@ -472,8 +472,8 @@ inline bool CWKSP_Shapes_Point::Draw_Initialize(CWKSP_Map_DC &dc_Map, int &Size,
 
 	if( Selection )
 	{
-		dc_Map.dc.SetBrush(wxBrush(m_Sel_Color_Fill, wxSOLID));
-		dc_Map.dc.SetPen  (wxPen(m_Sel_Color, Selection == 1 ? 2 : 0, wxSOLID));
+		dc_Map.dc.SetBrush(wxBrush(m_Sel_Color_Fill, wxBRUSHSTYLE_SOLID));
+		dc_Map.dc.SetPen  (wxPen(m_Sel_Color, Selection == 1 ? 2 : 0, wxPENSTYLE_SOLID));
 	}
 	else if( Get_Class_Color(pShape, Color) )
 	{
diff --git a/src/saga_core/saga_gui/wksp_shapes_point.h b/src/saga_core/saga_gui/wksp_shapes_point.h
index 308bfb5..74587fb 100755
--- a/src/saga_core/saga_gui/wksp_shapes_point.h
+++ b/src/saga_core/saga_gui/wksp_shapes_point.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_point.h 2007 2014-02-20 13:53:13Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_points.cpp b/src/saga_core/saga_gui/wksp_shapes_points.cpp
index f41eec4..08a7cc9 100755
--- a/src/saga_core/saga_gui/wksp_shapes_points.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_points.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_points.cpp 2329 2014-11-05 19:32:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_points.h b/src/saga_core/saga_gui/wksp_shapes_points.h
index 6010062..1333340 100755
--- a/src/saga_core/saga_gui/wksp_shapes_points.h
+++ b/src/saga_core/saga_gui/wksp_shapes_points.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_points.h 2007 2014-02-20 13:53:13Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_polygon.cpp b/src/saga_core/saga_gui/wksp_shapes_polygon.cpp
index 275ced6..988519c 100755
--- a/src/saga_core/saga_gui/wksp_shapes_polygon.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_polygon.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_polygon.cpp 2719 2015-12-07 16:27:37Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -167,7 +167,7 @@ void CWKSP_Shapes_Polygon::On_Parameters_Changed(void)
 
 	//-----------------------------------------------------
 	m_bOutline	= m_Parameters("OUTLINE")->asBool();
-	m_Pen		= wxPen(!m_bOutline ? m_Def_Color : Get_Color_asWX(m_Parameters("OUTLINE_COLOR")->asColor()), m_Parameters("OUTLINE_SIZE")->asInt(), wxSOLID);
+	m_Pen		= wxPen(!m_bOutline ? m_Def_Color : Get_Color_asWX(m_Parameters("OUTLINE_COLOR")->asColor()), m_Parameters("OUTLINE_SIZE")->asInt(), wxPENSTYLE_SOLID);
 	m_Brush		= wxBrush(m_Def_Color, BrushList_Get_Style(m_Parameters("DISPLAY_BRUSH")->asInt()));
 
 	m_bVertices	= m_Parameters("DISPLAY_POINTS"  )->asBool();
@@ -210,8 +210,8 @@ void CWKSP_Shapes_Polygon::Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, i
 	//-----------------------------------------------------
 	if( Selection )
 	{
-		dc_Map.dc.SetBrush(wxBrush(Selection == 1 ? m_Sel_Color_Fill[0] : m_Sel_Color_Fill[1], wxSOLID));
-		dc_Map.dc.SetPen  (wxPen(m_Sel_Color, 0, wxSOLID));
+		dc_Map.dc.SetBrush(wxBrush(Selection == 1 ? m_Sel_Color_Fill[0] : m_Sel_Color_Fill[1], wxBRUSHSTYLE_SOLID));
+		dc_Map.dc.SetPen  (wxPen(m_Sel_Color, 0, wxPENSTYLE_SOLID));
 
 		dc_Map.Draw_Polygon((CSG_Shape_Polygon *)pShape);
 
diff --git a/src/saga_core/saga_gui/wksp_shapes_polygon.h b/src/saga_core/saga_gui/wksp_shapes_polygon.h
index 097e978..e77505f 100755
--- a/src/saga_core/saga_gui/wksp_shapes_polygon.h
+++ b/src/saga_core/saga_gui/wksp_shapes_polygon.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_polygon.h 2329 2014-11-05 19:32:43Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_type.cpp b/src/saga_core/saga_gui/wksp_shapes_type.cpp
index 5f2fbbf..59a5bb7 100755
--- a/src/saga_core/saga_gui/wksp_shapes_type.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes_type.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_type.cpp 2791 2016-02-16 16:48:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_shapes_type.h b/src/saga_core/saga_gui/wksp_shapes_type.h
index 2795937..2ae4633 100755
--- a/src/saga_core/saga_gui/wksp_shapes_type.h
+++ b/src/saga_core/saga_gui/wksp_shapes_type.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes_type.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_table.cpp b/src/saga_core/saga_gui/wksp_table.cpp
index 4db2014..1aa932f 100755
--- a/src/saga_core/saga_gui/wksp_table.cpp
+++ b/src/saga_core/saga_gui/wksp_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_table.cpp 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_table.h b/src/saga_core/saga_gui/wksp_table.h
index 2bd3940..d7206a7 100755
--- a/src/saga_core/saga_gui/wksp_table.h
+++ b/src/saga_core/saga_gui/wksp_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_table.h 2858 2016-03-23 16:05:24Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_table_manager.cpp b/src/saga_core/saga_gui/wksp_table_manager.cpp
index 7cf6494..cd8a8b6 100755
--- a/src/saga_core/saga_gui/wksp_table_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_table_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_table_manager.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_table_manager.h b/src/saga_core/saga_gui/wksp_table_manager.h
index b73c493..ebf06be 100755
--- a/src/saga_core/saga_gui/wksp_table_manager.h
+++ b/src/saga_core/saga_gui/wksp_table_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_table_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_tin.cpp b/src/saga_core/saga_gui/wksp_tin.cpp
index aa6b04f..8dc6051 100755
--- a/src/saga_core/saga_gui/wksp_tin.cpp
+++ b/src/saga_core/saga_gui/wksp_tin.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_tin.cpp 2548 2015-08-13 13:07:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_tin.h b/src/saga_core/saga_gui/wksp_tin.h
index a55b3ba..813124a 100755
--- a/src/saga_core/saga_gui/wksp_tin.h
+++ b/src/saga_core/saga_gui/wksp_tin.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_tin.h 2548 2015-08-13 13:07:55Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_tin_manager.cpp b/src/saga_core/saga_gui/wksp_tin_manager.cpp
index 885f574..678a4d9 100755
--- a/src/saga_core/saga_gui/wksp_tin_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_tin_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_tin_manager.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_gui/wksp_tin_manager.h b/src/saga_core/saga_gui/wksp_tin_manager.h
index ff032b5..5f45ead 100755
--- a/src/saga_core/saga_gui/wksp_tin_manager.h
+++ b/src/saga_core/saga_gui/wksp_tin_manager.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_tin_manager.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id$
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/scripting/helper/make_arcsaga_toolboxes.bat b/src/scripting/helper/make_arcsaga_toolboxes.bat
index d1eff60..3d18c5d 100755
--- a/src/scripting/helper/make_arcsaga_toolboxes.bat
+++ b/src/scripting/helper/make_arcsaga_toolboxes.bat
@@ -1,7 +1,7 @@
 @ECHO OFF
 
 REM ___________________________________
-SET SAGA_ROOT=D:\saga\saga-code\trunk\saga-gis
+SET SAGA_ROOT=%SAGA%
 
 REM ___________________________________
 SET OUTDIR=ArcSAGA Toolboxes
diff --git a/src/scripting/helper/make_saga_release.bat b/src/scripting/helper/make_saga_release.bat
index c3fdaad..6e807ab 100755
--- a/src/scripting/helper/make_saga_release.bat
+++ b/src/scripting/helper/make_saga_release.bat
@@ -2,17 +2,17 @@
 
 REM ___________________________________
 SET SAGA_VER_MAJOR=2
-SET SAGA_VER_MINOR=2
-SET SAGA_VER_RELEASE=7
+SET SAGA_VER_MINOR=3
+SET SAGA_VER_RELEASE=0
 
 SET SAGA_VERSION=saga_%SAGA_VER_MAJOR%.%SAGA_VER_MINOR%.%SAGA_VER_RELEASE%
-SET SVN__VERSION=%SAGA_VER_MAJOR%-%SAGA_VER_MINOR%-%SAGA_VER_RELEASE%
+SET TEXT_VERSION=%SAGA_VER_MAJOR%-%SAGA_VER_MINOR%-%SAGA_VER_RELEASE%
 
-SET SAGA_ROOT=D:\saga\saga-code\trunk
+SET SAGA_ROOT=%SAGA%
 
 SET ZIPEXE="C:\Program Files\7-Zip\7z.exe" a -r -y -mx5
 SET ISETUP="C:\Program Files (x86)\Inno Setup 5\ISCC.exe"
-SET SVNEXE=svn
+SET GITEXE=git
 SET DOXEXE=doxygen.exe
 SET SWIGEXE="D:\libs\swigwin-3.0.7\swig.exe"
 SET PYTHONDIR=D:\libs\Python-2.7
@@ -27,7 +27,7 @@ REM ###################################
 ECHO __________________________________
 ECHO ##################################
 ECHO #
-ECHO # MAKE SAGA RELEASE: %SVN__VERSION%
+ECHO # MAKE SAGA RELEASE: %TEXT_VERSION%
 ECHO #
 ECHO ##################################
 ECHO.
@@ -42,7 +42,7 @@ IF NOT '%CONTINUE%' == 'y' EXIT
 
 REM ___________________________________
 REM Create a branch
-REM %SVNEXE% copy svn://svn.code.sf.net/p/saga-gis/code-0/trunk svn://svn.code.sf.net/p/saga-gis/code-0/branches/release-%SVN__VERSION% -m "branch release-%SVN__VERSION% created from trunk"
+REM %SVNEXE% copy svn://svn.code.sf.net/p/saga-gis/code-0/trunk svn://svn.code.sf.net/p/saga-gis/code-0/branches/release-%TEXT_VERSION% -m "branch release-%TEXT_VERSION% created from trunk"
 
 
 REM ___________________________________
@@ -59,14 +59,14 @@ REM win32 Binaries
 SET SAGA_CONFIG=win32
 MKDIR "%SAGA_VERSION%_%SAGA_CONFIG%"
 PUSHD "%SAGA_VERSION%_%SAGA_CONFIG%"
-XCOPY /C/S/Q/Y "%SAGA_ROOT%\saga-gis\bin\saga_vc_%SAGA_CONFIG%"
+XCOPY /C/S/Q/Y "%SAGA_ROOT%\bin\saga_vc_%SAGA_CONFIG%"
 DEL /F saga_gui.cfg saga_gui.ini *.exp modules\*.exp modules\*.lib modules\dev_tools.*
 RMDIR /S/Q _private
 POPD
 %ZIPEXE% "%SAGA_VERSION%_%SAGA_CONFIG%.zip" "%SAGA_VERSION%_%SAGA_CONFIG%"
 
-COPY "%SAGA_ROOT%\saga_setup_readme.rtf" "%SAGA_VERSION%_%SAGA_CONFIG%"
-COPY "%SAGA_ROOT%\saga_setup_%SAGA_CONFIG%.iss" "%SAGA_VERSION%_%SAGA_CONFIG%"
+COPY "%SAGA_ROOT%\..\saga_setup_readme.rtf" "%SAGA_VERSION%_%SAGA_CONFIG%"
+COPY "%SAGA_ROOT%\..\saga_setup_%SAGA_CONFIG%.iss" "%SAGA_VERSION%_%SAGA_CONFIG%"
 %ISETUP% "%SAGA_VERSION%_%SAGA_CONFIG%\saga_setup_%SAGA_CONFIG%.iss"
 MOVE "%SAGA_VERSION%_%SAGA_CONFIG%\%SAGA_VERSION%_%SAGA_CONFIG%_setup.exe"
 
@@ -77,24 +77,24 @@ REM x64 Binaries
 SET SAGA_CONFIG=x64
 MKDIR "%SAGA_VERSION%_%SAGA_CONFIG%"
 PUSHD "%SAGA_VERSION%_%SAGA_CONFIG%"
-XCOPY /C/S/Q/Y "%SAGA_ROOT%\saga-gis\bin\saga_vc_%SAGA_CONFIG%"
+XCOPY /C/S/Q/Y "%SAGA_ROOT%\bin\saga_vc_%SAGA_CONFIG%"
 DEL /F saga_gui.cfg saga_gui.ini *.exp modules\*.exp modules\*.lib modules\dev_tools.*
 RMDIR /S/Q _private
 POPD
 %ZIPEXE% "%SAGA_VERSION%_%SAGA_CONFIG%.zip" "%SAGA_VERSION%_%SAGA_CONFIG%"
 
-COPY "%SAGA_ROOT%\saga_setup_readme.rtf" "%SAGA_VERSION%_%SAGA_CONFIG%"
-COPY "%SAGA_ROOT%\saga_setup_%SAGA_CONFIG%.iss" "%SAGA_VERSION%_%SAGA_CONFIG%"
+COPY "%SAGA_ROOT%\..\saga_setup_readme.rtf" "%SAGA_VERSION%_%SAGA_CONFIG%"
+COPY "%SAGA_ROOT%\..\saga_setup_%SAGA_CONFIG%.iss" "%SAGA_VERSION%_%SAGA_CONFIG%"
 %ISETUP% "%SAGA_VERSION%_%SAGA_CONFIG%\saga_setup_%SAGA_CONFIG%.iss"
 MOVE "%SAGA_VERSION%_%SAGA_CONFIG%\%SAGA_VERSION%_%SAGA_CONFIG%_setup.exe"
 
 RMDIR /S/Q "%SAGA_VERSION%_%SAGA_CONFIG%"
 
 REM ___________________________________
-REM SVN Source Code Repository
-%SVNEXE% checkout svn://svn.code.sf.net/p/saga-gis/code-0/trunk %SAGA_VERSION%_src -q --non-interactive
+REM GIT Source Code Repository
+%GITEXE% clone git://git.code.sf.net/p/saga-gis/code %SAGA_VERSION%_src -q
 PUSHD %SAGA_VERSION%_src
-RMDIR /S/Q .svn
+RMDIR /S/Q .git
 POPD
 %ZIPEXE% %SAGA_VERSION%_src.zip %SAGA_VERSION%_src
 
@@ -109,8 +109,8 @@ RMDIR /S/Q "%SAGA_VERSION%_api_doc"
 REM ___________________________________
 REM SWIG/Python (win32)
 SET WXWINLIB="%WXWIN%\lib\vc_dll"
-SET SAGA="%SAGA_ROOT%\saga-gis\bin\saga_vc_Win32"
-PUSHD "%SAGA_ROOT%\saga-gis\src\saga_core\saga_api"
+SET SAGA_LIB="%SAGA_ROOT%\bin\saga_vc_Win32"
+PUSHD "%SAGA_ROOT%\src\saga_core\saga_api"
 %SWIGEXE% -c++ -python -includeall -I. -D_SAGA_PYTHON -D_SAGA_UNICODE saga_api.h
 "%PYTHONDIR%\python.exe" saga_api_to_python_win.py install
 MOVE saga_api.py "%PYTHONDIR%\Lib\site-packages\saga_api.py"
@@ -119,8 +119,8 @@ RMDIR /S/Q build
 POPD
 SET PYTHONOUT=Python%PYTHONVER%
 XCOPY /C/Q/Y "%PYTHONDIR%\Lib\site-packages\*saga*.*" "%PYTHONOUT%\Lib\site-packages\"
-COPY "%SAGA_ROOT%\saga-gis\src\scripting\python\saga_python_api.txt" "%PYTHONOUT%\Lib\site-packages\"
-XCOPY /C/Q/Y "%SAGA_ROOT%\saga-gis\src\scripting\python\examples" "%PYTHONOUT%\Lib\site-packages\saga_api_examples\"
+COPY "%SAGA_ROOT%\src\scripting\python\saga_python_api.txt" "%PYTHONOUT%\Lib\site-packages\"
+XCOPY /C/Q/Y "%SAGA_ROOT%\src\scripting\python\examples" "%PYTHONOUT%\Lib\site-packages\saga_api_examples\"
 %ZIPEXE% %SAGA_VERSION%_win32_python%PYTHONVER%.zip "%PYTHONOUT%"
 RMDIR /S/Q "%PYTHONOUT%"
 
@@ -166,6 +166,6 @@ ECHO.
 ECHO - Add new bug tracker milestone for next version
 ECHO.    https://sourceforge.net/p/saga-gis/bugs/milestones
 ECHO.
-ECHO - Commit a comment like: SAGA version updated to %SVN__VERSION%
+ECHO - Commit a comment like: SAGA version updated to %TEXT_VERSION%
 
 PAUSE
diff --git a/src/scripting/helper/make_saga_snapshot.bat b/src/scripting/helper/make_saga_snapshot.bat
index e96ef0c..21b1b8a 100755
--- a/src/scripting/helper/make_saga_snapshot.bat
+++ b/src/scripting/helper/make_saga_snapshot.bat
@@ -8,7 +8,7 @@ ECHO Enter date of snapshot:
 SET /P DATUM=
 
 SET SAGA_VERSION=saga_%VERSION%_%DATUM%
-SET SAGA_ROOT=D:\saga\saga-code\trunk
+SET SAGA_ROOT=%SAGA%
 
 SET ZIPEXE="C:\Program Files\7-Zip\7z.exe" a -r -y -mx5
 
@@ -17,7 +17,7 @@ REM win32 Binaries
 SET SAGA_CONFIG=win32
 MKDIR "%SAGA_VERSION%_%SAGA_CONFIG%"
 PUSHD "%SAGA_VERSION%_%SAGA_CONFIG%"
-XCOPY /C/S/Q/Y "%SAGA_ROOT%\saga-gis\bin\saga_vc_%SAGA_CONFIG%"
+XCOPY /C/S/Q/Y "%SAGA_ROOT%\bin\saga_vc_%SAGA_CONFIG%"
 DEL /F saga_gui.cfg saga_gui.ini *.exp modules\*.exp modules\*.lib modules\dev_tools.*
 RMDIR /S/Q _private
 POPD
@@ -30,7 +30,7 @@ REM x64 Binaries
 SET SAGA_CONFIG=x64
 MKDIR "%SAGA_VERSION%_%SAGA_CONFIG%"
 PUSHD "%SAGA_VERSION%_%SAGA_CONFIG%"
-XCOPY /C/S/Q/Y "%SAGA_ROOT%\saga-gis\bin\saga_vc_%SAGA_CONFIG%"
+XCOPY /C/S/Q/Y "%SAGA_ROOT%\bin\saga_vc_%SAGA_CONFIG%"
 DEL /F saga_gui.cfg saga_gui.ini *.exp modules\*.exp modules\*.lib modules\dev_tools.*
 RMDIR /S/Q _private
 POPD
diff --git a/src/scripting/helper/make_tools_interface.bat b/src/scripting/helper/make_tools_interface.bat
index 699ccf7..0a62a92 100755
--- a/src/scripting/helper/make_tools_interface.bat
+++ b/src/scripting/helper/make_tools_interface.bat
@@ -1,9 +1,9 @@
 @ECHO OFF
 
 REM ___________________________________
-SET SAGA_ROOT=D:\saga\saga-code\trunk
-SET SAGA_CMD="%SAGA_ROOT%\saga-gis\bin\saga_vc_Win32\saga_cmd.exe"
-SET SAGA_TOOLS_PY=%SAGA_ROOT%\saga-gis\src\scripting\python\helpers\saga_cmd_param_interface\tools.py
+SET SAGA_ROOT=%SAGA%
+SET SAGA_CMD="%SAGA_ROOT%\bin\saga_vc_Win32\saga_cmd.exe"
+SET SAGA_TOOLS_PY=%SAGA_ROOT%\src\scripting\python\helpers\saga_cmd_param_interface\tools.py
 
 REM ___________________________________
 %SAGA_CMD% dev_tools 6 -INPUT="%SAGA_TOOLS_PY%" -OUTPUT="%SAGA_TOOLS_PY%"
diff --git a/src/scripting/helper/make_translation_files.bat b/src/scripting/helper/make_translation_files.bat
index 0028f77..a559540 100755
--- a/src/scripting/helper/make_translation_files.bat
+++ b/src/scripting/helper/make_translation_files.bat
@@ -1,26 +1,26 @@
 @ECHO OFF
 
 REM ___________________________________
-SET SVNEXE=svn
+SET GITEXE=git
 
-SET SAGA_ROOT=D:\saga\saga-code\trunk\saga-gis
-SET SAGA_CMD="%SAGA_ROOT%\bin\saga_vc_win32\saga_cmd.exe" -f=s
+SET SAGA_ROOT=%SAGA%
+SET SAGA_CMD="%SAGA_ROOT%\bin\saga_vc_win32\saga_cmd.exe"
 SET SAGA_SRC=saga_src
 
 SET RESPATH=%SAGA_ROOT%\src\saga_core\saga_gui\res
 
 REM ___________________________________
-REM SVN Source Code Repository
-%SVNEXE% checkout svn://svn.code.sf.net/p/saga-gis/code-0/trunk %SAGA_SRC% -q --non-interactive
+REM GIT Source Code Repository
+%GITEXE% clone git://git.code.sf.net/p/saga-gis/code %SAGA_SRC%
 PUSHD %SAGA_SRC%
-RMDIR /S/Q .svn
+RMDIR /S/Q .git
 POPD
 
 REM ___________________________________
-%SAGA_CMD% dev_tools 0 -TARGET="%RESPATH%\saga.lng.txt" -DIRECTORY="%SAGA_SRC%"
+%SAGA_CMD% -f=q dev_tools 0 -TARGET="%RESPATH%\saga.lng.txt" -DIRECTORY="%SAGA_SRC%"
 
-%SAGA_CMD% dev_tools 1 -MASTER="%RESPATH%\saga.lng.txt" -IMPORT="%RESPATH%\saga.ger.txt" -UNION="%RESPATH%\saga.ger.txt" -METHOD=1
-%SAGA_CMD% dev_tools 1 -MASTER="%RESPATH%\saga.lng.txt" -IMPORT="%RESPATH%\saga.bra.txt" -UNION="%RESPATH%\saga.bra.txt" -METHOD=1
+%SAGA_CMD% -f=s dev_tools 1 -MASTER="%RESPATH%\saga.lng.txt" -IMPORT="%RESPATH%\saga.ger.txt" -UNION="%RESPATH%\saga.ger.txt" -METHOD=1
+%SAGA_CMD% -f=s dev_tools 1 -MASTER="%RESPATH%\saga.lng.txt" -IMPORT="%RESPATH%\saga.bra.txt" -UNION="%RESPATH%\saga.bra.txt" -METHOD=1
 
 DEL "%RESPATH%\*.mtab"
 
diff --git a/src/scripting/python/helpers/saga_cmd_param_interface/tools.py b/src/scripting/python/helpers/saga_cmd_param_interface/tools.py
index 38956f9..4f6393e 100755
--- a/src/scripting/python/helpers/saga_cmd_param_interface/tools.py
+++ b/src/scripting/python/helpers/saga_cmd_param_interface/tools.py
@@ -428,7 +428,7 @@ tools = [
 ['shapes_tools', 10, 'Transform Shapes'],
 ['shapes_tools', 11, 'Create Chart Layer (bars/sectors)'],
 ['shapes_tools', 12, 'Create Graticule'],
-['shapes_tools', 13, 'Cut Shapes Layer'],
+['shapes_tools', 13, 'Copy Selected Shapes'],
 ['shapes_tools', 15, 'Split Shapes Layer'],
 ['shapes_tools', 16, 'Split Shapes Layer Randomly'],
 ['shapes_tools', 17, 'Split Table/Shapes by Attribute'],
@@ -650,5 +650,17 @@ tools = [
 ['io_gdal', 9, 'Import TMS Image'],
 ['sim_hydrology', 5, 'Surface and Gradient'],
 ['sim_hydrology', 6, 'Concentration'],
-['sim_hydrology', 7, 'Surface, Gradient and Concentration']
+['sim_hydrology', 7, 'Surface, Gradient and Concentration'],
+['climate_tools', 10, 'Bioclimatic Variables'],
+['grid_tools', 36, 'Change a Grid\'s No-Data Value'],
+['imagery_opencv', 5, 'Normal Bayes Classification (OpenCV)'],
+['imagery_opencv', 6, 'K-Nearest Neighbours Classification (OpenCV)'],
+['imagery_opencv', 7, 'Support Vector Machine Classification (OpenCV)'],
+['imagery_opencv', 8, 'Decision Tree Classification (OpenCV)'],
+['imagery_opencv', 9, 'Boosting Classification (OpenCV)'],
+['imagery_opencv', 10, 'Random Forest Classification (OpenCV)'],
+['imagery_opencv', 11, 'Artificial Neural Network Classification (OpenCV)'],
+['io_shapes', 21, 'Import Building Sketches from CityGML'],
+['statistics_grid', 14, 'Categorical Coincidence'],
+['ta_hydrology', 27, 'Maximum Flow Path Length']
 ]
diff --git a/src/scripting/toolchains/terrain_segmentation.xml b/src/scripting/toolchains/terrain_segmentation.xml
index 8b93260..2c84d97 100755
--- a/src/scripting/toolchains/terrain_segmentation.xml
+++ b/src/scripting/toolchains/terrain_segmentation.xml
@@ -50,8 +50,8 @@
       <input id="DEM">ELEVATION</input>
       <output id="TPI">TPI</output>
       <option id="STANDARD">no</option>
-      <option id="RADIUS">[0.000000] - [1000.000000]</option>
       <option id="DW_WEIGHTING">0</option>
+      <option id="RADIUS" varname="true">TPI_RADIUS</option>
     </tool>
     <tool library="ta_hydrology" module="15" name="SAGA Wetness Index">
       <input id="DEM">ELEVATION</input>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/saga.git



More information about the Pkg-grass-devel mailing list