Comment 2 for bug 179369

Revision history for this message
Popolon (popolon) wrote :

That's not the case in ImageMagick-6.3.4 at least.

I'm not an expert of configure.ac but, in my autogen.sh generated (from svn) configure script, I have the following libs : LIBS="-lMagick++ -llcms -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lz -lpthread -lm -lpthread $LIBS"

libXext and libX11 are not in the ImagaMagick pkg-config definition files too, instead Magick++-config script is called from configure.ac
It is called with the --libs to have libs
and shoud be called with --ldflags to have ldflags (library path are in ldflags), this return to me :

-L/opt/gfx/imagemagick-6.3.4/lib -L/opt/X11R7.2/lib -lfreetype -lz

Here are the change that works for me :

AC_CHECK_LIB(Magick++, InitializeMagick, [AC_CHECK_HEADER(Magick++.h, magick_ok=yes, magick_ok=no)], magick_ok=no, -llcms -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lz -lpthread -lm -lpthread `Magick++-config --ldflags`)

if test "x$magick_ok" = "xyes"; then
        AC_CHECK_PROG(MAGICKPP_CONFIG, Magick++-config, yes, no)
        if test "x$MAGICKPP_CONFIG" = "xyes"; then
                IMAGEMAGICK_LIBS=`Magick++-config --libs`
                IMAGEMAGICK_LDFLAGS=`Magick++-config --ldflags`
                AC_SUBST(IMAGEMAGICK_LIBS)
                AC_SUBST(IMAGEMAGICK_LDFLAGS)
                AC_DEFINE(WITH_IMAGE_MAGICK,1,[Image Magick++ support for bitmap effects])
        fi
fi

I believe than only changing :

AC_CHECK_LIB(Magick++, InitializeMagick, [AC_CHECK_HEADER(Magick++.h, magick_ok=yes, magick_ok=no)], magick_ok=no, -llcms -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lz -lpthread -lm -lpthread `Magick++-config --ldflags`)

and
IMAGEMAGICK_LIBS=`Magick++-config --libs`
by
IMAGEMAGICK_LIBS=`pkg-config --libs Imagemagick++`

is enough, but I have check more.