Recommended version of SWIG for building mapscript

Umberto Nicoletti umberto.nicoletti at GMAIL.COM
Thu Aug 24 03:02:39 EDT 2006


On 8/23/06, Daniel Morissette <dmorissette at mapgears.com> wrote:
> I believe Steve is still using 1.3.21 on cvs.gis.umn.edu to package the
> releases, that's probably the only reference if there is one. In a
> discussion on this list earlier in July I think we concluded that for
> 5.0 we should look at upgrading to a new version to start including C#
> and Java interfaces in the source package as well. Note that at the time
> we were discussing 4.8.4 vs 5.0 and 4.10 was not in the air yet, but I
> think it's too late to switch SWIG version for the source distribution
> for 4.10 especially if that would result in incompatible interfaces. (I
> was not aware that upgrading SWIG meant incompatible interfaces. That's
> no good!)

Me neither, but now that I have upgraded I found that Java mapscript
tests don't compile because of a new default way to handle
enumerations.
Before swig 1.3.24 enums where treated like static final int (java
equivalent for constant) declared in a mapscriptConstants class.
After 1.3.24 anonymous enums are still treated like that while named
enums go in a class named after the enum (for instance MS_IMAGEMODE)
and values are treated like objects, not plain integers, which
requires awful coding.

A quick solution is to revert swig behaviour to 1.3.21 with a macro
and this will allow compilation of the tests, but will break
compatibility with MS4W.
Otherwise I'll change the tests code to comply with the new swig and
delay possible breakage of backward compatibility until 5.0.

For 5.0 we should adopt a common version of swig for all devs and distributors.

Umberto


>
> I'll let Assefa comment on the version of SWIG used for MS4W.
>
> Daniel
>
>
> Umberto Nicoletti wrote:
> > Devs,
> > do we have a recommended swig version?
> >
> > I am still using 1.3.21 but that seems not to be what is used to build
> > MS4W.
> > Versions of swig greater than 1.3.24 break the java tests because of a
> > new way of handling enumerations. There is a quick fix for Java that
> > makes newer swig handle enumerations like in 1.3.21, but I fear this
> > will break apps of existing MS4W users.
> >
> > Maybe we should decide to adopt a common version on swig to avoid
> > these kind of issues in the future?
> >
> > Umberto
> >
>
>
> --
> Daniel Morissette
> http://www.mapgears.com/
>



More information about the mapserver-dev mailing list