[csw-devel] SF.net SVN: gar:[18446] csw/mgar/pkg/gdal/trunk
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Sun Jun 17 18:33:17 CEST 2012
Revision: 18446
http://gar.svn.sourceforge.net/gar/?rev=18446&view=rev
Author: bdwalton
Date: 2012-06-17 16:33:17 +0000 (Sun, 17 Jun 2012)
Log Message:
-----------
gdal/trunk: switch back to studio for testing, add patches required to make it build understduio; update mysql deps
Modified Paths:
--------------
csw/mgar/pkg/gdal/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/gdal/trunk/files/0003-Cast-inbuf-parameter-to-iconv-call-to-work-with-Sun-.patch
csw/mgar/pkg/gdal/trunk/files/0004-Ensure-that-__FUNCTION__-is-mapped-to-__func__-when-.patch
csw/mgar/pkg/gdal/trunk/files/0005-Pass-proper-types-to-std-make_pair-to-satisfy-Sun-St.patch
Modified: csw/mgar/pkg/gdal/trunk/Makefile
===================================================================
--- csw/mgar/pkg/gdal/trunk/Makefile 2012-06-17 13:21:58 UTC (rev 18445)
+++ csw/mgar/pkg/gdal/trunk/Makefile 2012-06-17 16:33:17 UTC (rev 18446)
@@ -15,6 +15,9 @@
DISTFILES = $(DISTNAME).tar.gz
PATCHFILES += 0001-Force-use-of-double-data-type-before-checking-for-is.patch
PATCHFILES += 0002-apply-patch-from-upstream-to-handle-building-with-a-.patch
+PATCHFILES += 0003-Cast-inbuf-parameter-to-iconv-call-to-work-with-Sun-.patch
+PATCHFILES += 0004-Ensure-that-__FUNCTION__-is-mapped-to-__func__-when-.patch
+PATCHFILES += 0005-Pass-proper-types-to-std-make_pair-to-satisfy-Sun-St.patch
#PATCHFILES += 0001-Force-the-use-of-CSWbash.patch
PACKAGES += CSWgdal
@@ -38,7 +41,7 @@
RUNTIME_DEP_PKGS_CSWgdal += CSWlibnetcdf7
RUNTIME_DEP_PKGS_CSWgdal += CSWlibgcc-s1
RUNTIME_DEP_PKGS_CSWgdal += CSWlibpq5
-RUNTIME_DEP_PKGS_CSWgdal += CSWlibmysqlclient15
+RUNTIME_DEP_PKGS_CSWgdal += CSWlibmysqlclient18
PACKAGES += CSWlibgdal1
CATALOGNAME_CSWlibgdal1 = libgdal1
@@ -56,7 +59,7 @@
RUNTIME_DEP_PKGS_CSWlibgdal1 += CSWlibtiff3
RUNTIME_DEP_PKGS_CSWlibgdal1 += CSWlibz1
RUNTIME_DEP_PKGS_CSWlibgdal1 += CSWlibnetcdf7
-RUNTIME_DEP_PKGS_CSWlibgdal1 += CSWlibmysqlclient15
+RUNTIME_DEP_PKGS_CSWlibgdal1 += CSWlibmysqlclient18
RUNTIME_DEP_PKGS_CSWlibgdal1 += CSWlibpq5
RUNTIME_DEP_PKGS_CSWlibgdal1 += CSWlibgcc-s1
RUNTIME_DEP_PKGS_CSWlibgdal1 += CSWlibgif4
@@ -69,11 +72,9 @@
RUNTIME_DEP_PKGS_CSWgdal-dev += CSWlibgdal1
PKGFILES_CSWgdal-dev += $(PKGFILES_DEVEL) /opt/csw/bin/gdal-config
-GARCOMPILER = GNU
+# enable use of __func__ as required by patch 0004
+EXTRA_CXXFLAGS += -features=extensions
-# c++ libraries, so move things around a bit
-libdir = $(abspath /opt/csw/gxx/lib/$(MM_LIBDIR))
-
CONFIGURE_ARGS = $(DIRPATHS)
CONFIGURE_ARGS += --with-libz=$(prefix)
CONFIGURE_ARGS += --with-png=$(prefix)
Added: csw/mgar/pkg/gdal/trunk/files/0003-Cast-inbuf-parameter-to-iconv-call-to-work-with-Sun-.patch
===================================================================
--- csw/mgar/pkg/gdal/trunk/files/0003-Cast-inbuf-parameter-to-iconv-call-to-work-with-Sun-.patch (rev 0)
+++ csw/mgar/pkg/gdal/trunk/files/0003-Cast-inbuf-parameter-to-iconv-call-to-work-with-Sun-.patch 2012-06-17 16:33:17 UTC (rev 18446)
@@ -0,0 +1,40 @@
+From 17b4f095d0f109e7b8c4865395945f643e6b9dd0 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Sun, 17 Jun 2012 04:15:19 +0200
+Subject: [PATCH] Cast inbuf parameter to iconv call to work with Sun Studio
+
+Studio 12 was dieing due to passing the inbuf parameter to iconv as
+char** instead of const char**. Gcc had no issues with this.
+
+Apply the appropriate cast so that the compiler is happy.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ port/cpl_recode_iconv.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/port/cpl_recode_iconv.cpp b/port/cpl_recode_iconv.cpp
+index ec7118c..40b466d 100644
+--- a/port/cpl_recode_iconv.cpp
++++ b/port/cpl_recode_iconv.cpp
+@@ -89,7 +89,7 @@ char *CPLRecodeIconv( const char *pszSource,
+ while ( nSrcLen > 0 )
+ {
+ size_t nConverted =
+- iconv( sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen );
++ iconv( sConv, (const char **)&pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen );
+
+ if ( nConverted == (size_t)-1 )
+ {
+@@ -240,7 +240,7 @@ char *CPLRecodeFromWCharIconv( const wchar_t *pwszSource,
+ while ( nSrcLen > 0 )
+ {
+ size_t nConverted =
+- iconv( sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen );
++ iconv( sConv, (const char**)&pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen );
+
+ if ( nConverted == (size_t)-1 )
+ {
+--
+1.7.10.3
+
Added: csw/mgar/pkg/gdal/trunk/files/0004-Ensure-that-__FUNCTION__-is-mapped-to-__func__-when-.patch
===================================================================
--- csw/mgar/pkg/gdal/trunk/files/0004-Ensure-that-__FUNCTION__-is-mapped-to-__func__-when-.patch (rev 0)
+++ csw/mgar/pkg/gdal/trunk/files/0004-Ensure-that-__FUNCTION__-is-mapped-to-__func__-when-.patch 2012-06-17 16:33:17 UTC (rev 18446)
@@ -0,0 +1,37 @@
+From 683f4ab02dcf02453c67411de33cc4dcba1f2eb7 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Sun, 17 Jun 2012 04:52:24 +0200
+Subject: [PATCH] Ensure that __FUNCTION__ is mapped to __func__ when using
+ Studio CC
+
+Sun Studio doesn't define __FUNCTION__ like g++ does. Instead, it
+defines __func__, but only when -features=extensions is passed in
+CXXFLAGS. Define __FUNCTION__ as __func__ if __STUDIO_CC is defined
+so that the NCDF_ERR macro can function without a complier specific
+version.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ frmts/netcdf/netcdfdataset.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/frmts/netcdf/netcdfdataset.h b/frmts/netcdf/netcdfdataset.h
+index 7c06085..0689786 100644
+--- a/frmts/netcdf/netcdfdataset.h
++++ b/frmts/netcdf/netcdfdataset.h
+@@ -84,6 +84,12 @@
+ #define NCDF_DEFLATE_LEVEL 1 /* best time/size ratio */
+ #define NCDF_COMPRESS_SZIP 3 /* no support for writting */
+
++/* gcc defines __FUNCTION__ but sun studio CC defines __func__ (only
++ when -features=extensions is used; add to CXXFLAGS) */
++#if defined(__SUNPRO_CC)
++#define __FUNCTION__ __func__
++#endif
++
+ /* helper for libnetcdf errors */
+ #define NCDF_ERR(status) if ( status != NC_NOERR ){ \
+ CPLError( CE_Failure,CPLE_AppDefined, \
+--
+1.7.10.3
+
Added: csw/mgar/pkg/gdal/trunk/files/0005-Pass-proper-types-to-std-make_pair-to-satisfy-Sun-St.patch
===================================================================
--- csw/mgar/pkg/gdal/trunk/files/0005-Pass-proper-types-to-std-make_pair-to-satisfy-Sun-St.patch (rev 0)
+++ csw/mgar/pkg/gdal/trunk/files/0005-Pass-proper-types-to-std-make_pair-to-satisfy-Sun-St.patch 2012-06-17 16:33:17 UTC (rev 18446)
@@ -0,0 +1,50 @@
+From 3f4d3eafbf74ca803d696f4b1f6a81902222377a Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Sun, 17 Jun 2012 17:13:29 +0200
+Subject: [PATCH] Pass proper types to std::make_pair to satisfy Sun Studio CC
+
+Studio CC doesn't automatically convert a const char[] to std::string in
+calls to std::make_pair. Wrap these values as std::string.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ frmts/netcdf/netcdfdataset.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/frmts/netcdf/netcdfdataset.cpp b/frmts/netcdf/netcdfdataset.cpp
+index ebdce25..b0be750 100644
+--- a/frmts/netcdf/netcdfdataset.cpp
++++ b/frmts/netcdf/netcdfdataset.cpp
+@@ -5096,7 +5096,7 @@ void NCDFWriteProjAttribs( const OGR_SRSNode *poPROJCS,
+ double dfLatPole = 0.0;
+ if ( dfValue > 0.0) dfLatPole = 90.0;
+ else dfLatPole = -90.0;
+- oOutList.push_back( std::make_pair( CF_PP_LAT_PROJ_ORIGIN,
++ oOutList.push_back( std::make_pair( std::string(CF_PP_LAT_PROJ_ORIGIN),
+ dfLatPole ) );
+ }
+
+@@ -5120,7 +5120,7 @@ void NCDFWriteProjAttribs( const OGR_SRSNode *poPROJCS,
+ else {
+ oValIter2 = oValMap.find( std::string(SRS_PP_LATITUDE_OF_ORIGIN) );
+ if (oValIter2 != oValMap.end() ) {
+- oOutList.push_back( std::make_pair( CF_PP_STD_PARALLEL_1,
++ oOutList.push_back( std::make_pair( std::string(CF_PP_STD_PARALLEL_1),
+ oValIter2->second) );
+ }
+ else {
+@@ -5153,9 +5153,9 @@ void NCDFWriteProjAttribs( const OGR_SRSNode *poPROJCS,
+ }
+ /* for SRS_PP_SCALE_FACTOR write 2 mappings */
+ else if ( EQUAL(pszGDALAtt->c_str(), SRS_PP_SCALE_FACTOR) ) {
+- oOutList.push_back( std::make_pair( CF_PP_SCALE_FACTOR_MERIDIAN,
++ oOutList.push_back( std::make_pair( std::string(CF_PP_SCALE_FACTOR_MERIDIAN),
+ dfValue ) );
+- oOutList.push_back( std::make_pair( CF_PP_SCALE_FACTOR_ORIGIN,
++ oOutList.push_back( std::make_pair( std::string(CF_PP_SCALE_FACTOR_ORIGIN),
+ dfValue ) );
+ }
+ /* if not found insert the GDAL name */
+--
+1.7.10.3
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list