Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Jun 2012 17:53:45 +0200
From:      Rainer Hurling <rhurlin@gwdg.de>
To:        sunpoet@FreeBSD.org
Cc:        freebsd-ports@freebsd.org
Subject:   Re: graphics/gdal 1.9.0 is broken again
Message-ID:  <4FCCDA09.5050808@gwdg.de>
In-Reply-To: <4FCCCA93.40408@gwdg.de>
References:  <4FCCCA93.40408@gwdg.de>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070808040009000604080307
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

On 04.06.2012 16:47 (UTC+2), Rainer Hurling wrote:
> After big update session from weekend, when trying to build
> graphics/gdal, I get the following messages:
>
> [...]
> gmake[2]: Entering directory
> `/usr/ports/graphics/gdal/work/gdal-1.9.0/frmts/gif'
> /bin/sh /usr/local/bin/libtool --mode=compile --tag=CXX c++ -O2 -pipe
> -O2 -fno-strict-aliasing -pipe -msse3 -Wall
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/port
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/gcore
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/alg
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/ogr
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/ogr/ogrsf_frmts -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 -c -o
> ../o/gifdataset.lo gifdataset.cpp
> libtool: compile: c++ -O2 -pipe -O2 -fno-strict-aliasing -pipe -msse3
> -Wall -I/usr/ports/graphics/gdal/work/gdal-1.9.0/port
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/gcore
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/alg
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/ogr
> -I/usr/ports/graphics/gdal/work/gdal-1.9.0/ogr/ogrsf_frmts -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 -c
> gifdataset.cpp -fPIC -DPIC -o ../o/.libs/gifdataset.o
> gifdataset.cpp: In static member function 'static GDALDataset*
> GIFDataset::CreateCopy(const char*, GDALDataset*, int, char**, int
> (*)(double, const char*, void*), void*)':
> gifdataset.cpp:599: error: 'PrintGifError' was not declared in this scope
> gifdataset.cpp:625: error: 'PrintGifError' was not declared in this scope
> gmake[2]: *** [../o/gifdataset.lo] Fehler 1
> gmake[2]: Leaving directory
> `/usr/ports/graphics/gdal/work/gdal-1.9.0/frmts/gif'
> gmake[1]: *** [gif-install-obj] Fehler 2
> gmake[1]: Leaving directory
> `/usr/ports/graphics/gdal/work/gdal-1.9.0/frmts'
> gmake: *** [frmts-target] Fehler 2
> *** [do-build] Error code 1
>
>
> This also happens on pointyhat, eg:
>
> http://pointyhat.freebsd.org/errorlogs/amd64-errorlogs/e.7.20120603171103/gdal-1.9.0_1.log
>
>
>
> Could this be related to the update of graphics/giflib?

Sorry for answering myself. I just found that it is fixed upstream for 
existing 1.9 branches and upcoming gdal 1.9.2 (trunk), see

http://trac.osgeo.org/gdal/ticket/4675

I attached a patch for our ports version 1.9.0, which should solve this 
issue.

> Thanks for any help,
> Rainer Hurling


--------------070808040009000604080307
Content-Type: text/plain; charset=ISO-8859-15;
	name="patch-frmts__gif__gifdataset.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="patch-frmts__gif__gifdataset.cpp"

--- frmts/gif/gifdataset.cpp.orig	2012-01-04 08:03:28.000000000 +0100
+++ frmts/gif/gifdataset.cpp	2012-06-04 17:21:24.000000000 +0200
@@ -470,6 +470,28 @@
 }
 
 /************************************************************************/
+/*                        GDALPrintGifError()                           */ 
+/************************************************************************/ 
+
+static void GDALPrintGifError(const char* pszMsg) 
+{ 
+/* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */ 
+/* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */ 
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \ 
+        ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) 
+    /* Static string actually, hence the const char* cast */ 
+    const char* pszGIFLIBError = (const char*) GifErrorString(); 
+    if (pszGIFLIBError == NULL) 
+        pszGIFLIBError = "Unknown error"; 
+    CPLError( CE_Failure, CPLE_AppDefined, 
+              "%s. GIFLib Error : %s", pszMsg, pszGIFLIBError ); 
+#else 
+    PrintGifError(); 
+    CPLError( CE_Failure, CPLE_AppDefined, "%s", pszMsg ); 
+#endif 
+} 
+
+/************************************************************************/ 
 /*                             CreateCopy()                             */
 /************************************************************************/
 
@@ -596,9 +618,7 @@
                           psGifCT->ColorCount, 255, psGifCT) == GIF_ERROR)
     {
         FreeMapObject(psGifCT);
-        PrintGifError();
-        CPLError( CE_Failure, CPLE_AppDefined, 
-                  "Error writing gif file." );
+        GDALPrintGifError("Error writing gif file.");
         EGifCloseFile(hGifFile);
         VSIFCloseL( fp );
         return NULL;
@@ -622,9 +642,7 @@
 
     if (EGifPutImageDesc(hGifFile, 0, 0, nXSize, nYSize, bInterlace, NULL) == GIF_ERROR )
     {
-        PrintGifError();
-        CPLError( CE_Failure, CPLE_AppDefined, 
-                  "Error writing gif file." );
+        GDALPrintGifError("Error writing gif file.");
         EGifCloseFile(hGifFile);
         VSIFCloseL( fp );
         return NULL;

--------------070808040009000604080307--



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