Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 May 2012 22:13:55 +0200
From:      Rainer Hurling <rhurlin@gwdg.de>
To:        "coder.tuxfamily" <coder@tuxfamily.org>
Cc:        sunpoet@FreeBSD.org, freebsd-ports@freebsd.org
Subject:   Re: graphics/gdal 1.9.0 does not build on CURRENT
Message-ID:  <4FBAA203.90201@gwdg.de>
In-Reply-To: <4FBA997C.6010000@tuxfamily.org>
References:  <4FBA9620.3020207@gwdg.de> <4FBA997C.6010000@tuxfamily.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 21.05.2012 21:37 (UTC+1), coder.tuxfamily wrote:
> Hello,
>
> It's a problem know by GDAL.
>
> In the 1.9.0 with PGSQL, gdal don't build because of include in
> cpl_recode_iconv.cpp.
>
> You can corrige this with include "${CPPFLAGS}" in configure files.
>
> You can see the trac on OSGeo : http://trac.osgeo.org/gdal/ticket/4525
> That will be fix on 1.9.1 version.

Wow, thanks for the quick response. So the following patch against the 
1.9.0 port does it for me:

--- files/patch-configure.orig  2012-05-19 12:04:43.000000000 +0200
+++ files/patch-configure       2012-05-21 21:59:47.000000000 +0200
@@ -1,6 +1,15 @@
---- configure.orig     2011-12-23 09:51:45.000000000 +0800
-+++ configure  2011-12-23 15:30:42.540316668 +0800
-@@ -21140,10 +21140,10 @@
+--- configure.orig     2012-01-04 08:03:42.000000000 +0100
++++ configure  2012-05-21 21:58:56.000000000 +0200
+@@ -18694,7 +18694,7 @@
+     rm -f testiconv.*
+     echo '#include <iconv.h>' > testiconv.cpp
+     echo 'int main(int argc, char** argv) { iconv_t cd; return iconv 
(cd, (const char **) 0, 0, 0, 0); } ' >> testiconv.cpp
+-    if test -z "`${CXX} testiconv.cpp -c 2>&1`" ; then
++    if test -z "`${CXX} ${CPPFLAGS} testiconv.cpp -c 2>&1`" ; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: using 
ICONV_CPP_CONST=\"const\"" >&5
+ $as_echo "using ICONV_CPP_CONST=\"const\"" >&6; }
+         ICONV_CPP_CONST="const"
+@@ -21232,10 +21232,10 @@
           if { test -x "$ncdump"; }; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking libnetcdf 
version with $ncdump" >&5
   $as_echo_n "checking libnetcdf version with $ncdump... " >&6; }


But now I ran into the next problem:

creating build/temp.freebsd-10.0-CURRENT-amd64-2.7/extensions
/bin/sh /usr/local/bin/libtool --mode=compile --tag=CC cc -DNDEBUG -O2 
-pipe -O2 -fno-strict-aliasing -pipe -msse3 -O2 -pipe -O2 
-fno-strict-aliasing -pipe -msse3 -Wall -Wdeclaration-after-statement 
-DOGR_ENABLED -I/usr/local/include 
-I/usr/ports/graphics/gdal/work/gdal-1.9.0/port -I/usr/local/include 
-I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local 
-I/usr/local/include -I/usr/local -I/usr/local/include 
-I/usr/local/include -I/usr/local/include -I/usr/local 
-I/usr/local/include -I/usr -I/usr/include -fPIC -I../../port 
-I../../gcore -I../../alg -I../../ogr/ -I/usr/local/include/python2.7 
-I/usr/local/lib/python2.7/site-packages/numpy/core/include 
-I/usr/ports/graphics/gdal/work/gdal-1.9.0/include -c 
extensions/gdal_wrap.cpp -o 
build/temp.freebsd-10.0-CURRENT-amd64-2.7/extensions/gdal_wrap.o
libtool: compile:  cc -DNDEBUG -O2 -pipe -O2 -fno-strict-aliasing -pipe 
-msse3 -O2 -pipe -O2 -fno-strict-aliasing -pipe -msse3 -Wall 
-Wdeclaration-after-statement -DOGR_ENABLED -I/usr/local/include 
-I/usr/ports/graphics/gdal/work/gdal-1.9.0/port -I/usr/local/include 
-I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local 
-I/usr/local/include -I/usr/local -I/usr/local/include 
-I/usr/local/include -I/usr/local/include -I/usr/local 
-I/usr/local/include -I/usr -I/usr/include -fPIC -I../../port 
-I../../gcore -I../../alg -I../../ogr/ -I/usr/local/include/python2.7 
-I/usr/local/lib/python2.7/site-packages/numpy/core/include 
-I/usr/ports/graphics/gdal/work/gdal-1.9.0/include -c 
extensions/gdal_wrap.cpp  -fPIC -DPIC -o 
build/temp.freebsd-10.0-CURRENT-amd64-2.7/extensions/.libs/gdal_wrap.o
cc1plus: warning: command line option "-Wdeclaration-after-statement" is 
valid for C/ObjC but not for C++
extensions/gdal_wrap.cpp: In function 'PyObject* 
_wrap_VSIFTruncateL(PyObject*, PyObject*)':
extensions/gdal_wrap.cpp:6845: error: 'VSIFTruncateL' was not declared 
in this scope
extensions/gdal_wrap.cpp: In function 'PyObject* 
_wrap_MajorObject_SetMetadata__SWIG_0(PyObject*, PyObject*)':
extensions/gdal_wrap.cpp:7220: warning: deprecated conversion from 
string constant to 'char*'
error: command '/bin/sh' failed with exit status 1
gmake[2]: *** [build] Fehler 1
gmake[2]: Leaving directory 
`/usr/ports/graphics/gdal/work/gdal-1.9.0/swig/python'
gmake[1]: *** [build] Fehler 2
gmake[1]: Leaving directory `/usr/ports/graphics/gdal/work/gdal-1.9.0/swig'
gmake: *** [swig-modules] Fehler 2
*** [do-build] Error code 1
Stop in /usr/ports/graphics/gdal.


