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
--- 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;
_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"