[gdal-dev] bug report -- cpl_config.h should not be installed

Carnë Draug carandraug+dev at gmail.com
Wed Jan 27 10:09:35 PST 2016


On 27 January 2016 at 17:55, Even Rouault <even.rouault at spatialys.com> wrote:
> Le mercredi 27 janvier 2016 18:42:19, Carnë Draug a écrit :
>> Hello
>>
>> I am using an email instead of your bug tracker because the later requires
>> yet another account on another site (osgeo.org).
>>
>> The bug is that cpl_config.h is installed and included from other gdal
>> public headers (at least cpl_port.h, not sure if also from others).
>> Why this is an issue is an autotools FAQ "Why should config.h not be
>> installed?" [1] which also explains how to fix it.  Unfortunately, the
>> link to the page that also explains why that is an issue is dead but it
>> can still be seen from the web archive [2].
>>
>> You may not be affected by this issue until you try to make gdal work
>> with another project that has the same bug. Then definitions start to
>> collide.
>>
>> Also, note that this was originally reported 9 years ago [3] and closed
>> as fixed (that doesn't look right to me).  The bug is still present.
>> The autoconf FAQ suggests a fix.
>
> I don't think the issue is so easy to fix unfortunately. See
> https://trac.osgeo.org/gdal/ticket/4810 and
> https://trac.osgeo.org/gdal/ticket/4282
>
> If it is, a patch is welcome (and even if it hard to fix, a patch is also even
> more welcome :-) )
>
> A potential alternative solution that hasn't been mentionned in the tickets
> and I'm thinking of would be to have all the #define of cpl_config.h prefixed
> with CPL_ . Requires both changes in configure.in and source code that use
> those #define.
>

But that is the solution provided in the autoconf faq that I linked [1].
It even suggests an autoconf macro in the autoconf archive that does
it.  The autoconf also suggests to create a separate header template
with only the macros that gdal really needs.

Carnë

[1] http://www.gnu.org/software/automake/faq/autotools-faq.html#Why-should-config_002eh-not-be-installed_003f
[2]


More information about the gdal-dev mailing list