[Xastir-dev] ImageMagick causing trouble again...

Tom Russo russo at bogodyn.org
Wed Nov 7 16:26:07 EST 2007


On Wed, Nov 07, 2007 at 01:27:38PM -0700, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> On Wed, Nov 07, 2007 at 08:15:33AM -0800, we recorded a bogon-computron collision of the <archer at eskimo.com> flavor, containing:
> > 
> > After I did the stable release yesterday I updated the machine at
> > home to 1.9.2 and found a bug.  It seems ImageMagick has
> > commandeered the "VERSION" define.  If you do Help->About it says
> > Xastir is version "6.3.5", which of course is the IM version.
> > 
> > It looks like "VERSION" is actually used in main.c and interface.c.

Yeah, but Magick only causes us problems in main.c (because interface.c 
doesn't include magick's api.h

> > We either need to protect the define in main.c (two places) and
> > interface.c (one place), or define an entirely new variable in
> > configure.ac/acinclude.m4 that is less likely to be commandeered by
> > other packages.  We also have the "PACKAGE_VERSION" define but I
> > think that may have been taken over by IM as well.

> Take a look in main.c for the comment "JMT - stupid ImageMagick" and the
> fix appears clear.  Jack apparently encountered a related problem in 
> ImageMagick years ago and kludged around it.  They appear to have introduced
> a new issue whose fix is probably the same.

Unfortunately, Jack's hack only shuts up make warnings, it does not actually
preserve the contents of the macro for our usage.   I tried it by copying
what he did to PACKAGE_BUGREPORT and so forth, and it resulted in compiler
errors.

The trick, I found, is to create a char * variable in main.c for each
of the purposes, and then initialize them to PACKAGE and VERSION before
including magick's api.h, then undef them.  This gets rid of the compiler
warning about redefining the macros, and doesn't involve recursive macro
substitution that breaks our usage (as the "Stupid ImageMagick" hack does.

The problem is that magick's api.h includes their config.h, which is a Bad Thing
that will interfere with *any* code that uses an autoheader-generated config.h
and includes api.h.

I'm committing the fix shortly.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick



More information about the Xastir-dev mailing list