diff --git a/m4/wm_imgfmt_check.m4 b/m4/wm_imgfmt_check.m4 index b5adf6f4..2236e6cc 100644 --- a/m4/wm_imgfmt_check.m4 +++ b/m4/wm_imgfmt_check.m4 @@ -313,8 +313,12 @@ AS_IF([test "x$enable_magick" = "xno"], dnl The library was found, check if header is available and compiles wm_save_CFLAGS="$CFLAGS" AS_IF([wm_fn_lib_try_compile "MagickWand/MagickWand.h" "MagickWand *wand;" "wand = NewMagickWand()" "$wm_cv_libchk_magick_cflags"], - [wm_cv_libchk_magick="$wm_cv_libchk_magick_cflags % $wm_cv_libchk_magick_libs"], - [AC_MSG_ERROR([found MagickWand library but could not compile its header])]) + [wm_cv_libchk_magick="$wm_cv_libchk_magick_cflags % $wm_cv_libchk_magick_libs" + wm_cv_libchk_mgick_version=7], + [wm_fn_lib_try_compile "wand/magick_wand.h" "MagickWand *wand;" "wand = NewMagickWand()" "$wm_cv_libchk_magick_cflags"], + [wm_cv_libchk_magick="$wm_cv_libchk_magick_cflags % $wm_cv_libchk_magick_libs" + wm_cv_libchk_magick_version=6], + [AC_MSG_ERROR([found MagickWand library but could not compile its header])]) CFLAGS="$wm_save_CFLAGS"])dnl ]) AS_IF([test "x$wm_cv_libchk_magick" = "xno"], @@ -323,7 +327,7 @@ AS_IF([test "x$enable_magick" = "xno"], [supported_gfx="$supported_gfx Magick" MAGICKFLAGS=`echo "$wm_cv_libchk_magick" | sed -e 's, *%.*$,,' ` MAGICKLIBS=`echo "$wm_cv_libchk_magick" | sed -e 's,^.*% *,,' ` - AC_DEFINE([USE_MAGICK], [1], + AC_DEFINE_UNQUOTED([USE_MAGICK], [$wm_cv_libchk_magick_version], [defined when MagickWand library with header was found])]) ]) AM_CONDITIONAL([USE_MAGICK], [test "x$enable_magick" != "xno"])dnl diff --git a/wrlib/load_magick.c b/wrlib/load_magick.c index 1edbebc3..dbbfe92d 100644 --- a/wrlib/load_magick.c +++ b/wrlib/load_magick.c @@ -22,7 +22,11 @@ #include "config.h" +#if USE_MAGIC < 7 +#include +#else #include +#endif #include "wraster.h" #include "imgformat.h"