Summary: | sci-libs/gdal-1.6.0-r1 fails to compile because of wrong number of parameter for macros min/max | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Juergen Rose <rose> |
Component: | [OLD] Library | Assignee: | Sci-geo Project <sci-geosciences> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | Martin.vGagern, nerdboy, williamspatrick |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Change order of includes in gdal |
Description
Juergen Rose
2009-07-13 13:32:43 UTC
I could not recreate with gcc 4.4.2 or 4.4.3, but this appears to be an issue with MySQL, addressed upstream: http://bugs.mysql.com/bug.php?id=28184 The min and max macros are defined in /usr/include/mysql/my_global.h and conflict with stl library definitions when compiling C++ code. One quick patch for gdal might be to move the include in ogr/ogrsf_frmts/mysql/ogr_mysql.h to after "ogrsf_frmts.h": ---------------- #include <my_global.h> #include <mysql.h> #ifdef bool #undef bool #endif #include "ogrsf_frmts.h" <---- move this up to before mysql includes ------------- I also noticed that the DEPEND in gdal-1.6.0-r1.ebuild does not appear right: DEPEND="${RDEPEND} perl? ( python? ( ruby? ( >=dev-lang/swig-1.3.28 ) ) ) doc? ( app-doc/doxygen )" swig is needed for "if (perl || python || ruby)" not "if (perl && python && ruby)", which is how it is currently written. Created attachment 199619 [details, diff] Change order of includes in gdal (In reply to comment #1) > One quick patch for gdal might be to move the include in > ogr/ogrsf_frmts/mysql/ogr_mysql.h to after "ogrsf_frmts.h": Tried that, looks good, as it did compile successfully. Patch attached. Should the mysql herd be cc'ed to this report, in order to deal with the issue more properly? I had a look at the mysql sources on launchpad, both 5.1 and 6.0 branches. Seems that this is the only thing they did to those min/max macros: http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1/revision/2476.385.1 While this probably makes mysql itself compile under gcc 4.2.1, it doesn't solve the issue for gdal. So this patch against gdal is still required, at least until there is a better fix for mysql. The patch worked for me, even after installing hdf5-1.8.3. Is this still relevant for more recent versions of sci-libs/gdal? I cant reproduce this with mysql-5.1 and gdal-1.7 please reopen if you have issues with such setup. I can't reproduce this issue with mysql-5.1.50-r1 and gdal-1.7.2-r1 either. |