> Loïc.
>
>
> Le 21.05.2012 21:23, Rainer Hurling a écrit :
>> Thanks for the update of graphics/gdal to version 1.9.0.
>>
>> It builds fine on 9.0 (amd64), but fails on 10.0-CURRENT (amd64):
>>
>> [..snip..]
>> libtool: compile: c++ -O2 -pipe -O2 -fno-strict-aliasing -pipe -msse3
>> -Wall -DOGR_ENABLED -I/usr/local/include
>> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/port -I/usr/local/include
>> -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local
>> -I/usr/local/include -I/usr/local -I/usr/local/include
>> -I/usr/local/include -I/usr/local/include -I/usr/local
>> -I/usr/local/include -I/usr -I/usr/include -DHAVE_LIBZ -c
>> cpl_recode_iconv.cpp -fPIC -DPIC -o .libs/cpl_recode_iconv.o
>> cpl_recode_iconv.cpp: In function 'char* CPLRecodeIconv(const char*,
>> const char*, const char*)':
>> cpl_recode_iconv.cpp:92: error: invalid conversion from 'char**' to
>> 'const char**'
>> cpl_recode_iconv.cpp:92: error: initializing argument 2 of 'size_t
>> libiconv(void*, const char**, size_t*, char**, size_t*)'
>> cpl_recode_iconv.cpp: In function 'char* CPLRecodeFromWCharIconv(const
>> wchar_t*, const char*, const char*)':
>> cpl_recode_iconv.cpp:243: error: invalid conversion from 'char**' to
>> 'const char**'
>> cpl_recode_iconv.cpp:243: error: initializing argument 2 of 'size_t
>> libiconv(void*, const char**, size_t*, char**, size_t*)'
>> gmake[1]: *** [cpl_recode_iconv.lo] Fehler 1
>> gmake[1]: Leaving directory
>> `/usr/ports/graphics/gdal/work/gdal-1.9.0/port'
>> gmake: *** [port-target] Fehler 2
>> *** [do-build] Error code 1
>> Stop in /usr/ports/graphics/gdal.
>>
>>
>> It seems there is a portability issue with ICONV_CPP_CONST like it is
>> described in port/cpl_recode_iconv.cpp:l76ff ?
>>
>> /*
>> -------------------------------------------------------------------- */
>> /* XXX: There is a portability issue: iconv() function could be */
>> /* declared differently on different platforms. The second */
>> /* argument could be declared as char** (as POSIX defines) or */
>> /* as a const char**. Handle it with the ICONV_CPP_CONST macro here. */
>> /*
>> -------------------------------------------------------------------- */
>>
>> Please let me know, if you need more details.
>>
>> Thanks again,
>> Rainer
>>
>>
>> P.S.: ports/166605 should be obsolete now?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FBAA203.90201>